Operating System - HP-UX
1751959 Members
5678 Online
108783 Solutions
New Discussion юеВ

create new lvol in mirror env

 
Fauziah Mahdan
Super Advisor

create new lvol in mirror env

Hi all,
Need to confirm the step below to create new lvol in mirror disk env.
1) lvcreate -n lvolx /dev/vg00/lvolx
2) lvextend -L xxxx /dev/vg00/lvolx
3) newfs -F vxfs /dev/vg00/rlvolx
mount the dir
add in fstab
/dev/vg00/lvolx /u0x vxfs delaylog 0 2

FYI it was itanium RX4640 server
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: create new lvol in mirror env

In your steps, you never mirror the LV.

1) lvcreate -L -n lvolx -m 1 /dev/vg00 /dev/dsk/c?t?d?s? /dev/dsk/c?t?d?s?

2) newfs

3) mount

4) add to /etc/fstab
Fauziah Mahdan
Super Advisor

Re: create new lvol in mirror env

Patrick I am confuse which disk will be in the cxtxdxsx and the cxtxdx?

Pls see below ioscan result for the disk
target 3 0/1/1/0.0 tgt CLAIMED DEVICE
disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c2t0d0 /dev/rdsk/c2t0d0
/dev/dsk/c2t0d0s1 /dev/rdsk/c2t0d0s1
/dev/dsk/c2t0d0s2 /dev/rdsk/c2t0d0s2
/dev/dsk/c2t0d0s3 /dev/rdsk/c2t0d0s3
target 4 0/1/1/0.1 tgt CLAIMED DEVICE
disk 2 0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 73.4GST373454LC
/dev/dsk/c2t1d0 /dev/rdsk/c2t1d0
/dev/dsk/c2t1d0s1 /dev/rdsk/c2t1d0s1
/dev/dsk/c2t1d0s2 /dev/rdsk/c2t1d0s2
/dev/dsk/c2t1d0s3 /dev/rdsk/c2t1d0s3
Fauziah Mahdan
Super Advisor

Re: create new lvol in mirror env

from the HP work sheet.
it mirrored my vg00 to alternate disk 0/1/1/0.0.0

Does it means the disk1 is the alt disk c2t0d0s?

so the command should be
lvcreate -L 2000 -n /lvol11 -m 1 /dev/vg00 /dev/dsk/c0t1d0sX /dev/dsk/c0t0d0s?

s value is what 4 is it?
Fauziah Mahdan
Super Advisor

Re: create new lvol in mirror env

sorry,
too early to reply
from vgdislay
--- Physical volumes ---
PV Name /dev/dsk/c2t1d0s2
PV Status available
Total PE 4318
Free PE 1031
Autoswitch On

PV Name /dev/dsk/c2t0d0s2
PV Status available
Total PE 4318
Free PE 1031
Autoswitch On

so the command will be
1) lvcreate -L 2000 -n lvol11 -m /dev/vg00 /dev/dsk/c0t1d0s2 /dev/dsk/c0t0d0s2
2) newfs -F vxfs /dev/vg00/rlvol11
3) mount /dev/vg00/lvol11 /u03
4) add in /etc/fstab
/dev/vg00/lvol11 /u03 vxfs delaylog 0 2


Pls confirm :-)
SANTOSH S. MHASKAR
Trusted Contributor

Re: create new lvol in mirror env

Hi,

If u have 2 disks in vg00 look at the o/p
of

# strings /etc/lvmtab

it shows all the disks in vg00
eg.

#strings /etc/lvmtab
/dev/vg00
/dev/dsk/c0t6d0s2
/dev/dsk/c4t6d0s2

then to create a mirrored lv and file system on it

1) lvcreate -L 2000 -n lvol11 -m /dev/vg00 /dev/dsk/c0t6d0s2 /dev/dsk/c4t6d0s2
2) newfs -F vxfs /dev/vg00/rlvol11
3) mount /dev/vg00/lvol11 /u03
4) add in /etc/fstab
/dev/vg00/lvol11 /u03 vxfs delaylog 0 2
5) vgcfgbackup /dev/vg00

Also don't forget to add options for filesystem creation
in step 2 (if u want support for largefiles etc.) and make sure all the disks in
vg00 are bootable.

# lvlnboot -v




Thomas J. Harrold
Trusted Contributor

Re: create new lvol in mirror env

Hello, if you only have two disk in your volume group, LVM is smart enough to place extents fro m each of the mirrors on different disks.

If you had 3 (or more) disks in your VG, you would consider specifying which physical disk to use (from vgdisplay -v output), but in this case you do not have to.

Simply create your new LV with the "-m 1" option, and you'll be good to go.

You can verify with "lvdisplay -v" and "pvdisplay -v" commands.

-tjh
I learn something new everyday. (usually because I break something new everyday)
MHudec
Frequent Advisor

Re: create new lvol in mirror env

1.) lvcreate -n lvolx vg00
- this will create dummy logical volume named /dev/vg00/lvolx with 0 extents (you will later decide on which physical volume will this logical volume exist

2.) lvextend -l xxx /dev/vg00/lvolx /dev/dsk/cxtxdxs2
- xxx is number of logical extents (for example you want to have 400M logical volume and you have physical extents of 4MB size, you will need 100 logical extents - 4*100 = 400), /dev/dsk/cxtxdxs2 is the the physical volume where original extents will exist, s2 is that as you say, it is itanium system (rx*)

3.) lvextend -m 1 /dev/vg00/lvolx /dev/dsk/cytxdxs2
- this will mirror the logical volume to another, mirror, physical volume cytxdx

4.) newfs -F vxfs -o options /dev/vg00/rlvolx
- this will create vxfs filesystem on our logical volume, check -o for options like largefiles etc.

5. fstab entry etc.

Notes:
- please use -l instead of -L while defining capacity of logical volume, -l uses extents, while -L uses megabytes (and thus rounding the number of extents)
- in case you want to do this on parisc systems, physical volumes will be just cxtxdx and not cxtxdxs2 (s2 is hp-ux partition on itanium disk layout, s1 is efi partition and s3 is service partition)
Fauziah Mahdan
Super Advisor

Re: create new lvol in mirror env

Thanks all for the reply
Ok next question
--- Physical volumes ---
PV Name /dev/dsk/c2t1d0s2
PV Status available
Total PE 4318
Free PE 406
Autoswitch On

PV Name /dev/dsk/c2t0d0s2
PV Status available
Total PE 4318
Free PE 406
Autoswitch On


/dev/vg00/lvol10 30720000 20130910 9927311 67% /u02


I need to reduce this /u02 into 15GB and this is the mirror disk too.
Is the step simple as :
backup the /u02

# umount /u02
# lvreduce -L 100 /dev/vg00/lvol10
Warning: The Logical Volume has a file system larger than the reduced size.Reducing the Logical Volume will cause filesystem corruption.
When a logical volume is reduced useful data might get lost; do you really want the command to proceed (y/n) : y
Logical volume "/dev/vg00/lvol10" has been successfully reduced.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg.conf

# mount /dev/vg00/lvol10 /u02
vxfs mount: /dev/vg/lvol10 is corrupted. needs checking

# newfs ├в F vxfs /dev/vg00/rlvol10
# mount /dev/vg00/lvol10 /u02
==> Restore the backup