Operating System - HP-UX
1748036 Members
4704 Online
108757 Solutions
New Discussion

Need to create mirrored Lv

 
SOLVED
Go to solution
Sreer
Valued Contributor

Need to create mirrored Lv


Hi Gurus,

 

I need to create a mirrored Lv in my  production box.

 --- Physical volumes ---
   PV Name                     /dev/dsk/c0t6d0
   PV Status                   available
   Total PE                    4374
   Free PE                     2548
   Autoswitch                  On
   Proactive Polling           On

   PV Name                     /dev/dsk/c0t5d0
   PV Status                   available
   Total PE                    4374
   Free PE                     2573
   Autoswitch                  On
   Proactive Polling           On


Iam bit confused for the LV creation.

Can I use the below option?


lvcreate -m 1 -n lvname -L 100M  vgname  ==> will it work?

Or do I need to create an Lv with 0 size and to mirror to another disk?

Or need to create LV and then extend to other disk?

like:

lvcreate -n lvname -L 200M   then extend to next disk??


waiting for your help..

Rgds
Sree

3 REPLIES 3
Pete Randall
Outstanding Contributor

Re: Need to create mirrored Lv

I've never created a mirror through lvcreate - only mirrored an existing lvol with lvextend:

 

lvextend -m 1 /dev/vgnn/lvolnn /dev/dsk/cntndn


Pete
Viktor Balogh
Honored Contributor

Re: Need to create mirrored Lv

Hi Sreer,

 

The best approach is to create an LV with a single extent, then add the mirror with "-m 1", and after that you can extend it to the requested size. Mirroring a single extent takes only some seconds, otherwise if you create the LV with full size the mirroring could take several hours.

 

Regards,

Viktor

****
Unix operates with beer.
Sreer
Valued Contributor
Solution

Re: Need to create mirrored Lv

Hi Pete Hi Victor,

Thanks for your help.

 

Finally I came to a work around.

Solution was :  lvcreate -m 1   ====> this option worked !

 

[hpa50-11]/ >lvcreate -m 1 -n lvdata  -L 100M /dev/vg00
Logical volume "/dev/vg00/lvdata" has been successfully created with
character device "/dev/vg00/rlvdata".
Logical volume "/dev/vg00/lvdata" has been successfully extended.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
[hpa50-11]/ >lvdisplay /dev/vg00/lvdata
--- Logical volumes ---
LV Name                     /dev/vg00/lvdata
VG Name                     /dev/vg00
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               1
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            100
Current LE                  25
Allocated PE                50
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default

[hpa50-11]/ >lvdisplay -v /dev/vg00/lvdata | more
--- Logical volumes ---
LV Name                     /dev/vg00/lvdata
VG Name                     /dev/vg00
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               1
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            100
Current LE                  25
Allocated PE                50
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  strict
IO Timeout (Seconds)        default

   --- Distribution of logical volume ---
   PV Name            LE on PV  PE on PV
   /dev/dsk/c1t15d0   25        25
   /dev/dsk/c3t15d0   25        25

   --- Logical extents ---
   LE    PV1                PE1   Status 1 PV2                PE2   Status 2
   00000 /dev/dsk/c1t15d0   01316 current  /dev/dsk/c3t15d0   00050 current
   00001 /dev/dsk/c1t15d0   01317 current  /dev/dsk/c3t15d0   00051 current
   00002 /dev/dsk/c1t15d0   01318 current  /dev/dsk/c3t15d0   00052 current
   00003 /dev/dsk/c1t15d0   01319 current  /dev/dsk/c3t15d0   00053 current


[hpa50-11]/ >newfs -F vxfs  /dev/vg00/rlvdata
    version 4 layout
    102400 sectors, 102400 blocks of size 1024, log size 1024 blocks
    unlimited inodes, largefiles not supported
    102400 data blocks, 101280 free data blocks
    4 allocation units of 32768 blocks, 32768 data blocks
    last allocation unit has 4096 data blocks

[hpa50-11]/ >mkdir lvdata

[hpa50-11]/ > mount /dev/vg00/lvdata /lvdata
[hpa50-11]/ >bdf /lvdata
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvdata    102400    1133   94945    1% /lvdata

[hpa50-11]/ >cd /lvdata
[hpa50-11]/lvdata >ls -l
total 0
drwxr-xr-x   2 root       root            96 Sep  1 09:52 lost+found
[hpa50-11]/lvdata >


 

I continued till saving some files in the fs  created using the new LV :-)

 

The topic is closed

 

Rgds

Sree