lvm note for my reference

Still playing with iSCSI, so needed to enlarge the logical volume now I am actually using it.

This post is just for my reference as for years I have been running resize2fs manually after resizing an LV, but I noticed in the man page the -r option will do it automatically now. So posted for my reference to try to override my habit of doing all the steps individually.

[root@falcon ~]# lvextend --size +10G -r /dev/VolGroup00/iSCSI01
fsck from util-linux 2.19.1
/dev/mapper/VolGroup00-iSCSI01: 17/983040 files (0.0% non-contiguous), 104105/3932160 blocks
  Extending logical volume iSCSI01 to 25.00 GiB
  Logical volume iSCSI01 successfully resized
resize2fs 1.41.14 (22-Dec-2010)
Resizing the filesystem on /dev/mapper/VolGroup00-iSCSI01 to 6553600 (4k) blocks.
The filesystem on /dev/mapper/VolGroup00-iSCSI01 is now 6553600 blocks long.

Much easier than having to run resize2fs manually. Of course it always helps to know how to do it manually as some of the stuff I muck about with requires a lot of fiddling to fix once I break it :-).

I guess it may also manage shrinking an LV automatically as well; but as I generally only shrink a LV if I’m about to do something nasty with the PV(s) it’s hosted on I’ll keep doing that manually.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in Unix. Bookmark the permalink.