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

Kyle Brieden kyle at txmoose.com
Mon May 8 10:44:18 EDT 2017


Hey Elliot,

I've been doing it this way for years.  I know for srure that it is safe 
to extend an ext# FS online.  I believe XFS is safe to extend online, as 
well.  The lvextend -r flag just calls "resize2fs" (or tune2fs?  I 
honestly can't recall which it is off hand right now...) for you.  For 
what it's worth, I've extended filesystems while they were being written 
to this way to avoid having a filesystem fill up in the middle of a 
long-running process and breaking the process.

Sizing a filesystem down, on the other hand, should never be done 
online.  But extending a filesystem online is typically safe.

I also recently discovered the hard way that either XFS or ZFS (I can't 
recall which, as I use both but very, VERY little) can be extended, but 
not shrunk.  As it, the spec for the FS was actively written to not 
allow shrinking.  Struck me as odd, but I guess there's a logical reason 
there.

---
Very respectfully,
Kyle Brieden

On 08-05-2017 10:31, Elliot Holden wrote:
> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0x89C9D831.asc
Type: application/pgp-keys
Size: 3071 bytes
Desc: not available
URL: <http://mail.ale.org/pipermail/ale/attachments/20170508/1a34d47e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.ale.org/pipermail/ale/attachments/20170508/1a34d47e/attachment.sig>


More information about the Ale mailing list