Operating System - HP-UX
1833059 Members
2449 Online
110049 Solutions
New Discussion

How do you mount a logical volume

 
SOLVED
Go to solution
Kelli Ward
Trusted Contributor

How do you mount a logical volume

I dd my boot drive to another drive and would like to mount the /stand partition of my destination drive to my boot drive. (Only to gain access to the files in the destination drive) How do I do this?
Thanks all,
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
12 REPLIES 12
Rita C Workman
Honored Contributor

Re: How do you mount a logical volume

You mount file systems...

If for example your in single user mode you might do this:

#mount /dev/vg00/lvol1 /stand

Hope that's what you want,
Rita
Kelli Ward
Trusted Contributor

Re: How do you mount a logical volume

No that's not exactly what I want.
I have an LVM boot drive on address 6. I dd'd and exact copy of it on address 5. I would like to mount the /stand partition of the addr. 5 drive into the /tmp_mnt directory of address 6. In other words, I would like to mount the partition of one drive into the file system of another so I can see it on that system. Much the way, you could mount one "Whole-disk" drive into another on a Non-LVM system.
Sorry if the 1st explanation didn't make sense. Not enough coffee. ; )
Thank you,
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
S.K. Chan
Honored Contributor

Re: How do you mount a logical volume

Not sure how you dd'ed your disk ? If this is and LVM root disk, I assume you're doing this at single user mode ? If that's the case you can boot up your system with that duplicated disk. If this is a non-LVM disk, simply mount it with
# mount /dev/dsk/cXtXdX /temporary-dir
Deshpande Prashant
Honored Contributor
Solution

Re: How do you mount a logical volume

HI
If you are trying to create copy of root disk in case of failure, take a look at following link.


http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4e3c7b8d1de3d5118ff40090279cd0f9,00.html

Prashant.
Take it as it comes.
Helen French
Honored Contributor

Re: How do you mount a logical volume

hey,

You can 'vgimport' the destination disk to a new VG. Then mount the lv to a mount point.

# vgimport
# vgchange -a y
# vgdisplay -v
# mount /dev/vgXX/lvol1 /tmp_mount

Not sure whether u r looking for this idea ..?

SW
Life is a promise, fulfill it!
Kelli Ward
Trusted Contributor

Re: How do you mount a logical volume

Hi,
Thanks for all the replies.
Our main function is the repair of systems.
Subsequently, we have drive failure for software issues. THe ability mount problematic partitions of one drive to a working drive will help us to repair any issues on the defective partition. The dd was to give me an experamental drive. This is something I can do quite easily on a Non-LVM filesystem simply by mounting the whole "defective" drive into a tmp directory of the working drive and making any necessary changes to bring back the integrity of the ailing drive. I can't figure out how to do this on a partition of an LVM drive. Does anyone have any insights?
Thanks,
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
Jeff Machols
Esteemed Contributor

Re: How do you mount a logical volume

Kelli,

The problem you will have is the VG and LV names on the disk you dumped to are identical to the current ones on the disk. You can mount the disk as a device and read it because it's stored in LVM's so just mounting the disk device isn't going to work. The only way to get on the disk is boot off that disk, or export the current VG information into map files and do some editing, this will be tricky. You need to be really careful though, because you could interfere with current VG's.
Darrell Allen
Honored Contributor

Re: How do you mount a logical volume

Hi Kelli,

Sounds like you did:
dd if=/dev/dsk/c#t6d0 of=/dev/dsk/c#t5d0

Now you want to mount what would be /stand of target 5 disk. Is this right?

I have not tried the following so "buyer beware":

Is target 5 in a Volume Group? If not perhaps you can vgimport that disk as a VG, run fsck on the lvols (I think lvol1 of the new VG would be the copy of /stand), mkdir a mount point, and mount it. If target 5 is in a VG you could try to vgreduce it from the VG.

Again, I have no idea this will work.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Patrick Wallek
Honored Contributor

Re: How do you mount a logical volume

You could try something like:

Go into SAM -> Disks and File Systems -> Volume Groups

Then go to Actions and select Import.

This should scan your system and look for VGs that can be imported and the disks associated with those VGs. You can then put in the name of the VG that you want to import the information into, like VGTEST and say OK.

If it is successful, it will activate the VG and you can then look and see what LVs are associated with that VG (vgdisplay -v /dev/vgtest) and mount them

With a dd of a root disk, say you import it as VGTEST. You could then create a directory called /testroot and mount everything from there. To mount /stand from that disk you would do:

# mount /dev/vgtest/lvol3 /testroot
# mount /dev/vgtest/lvol1 /testroot/stand

No guarantees that this'll work, but it should get you closer.
Kelli Ward
Trusted Contributor

Re: How do you mount a logical volume

There are some interesting thoughts here, I would like to try, please feel free to send more ideas I would love to check them out. Points to follow.
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!
S.K. Chan
Honored Contributor

Re: How do you mount a logical volume

If you have Mirror/UX, it would help a lot. If you don't I would not recommend using dd to manually duplicate your root disk. Here is the process I used which works for me.
* Assuming current LVM boot disk is on c1t2d0 and you want to duplicate to c2t2d0.
# pvcreate -B /dev/rdsk/c2t2d0
# mkdir /dev/vgroot; mknod /dev/vgroot/group c 64 0x010000
# vgcreate /dev/vgroot /dev/dsk/c2t2d0
# mkboot /dev/rdsk/c2t2d0
# mkboot -a "hpux (;0)/stand/vmunix" /dev/rdsk/c2t2d0
# lifls /dev/rdsk/c2t2d0
==> do lifcp of all other boot utilities from c1t2d0 to c2t2d0.
# lvcreate -C y -r n -n lvol1 /dev/vgroot
# lvextend -L 84 /dev/vgroot/lvol1 /dev/dsk/c2t2d0
==> creating and extending boot lv (/stand)
# lvcreate -C y -r n -L 2048 -n lvol2 /dev/vgroot
==> creating swap LV
# lvcreate -C y -r n -n lvol3 /dev/vgroot
# lvextend -L 6544 /dev/vgroot/lvol3 /dev/dsk/c2t2d0
==> creating and extending root lv (/)
# lvlnboot -b lvol1 /dev/vgroot
# lvlnboot -r lvol3 /dev/vgroot
# lvlnboot -s lvol2 /dev/vgroot
# lvlnboot -d lvol2 /dev/vgroot
==> update BDRA for boot, root, swap and dump LVs.
# newfs -F hfs /dev/vgroot/rlvol1 ==> /stand must be hfs
# newfs -F vxfs /dev/vgroot/rlvol3
# mkdir /newstand
# mount /dev/vgroot/lvol1 /newstand
# cd /stand
# find . -xdev -depth -print|cpio pxdm /newstand
# umount /newstand
# mkdir /newroot
# mount /dev/vgroot/lvol3 /newroot
# cd /
# find . -xdev -depth -print|cpio pxdm /newroot
# cd /newroot/etc
# vi fstab
==> edit appropriately
# lvlnboot -R
==> resync vg headers
# setboot -p 0/0/2/0.2.0
==> change prim boot path to new disk (c2t2d0)

The above assume you have /, /stand and swap only. If you have separate /opt, /usr, /tmp mounted for example, perform appropriate lvcreate on those. When it's all done you should be able to boot up from your 2nd disk. From here onwards, you have to manually synchronize both your boot disks.
Kelli Ward
Trusted Contributor

Re: How do you mount a logical volume

Thank you all!
I figured it out using everyone's suggestions and another system. As it turns out, I was unable to genereate the lvol device files (using SAM) on the first system, but the second system generated them and it was cake after that. Thanks all for your assistance and Happy Holidays
Kel
The more I learn, the more I realize how much more I have to learn. Isn't it GREAT!