[CentOS] LVM

Mon Mar 19 09:14:05 UTC 2012
Peter Kjellström <cap at nsc.liu.se>

On Sunday 18 March 2012 19.40.21 Ray Van Dolson wrote:
> On Sun, Mar 18, 2012 at 08:04:14PM +0100, Markus Falb wrote:
...
> > What filesystem? Assuming ext3, this cannot shrunk without unmounting.
> > I believe the following *should* work for ext3
> > 
> > $ umount /home
> > $ e2fsck -f /dev/vg_web/lv_home
> > $ resize2fs /dev/vg_web/lv_home 150g
> > $ lvresize -L 150g /dev/vg_web/lv_home
> > $ mount /home
> > 
> > I am not sure how safe it is. Take care!
> 
> I was under the impression that you needed to unmount the file system
> to shrink it with resize2fs (you can grow it online however).

Which I guess is why Markus wrote "umount /home" above...

I'd like to add that it's probably good paranoia not to size the lv down too 
tightly (should it happen to become smaller than the fs then ooops). That is, 
I'd size the lv down to a comfortable margin above the fs size (and then size 
the fs up to the device size).

I can also add that I've successfully managed to shrink ext3 before but a 
verified backup is probably good advice..

/Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.centos.org/pipermail/centos/attachments/20120319/58796f11/attachment-0005.sig>