[TriLUG] Resizing partition with ext3 file system

Rick DeNatale rick.denatale at gmail.com
Mon Jan 24 09:20:32 EST 2005


Sigh!!!!

Well I tried this yesterday and it turned out to be a bit of a disaster.

First disk indicated that I needed to reboot for the kernel to see the
new partition table, so I did.
Then resize2fs told me that I needed to run fsck first, so I did and
then ran resize, and then fsck again.  I then ran tune2fs -j which
told me that the file system already had a journal which I didn't find
surprising.
I then remounted, and found that there were no files in the
filesystem, but when I tried to do a touch to create a test file, it
complained that the file system was full.  Gulp.
I figured I might as well try a reboot, and was told that I needed to
repair the file system, so I did fsck during the boot sequence. Lots
of errors. EVERYTHING ended up in lost+found.

I ended up reformatting the partition.  Then for some reason, the
filesystem seemed to be mounted ro even though mount indicated that it
was rw. Another reboot fixed this problem.

So I ended up losing all the backups I've taken over the past month or
so, but I seem to be back up and running.  I'm still not sure what
went wrong.  Perhaps all those hardlinks in the rsync backups got
resize2fs confused?



On Sun, 23 Jan 2005 11:40:21 -0500, Rick DeNatale
<rick.denatale at gmail.com> wrote:
> On Sun, 23 Jan 2005 11:14:58 -0500, Jason Tower <jason at cerient.net> wrote:
> > i just resized a ext3 filesystem yesterday (grew a LVM logical volume)
> > using resize2fs.  you'll have to umount it first and run fsck -f.  no
> > converting from ext3 to 2 or vice versa should be necessary.
> >
> > jason
> 
> Thanks Jason. So just to make sure that my feeble little mind is
> getting this, here are the steps I think I need to take:
> 
> 1. take proper steps to temporarily stop further backups, just in case
> I can't get all this done before the next backup is scheduled (every 4
> hours).
> 2. unmount the snapshot device (both the r/w mounting to
> /root/snapshot for root only access, and the r/o nfs mount to
> /snapshot for others).
> 3. run fdisk and delete the partition and recreate it at the same
> first cylinder but larger.  I understand that this WILL leave the
> existing data in place.
> 4. execute (sudo?) resize2fs /dev/hdc2
> 5. execute (sudo?) fsck -f  /dev/hdc2
> 6. remount /root/snapshot and /snapshot
> 7. let loose the backup cron job.
> 8. bob's yer uncle
> 
> 'ave I got it perfesser 'iggins?
>



More information about the TriLUG mailing list