ReiserFS + LVM

Story: Expanding A Root-FSTotal Replies: 8
Author Content
amadensor

Nov 30, 2009
4:37 PM EDT
If using ReiserFS on LVM, you can expand the file system hot, without unmounting. Just expand the LV with lvresize, then run resize_reiserfs, and it is done, no unmounting needed. This is the reason I have not moved to EXT3 or 4. I can expand file systems without unmounting. I only need to take the system down to add drives, and that is just a simple reboot.
Sander_Marechal

Nov 30, 2009
5:19 PM EDT
Eh? You can grow ext2, ext3 and ext4 online since kernel 2.6.7. IIRC you just can't shrink them online.
amadensor

Nov 30, 2009
7:07 PM EDT
I have tried. It always complains that you cannot modify a mounted file system. I am on 2.6.30. Go try it, and let me know. Maybe there is a newer version of the EXT FS Tools. or something. I am on Debian Squeeze.
Sander_Marechal

Nov 30, 2009
7:39 PM EDT
@amadensor: I don't have any filesystems I can resize at the moment. But the resize2fs manpage on Squeeze says this:

Quoting:If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 only.).


So, it's only ext3 and not ext2/4 as I said in my previous post. It should work (it will generate a warning saying the filesystem is mounted and that online resizing is required. It should work. If it does not, it's a bug in Squeeze.
jezuch

Dec 01, 2009
3:06 AM EDT
On the other hand XFS support online resize *only* :)
gus3

Dec 01, 2009
3:47 AM EDT
XFS prefers to use a copy-and-examine mechanism that works in online filesystems only.
Sander_Marechal

Dec 01, 2009
4:34 AM EDT
jezuch: "Online grow" would be more correct. XFS cannot be shrunk.
hkwint

Dec 01, 2009
5:19 PM EDT
Just tested this on

2.6.28-gentoo-r5 #5 SMP GNU/Linux

on a 100M ext3-filesystem and it seems to work:

#mount -l /dev/mapper/vg0-testlv on /mnt/tmp type ext3 (rw)

#lvextend /dev/vg0/testlv -L+10M

#resize2fs /dev/vg0/testlv

resize2fs 1.41.9 (22-Aug-2009) Filesystem at /dev/vg0/testlv is mounted on /mnt/tmp; on-line resizing required old desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/vg0/testlv to 114688 (1k) blocks. The filesystem on /dev/vg0/testlv is now 114688 blocks long.
hkwint

Dec 01, 2009
5:27 PM EDT
Also works for ext4.

Posting in this forum is limited to members of the group: [ForumMods, SITEADMINS, MEMBERS.]

Becoming a member of LXer is easy and free. Join Us!