[ale] Extend file system with -r while using lvextend command

Lightner, Jeffrey JLightner at dsservices.com
Mon May 8 10:39:19 EDT 2017


Extending filesystems while mounted is generally safe because you're not losing blocks to which data may already have been stored.

Shrinking filesystems while mounted is a bad idea.   For ext? filesystems usually you should run fsck before doing such shrinking.   Some filesystem types don't even allow for shrinking.



-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Elliot Holden
Sent: Monday, May 08, 2017 10:31 AM
To: ale at ale.org
Subject: [ale] Extend file system with -r while using lvextend command

I found out you can extend the filesystem while extending the lvm simultaneously. So it does not have to be in 2 separate commands. Using the -r option or --resizefs with lvextend will do the trick. This way you don't have to unmount the filesystem, extend the filesystem (with
xfs_growfs) and then remount the filesystem. Here is the syntax.

[elliot at newton ~]$ sudo lvextend -l +100%FREE -r /dev/rhel/home


Does any see an issue with doing this type of modification while the filesystem is still mounted? Does anyone know if the filesystem gets unmounted and remounted during this command while using -r ? Just in case some other process is writing to the filesystem at the same time. 
It's been brought to my attention by a member of my Perl group that you could potentially lose data this way. So I wanted to find out if there are any protections going on in the background while executing this command.


Thanks


E.

--
Elliot Holden
706-231-9776
elliot at elliotmywebguy.com
http://www.elliotmywebguy.com

_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo



More information about the Ale mailing list