Shrinking & Expanding Linux Filesystems

Gilbo

Storage is cool
Joined
Aug 19, 2004
Messages
742
Location
Ottawa, ON
I've been doing some research on shrinking & expanding filesystems, because I'm going to have to do this in the near future when I swap out disks in a JBOD storage situation (JBOD done using LVM2).

This article is the most succint and up-to-date description of the process I've found in my wanderings.

I'd like to hear any recommendations or thoughts you guys would have on this operation. I'd also like to know if any of you have experience with alternate OSes and filesystems that make these sorts of operations easier (maybe ZFS for example - would my life be easier if I was using ZFS? Windows Dynamic Disks?).

1. It seems I can only shrink ext2, and ext3. You can grow XFS. Luckily they're ext3 partitions!

2. Doesn't seem to bad overall. What I think I have to do: shrink the FS, remove the Physical Volume from the Logical Volume, replace the disk, make the new disk a physical volume, add the new physical volume to the logical volume, expand the filesystem into the new space.

Anything wrong with the above? Do I have to un-LVM the physical volume some how so the computer doesn't freak out when I remove the disk? How do I do that.

Any pitfalls I should be aware of? Thanks.
 

ddrueding

Fixture
Joined
Feb 4, 2002
Messages
19,728
Location
Horsens, Denmark
If you are replacing all the drives in the array with larger ones, wouldn't it be easier to add all the new drives and then remove all the old ones?
 

Gilbo

Storage is cool
Joined
Aug 19, 2004
Messages
742
Location
Ottawa, ON
If you are replacing all the drives in the array with larger ones, wouldn't it be easier to add all the new drives and then remove all the old ones?
Sorry, I should have mentioned that. I'm replacing one drive. Eventually I'll replace them all, but I only do it when I need more capacity. So far I've just added disks, but there's no more motherboard headers...
 

Bozo

Storage? I am Storage!
Joined
Feb 12, 2002
Messages
4,396
Location
Twilight Zone
Why can'y make an image of the files, rebuild the array, then put the image on?

Bozo
 

blakerwry

Storage? I am Storage!
Joined
Oct 12, 2002
Messages
4,203
Location
Kansas City, USA
Website
justblake.com
Gilbo, I would check out the gparted live cd. I've used it before to copy partitions from one disk to another as well as shrink and grow partitions and file systems.

As for file system types, ext3 probably has the most support since it's the most commonly used.
 
Top