[CentOS] resize lvm

Fri May 6 18:42:51 UTC 2016
James A. Peltier <jpeltier at sfu.ca>


----- Original Message -----
| On Fri, May 06, 2016 at 06:19:35PM +0000, Wes James wrote:
| > I have a laptop that I put centos 7 on and I started out with a 30gig
| > partition.  I resized the other part of the disk to allow more space for
| > centos.  I then created an unformated partition in the available space,
| >   ran
| > 
| > 
| > pvcreate /dev/sda4
| > 
| > 
| > 
| > vgextend lvname /dev/sda4
| > 
| > 
| > 
| > lvextend -L 184.46G /dev/lvname/root
| 
| 
| I find it easiest to do lvextend -l 100%VG /dev/lvname/rootI find it
| easiest to do lvextend -l 100%VG /dev/lvname/root.
| (Then, if practical, and since it's a laptop, I'm guessing it's not a
| production machine), reboot from a livecd or whatever and doing e2fsk -f
| /dev/lvmname/root
| 
| I don't know if it will solve your issue, but may be worth trying.
| 
| > 
| > 
| > but when I run:
| > 
| > 
| > 
| > sudo resize2fs /dev/lvname/root
| > 
| > 
| > I get:
| > 
| > 
| > 
| > resize2fs: Bad magic number in super-block while trying to open
| > /dev/lvname/root
| > Couldn't find valid filesystem superblock.
| > 
| 
| --
| Scott Robbins
| PGP keyID EB3467D6
| ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 )
| gpg --keyserver pgp.mit.edu --recv-keys EB3467D6

if you use pass the '-r' option to lvextend it will resize the volume for you based on the filesystem that is on the volume.  no need to grow it manually afterward.


-- 
James A. Peltier
IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 604-365-6432
Fax     : 778-782-3045
E-Mail  : jpeltier at sfu.ca
Website : http://www.sfu.ca/itservices
Twitter : @sfu_rcg
Powering Engagement Through Technology