1833914 Members
2134 Online
110063 Solutions
New Discussion

HOW TO mount a vg01

 
Danilo Marcucci_1
Occasional Contributor

HOW TO mount a vg01

I want mount an external disk already configuration on an other machine. Its
name was vg01. Into it there are 2 partitions with data.
How To this?
I unknow the system UP-Unix because I use it only since few months.
Thank
4 REPLIES 4
Carlos Riera
Frequent Advisor

Re: HOW TO mount a vg01

Hi Danilo:

On fisrt server do:

- vgchange -a n /dev/vg01
- vgexport /dev/vg01

On second:
I supose a warm disk instalation:
- Run ioscan -fnCdisk > /tmp/disks
- Insert new disks
- Run ioscan -fnCdisk > /tmp/disks2
check differences between both files searching for hardware path and device
names.

- Create device files if needed for each disk
insf -H hardware_path
- Create a new vg for vgimport
mkdir /dev/vgnew
mknod /dev/vgnew/group c 64 0x0#0000 # #is a vgnumber not in use.
-Vgimport /dev/vgnew /dev/dsk/cxtxdx /dev/dsk/cytydy
ll /dev/vgnew # now you can see both lvols
Vgchange -a y /dev/vgnew

That`s all.


See man ioscan ,insf , and vgimport.

Good luck.


Paul Heffels_1
Frequent Advisor

Re: HOW TO mount a vg01

Hi,

First off: You will want to be very carefull with importing volume groups since
you will only have 1 shot at it.

I have seen this go wrong a few times already, so make sure you have a good
backup of your disk (while still on the other system?)! Just in case.

I will write down the steps you'll need to take, but I asume you don't have a
map file from your export, so I'll explain what should be in there. The map
file is used by for vgimport for logical volume information. To create it
manually, you will need to know the names of the lvol's. Once you know that,
create a textfile in the following format:
For example a text file containing only:
1 lvol1
2 lvol2

Here's what you will need to do (taken from HP Instant Information):

1. Shutdown the system, connect the harddisk and boot the system again.

2. After booting, identify the disk device by using the ioscan command.
/usr/sbin/ioscan -fn -C disk will display all disks and their device special
files. Or, you can use /usr/sbin/ioscan -H hardware_path -fn to identify the
disk device by location.

3. Scan your current system to identify all disks by their volume groups.

/usr/sbin/vgscan -v

4. Create a directory for the volume group to which the new LVM disk will
belong. For example, a new volume group might be called vg06.

mkdir /dev/vg06

5. Check to make sure that you are creating a unique minor number for the new
group file. Then create a character device special file for the new volume
group's group file. The character major number for LVM is 64. In the minor
number, n must be in the range between 0 and 9, because the maximum number of
volume groups by default allowed on a system is ten. You can increase the
number by changing the operating-system parameter maxvgs in
/usr/conf/master.d/core-hpux or by using SAM.

ll /dev/*/group
mknod /dev/vg06/group c 64 0x0n0000

6. Import the LVM disk to the current system, citing the the block device
special file name you noted when the system booted up and the mapfile you
created before starting these procedures. You can preview the effect of the
import by using the -p option.

vgimport -pv -m mapfile /dev/vg06 block_device_special_file

vgimport -v -m mapfile /dev/vg06 block_device_special_file

The vgimport command adds the volume group name to the /etc/lvmtab file. It
also adds the device special files associated with the volume group's logical
volumes to the system.

7. Activate the new volume group.

/usr/sbin/vgchange -a y /dev/vg06

8. Mount the logical volumes to their new mount point. For further information
on mounting and unmounting, consult the Managing Systems and Workgroups manual.

mkdir /new_location
mount /dev/vg06/lvol1 /new_location

Good Luck!!!
Dan Hull
Regular Advisor

Re: HOW TO mount a vg01

Thank you for the detailed answers, Paul and Carlos. I'd like to clear a few
things up though. First, the absolute easiest way to import a VG is through
SAM. Now I know some people don't like to use it, but I've never heard of it
messing this up, and it's so much easier than doing it manually!

Once the disks are conected (while system is off, obviously) and the system is
back up, run SAM.

Go into "Disks & File Systems" and then into "Volume Groups". Go up to the
"Actions" menu and select "Import". It will scan the system for all disks that
have LVM info on them and aren't currently in a VG.

Just select the VG you want from the list (normally there will be only one) and
give it a name. Viola, you are done. Now you just need to mount the lvols,
which you can also do through SAM if you want.

In any case, I'm not sure what Paul means when he says you only have one chance
at this. vgimport, just like vgexport, does not modify any information on the
disks themselves, only the system files that define the disks belonging to the
VG and the LVM structure under it in the system itself. You could import/export
all day long and the info on the disk will never change.
Paul Heffels_1
Frequent Advisor

Re: HOW TO mount a vg01

Hi Dan,

You're right of course about being able to import as much as you like without
overwriting the logical volumes. My remark should be seen as "shock therapy".
The originator mentioned that he/she doesn't have much experience with HP-UX.
I've seen imports go wrong before (frequent readers of this forum might
remember it) when an import-sequence isn't carried out exactly as described.
The person who did it accidently ended up creating a new logical volume thus
overwriting the one on disk.
By doing the import using SAM, things indeed become a lot easier. I usually
don't use SAM for these matters, but that's a personal prefference.

I will refrain from using "shock therapy" in my posts because (and you are
absolutely right in pointing it out), it was incorrect information.