How to resize ext3 partitions?

Robert Locke lists at ralii.com
Fri May 12 01:28:57 UTC 2006


On Thu, 2006-05-11 at 13:14 -0300, Marcelo Magno T Sales wrote:
> Em Quinta 11 Maio 2006 12:48, Ambrogio escreveu:
> > Il giorno gio, 11/05/2006 alle 08.34 -0300, Marcelo Magno T Sales ha
> >
> > scritto:
> > > Hi,
> > >
> > > What software can I use in FC5 to resize an ext3 partition? I've tried
> > > qtparted and gparted, but in both of them the "resize partition" option
> > > is disabled. Why?
> >
> > Ext3 is a filesystem and not a partition.
> 
> ext3 partition = partition formated with ext3 file system.
> 
> > So to resize a partition you can use all tools related to it (for
> > examples fdisk)
> 
> fdisk does not resize partitions, unless you delete it and recreate it, but 
> then you loose all data. The softwares I mentioned resize partition 
> on-the-fly. However, for some reason, the resize option is disabled in both.

You are, in fact, answering your own question here.  There are two
aspects to resizing.  One is to resize the underlying partition and the
other is to resize the "formatting" of that space known as a filesystem.

Now, to be more specific as to why parted and it's derivatives are
"broken"....  ext3 has not been standing still and there are new
features to the filesystem that have been turned on by default in recent
renditions of Red Hat distributions, like dir_index and sparse_super.
parted historically had the ability to resize both the underlying
partition and the overlying filesystem in one "perceived" step.
Unfortunately, they did so by writing their own interface to the ext2/3
filesystem.  They have apparently not been updated to understand the new
features and so cannot now resize ext2/3 filesystems.

> 
> > To resize the filesystem you have to use other command.
> > ext2resize I don't remember but I think works online.
> 
> I'll give it a try.
> 

Theoretically, you could fdisk to delete the old partition and then
create a new partition that starts where the old one did and continues
to "further" cylinders.  Then you could use either "resize2fs" or
"ext2online" to resize the filesystem to match.  This, of course, only
works if you are growing, not shrinking.  Shrinking needs to be done in
reverse.  First, run resize2fs to shrink the filesystem then use fdisk
to delete/recreate the partition as long as it starts at the original
location.  Of course, this is all questionable behavior these days.
There is also the problem of the natural contiguous nature of
filesystems and the need to move partitions when doing all this.  The
real recommendation would be backup and recreate the filesystems
inserting LVM into the middle to virtualize the diskspace and provide
the convenience of resizability....

Good luck,

--Rob





More information about the fedora-list mailing list