Operating System - HP-UX
1756510 Members
2936 Online
108848 Solutions
New Discussion юеВ

Re: Creating a new logical volume in vg00 and mirroring it

 
SOLVED
Go to solution
Morris Makuch
Advisor

Creating a new logical volume in vg00 and mirroring it

Hi everyone. I would like to create a new logical volume in vg00. I have 2 physical disks in this volume group and they are mirrored. I have 92,224M free which I assume is the total free for both disks. I want the new volume to be 20,000M. How would I go about creating this new logical volume in vg00 and making sure that it is mirrored?
7 REPLIES 7
Robert-Jan Goossens
Honored Contributor
Solution

Re: Creating a new logical volume in vg00 and mirroring it

Morris,

Change the lv_name and the device file for the disks in below commands.

# lvcreate -n lv_name /dev/vg00
# lvextend -L size_in_MB /dev/vg00/lvhome /dev/dsk/c0t0d0
# lvextend -m 1 /dev/vg01/lvhome /dev/dsk/c1t0d0
# newfs -F vxfs -o largefiles /dev/vg00/r_lvol_name
# mkdir mount_point
add the lvol devices file and mountpoint to the /etc/fstab
# mount -a

Regards,
Robert-Jan
Aussan
Respected Contributor

Re: Creating a new logical volume in vg00 and mirroring it

lvcreate -n lvdata -L 20000 vg00
newfs -F /dev/vg00/rlvdata

lvextend -m 1 /dev/vg00/ldata /dev/dsk/c#t#d#
The tongue weighs practically nothing, but so few people can hold it
Torsten.
Acclaimed Contributor

Re: Creating a new logical volume in vg00 and mirroring it

Let's assume your disks are c1t0d0 and c2t0d0, your new lvol is lvol10.

create the lvol (0 MB size)

# lvcreate -n lvol10 vg00

now extend (very small size = 1 PE) it to the first disk

# lvextend -L 4 /dev/vg00/lvol10 /dev/dsk/c1t0d0

now mirror to the second

# lvextend -m 1 /dev/vg00/lvol10 /dev/dsk/c2t0d0

now the big pro: if you extend the lvol now, it is already mirrored (safes a lot of time):

# lvextend -L 20000 /dev/vg00/lvol10

create a filesystem and mount it.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Morris Makuch
Advisor

Re: Creating a new logical volume in vg00 and mirroring it

Thanks Robert-Jan. But don't you mean vg00 not vg01 in the lvextend -m command?
Robert-Jan Goossens
Honored Contributor

Re: Creating a new logical volume in vg00 and mirroring it

Yes you are right, sorry typo :-)
Morris Makuch
Advisor

Re: Creating a new logical volume in vg00 and mirroring it

Great! Thanks guys for your responses
Bill Hassell
Honored Contributor

Re: Creating a new logical volume in vg00 and mirroring it

The sync process can take a long time. You can shorten this time by combining -m 1 and -L 20000, something like this:

lvextend -L 20000 -m 1 /dev/vg00/lvol10

This will complete almost instantly and be ready for use immediately.


Bill Hassell, sysadmin