msgbartop
Tips and Tricks site for advanced HP-UX Engineers
msgbarbottom

29 Oct 14 Puzzle of the day. Strict logical volume prevents you from extending a filesystem

Thanks to Veerappan Dhandapani of HCL Technologies for bringing me this problem

You have 50 GB free in the volume group.

You try to extend the logical volume and you cant.

Basics:

1) bdf is the tool for measuring filesystem size not logical volume size

2)lvdisplay is the tool for measuring logical volume size.

Steps:

1) Extend the logical volume. That is why the previous two number points are important. In process after extending the logical volume size the lv size and file system size are not equal

2) Extend the file system.

root@mybox# vgdisplay -v vgdata | grep -i “Free PE”
Free PE 1784
Free PE 511
Free PE 0
Free PE 0
Free PE 0
Free PE 0
Free PE 1273
Free PE 0

root@mybox# lvdisplay /dev/vgdata/lv_prod_datastaging
— Logical volumes —
LV Name /dev/vgdata/lv_prod_datastaging
VG Name /dev/vgdata
LV Permission read/write
LV Status available/syncd
Mirror copies 0
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 245760
Current LE 7680
Allocated PE 7680
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation PVG-strict
IO Timeout (Seconds) default

root@mybox# lvextend -L 278528 /dev/vgdata/lv_prod_datastaging
lvextend: Not enough free physical extents available.

The problem here is the allocation policy.

lvchange -C n -s n /dev/vgdata/lv_prod_datastaging

See the man page for details. -C is for contiguous -s is for strict allocation.

We changed both to n(o).

Off camera we extended the logcal volume

lvdisplay /dev/vgdata/lv_prod_datastaging

— Logical volumes —
LV Name                     /dev/vgdata/lv_prod_datastaging
VG Name                     /dev/vgdata
LV Permission               read/write
LV Status                   available/syncd
Mirror copies               0
Consistency Recovery        MWC
Schedule                    parallel
LV Size (Mbytes)            302848
Current LE                  9464
Allocated PE                9464
Stripes                     0
Stripe Size (Kbytes)        0
Bad block                   on
Allocation                  non-strict
IO Timeout (Seconds)        default

We get the size from the logical volume size to feed into the Online JFS extend command so we do not have to do math.

fsadm -F vxfs -b 302848m /prod/datastaging

bdfmegs is Bill Hassell’s new and improved bdf

/var/adm/bin/bdfmegs /prod/datastaging
File-System                      Mbytes    Used   Avail %Used Mounted on
/dev/vgdata/lv_prod_datastaging   310.1g  215.7g   94.0g  70% /prod/datastaging

 

 

Tags: , , , , , , ,

Leave a Comment

You must be logged in to post a comment.

sidebarbottom
sidebartop
sidebarbottom
WhatsApp chat