Advertisements

Tag Archives: lvresize

LVM: Please specify number of stripes (-i) and stripesize (-I)

I tried to resize a logical volume but showed a message to specify stripes and stripesize

root@linux:~ # lvresize -L +200g -r /dev/vgER0data/lv_sapdata1
Please specify number of stripes (-i) and stripesize (-I)
Run `lvresize –help’ for more information.

Showing stripes and stripesize

root@linux:~ # lvdisplay /dev/vgER0data/lv_sapdata1 -m
— Logical volume —
LV Path /dev/vgER0data/lv_sapdata1
LV Name lv_sapdata1
VG Name vgER0data
LV UUID h2WKAp-h16f-O3Bo-QpEz-fTiW-s3Hr-K7W9sb
LV Write Access read/write
LV Creation host, time cavadb77, 2015-09-24 11:31:33 -0300
LV Status available
# open 1
LV Size 2.99 TiB
Current LE 783355
Segments 2
Allocation inherit
Read ahead sectors auto
– currently set to 32768
Block device 253:423

— Segments —
Logical extents 0 to 655359:
Type striped
Stripes 2
Stripe size 4.00 MiB
Stripe 0:
Physical volume /dev/mapper/ER0_data_disk_001p1
Physical extents 0 to 327679
Stripe 1:
Physical volume /dev/mapper/ER0_data_disk_002p1
Physical extents 0 to 327679

Logical extents 655360 to 783354:
Type linear
Physical volume /dev/mapper/ER0_data_disk_003
Physical extents 0 to 127994

To solve the problem in this case it was necessary to add a new LUN and resize the logical volume. The segment where it is linear, was kept this way. There is no way to convert

root@linux:~ # lvresize -L +100g -r -i2 -I4M /dev/mapper/vgER0data-lv_sapdata1
Size of logical volume vgER0data/lv_sapdata1 changed from 2.99 TiB (783355 extents) to 3.09 TiB (808955 extents).
Logical volume lv_sapdata1 successfully resized
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vgER0data-lv_sapdata1 is mounted on /oracle/ER0/sapdata1; on-line resizing required
old desc_blocks = 192, new_desc_blocks = 198
Performing an on-line resize of /dev/mapper/vgER0data-lv_sapdata1 to 828369920 (4k) blocks.
The filesystem on /dev/mapper/vgER0data-lv_sapdata1 is now 828369920 blocks long.

Advertisements

Resizing an ext3 filesystem mounted on a logical volume in a Linux

My home directory got full

root@linux:~ # df -h /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-homevol
101M 96M 94K 100% /home

Checking if the logical volume permits online resizing and if it was created with an older e2fsprogs version. Volumes created prior to SUSE Linux 10 SP2 are using an older e2fsprogs version and needs to be recreated

root@linux:~ # dumpe2fs -h /dev/mapper/rootvg-homevol | grep features
dumpe2fs 1.35 (28-Feb-2004)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file

We checked that the volume has the resize_inode property so to extend the filesystem, first we extend the logical volume

root@linux:~ # lvextend -L 200M /dev/rootvg/homevol
Extending logical volume homevol to 200.00 MB
Logical volume homevol successfully resized

You can see that the filesystem is not yet showing the new size

root@linux:~ # df -h /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-homevol
101M 96M 95K 100% /home

Now we increase the filesystem with resize2fs

root@linux:~ # resize2fs /dev/rootvg/homevol
resize2fs 1.41.9 (22-Aug-2009)
Filesystem at /dev/rootvg/homevol is mounted on /home; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/rootvg/homevol to 204800 (1k) blocks.
The filesystem on /dev/rootvg/homevol is now 204800 blocks long.

Checking the new size

root@linux:~ # df -h /home
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-homevol
194M 94M 90M 52% /home

If you receive a message saying that you can’t resize a mounted filesystem, use ext2online

root@suselinux10:~ # resize2fs /dev/localVG/sys.opt
resize2fs 1.38 (30-Jun-2005)
/dev/localVG/sys.opt is mounted; can’t resize a mounted filesystem!

root@suselinux10:~ # ext2online /dev/localVG/sys.opt
ext2online v1.1.18 – 2001/03/18 for EXT2FS 0.5b

You can also pass the flag -r to resize the filesystem without using resize2fs and use lvresize instead of lvextend

root@linux:~ # lvresize -L +2g -r /dev/vgHQ0ascs/lv_sapmnt_exe
Size of logical volume vgHQ0ascs/lv_sapmnt_exe changed from 5.00 GiB (1280 extents) to 7.00 GiB (1792 extents).
Logical volume lv_sapmnt_exe successfully resized
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vgHQ0ascs-lv_sapmnt_exe is mounted on /export/sapmnt/HQ0/exe; on-line resizing required
old desc_blocks = 20, new_desc_blocks = 28
Performing an on-line resize of /dev/mapper/vgHQ0ascs-lv_sapmnt_exe to 7340032 (1k) blocks.
The filesystem on /dev/mapper/vgHQ0ascs-lv_sapmnt_exe is now 7340032 blocks long.

%d bloggers like this: