[TriLUG] help resizing an ext2 filesystem

Dave Hamby dlhamby at earthlink.net
Tue Oct 2 09:35:39 EDT 2001


"Are you satisfied with your backup?"

Sorry for the VMS Install quote but always good words of wisdom 
for an evolution like this. If you have an SCSI tape drive, 
I recommend that you archive all partitions using your 
favorite, tar, dump, or whatever. If, heaven forbid, you do 
screw the pooch, you have what you need to clean up the mess.

If you have a CD burner, give mkcdrec a try. This builds a 
bootable CD and tar archives of each file system. When booted, 
you run a script called recover that lets you rebuild a grokked 
disk. You can also restore a disk to a new volume.

Since the disk archives are regular tar -czf archives, you can 
restore them manually to your new partitions.

mkcdrec is cataloged on freshmeat. I've been using it for a few 
months and like it. The catch is that you need the disk space 
free to build the isos of the CDs but it does work. I put it 
on at bed time and burn the CDs the next morning. 

It does have one bug. It saves VFAT file systems as a zip 
archive of the partition. To make things go fast, it tries to 
write a zero filled file to the disk. If there is more than 2 
GB of file system space on the disk, mkcdrec will hang writing 
the file. The end of file/end of medium indication is not 
returned correctly or not checked by cat.

On Monday 01 October 2001 17:14, you wrote:
> hey guys, I'm trying to resize an ext2 filesystem and i need
> some help first. I'm trying to draw out the plan on paper
> before i actually do any changes since i don't have a backup
> device handy.
>
> 1. fdisk reports that:
>
> hda1 - 65992 blocks
> hda5 - 1048792 blocks
> hda6 - 13553536 blocks
>
> but df -k reports:
>
> hda1 - 63893 blocks
> hda5 - 1032056 blocks
> hda6 - 13038830 blocks
>
> why the disagreement in the size of the filesystems? i'm
> confused.
>
> 2. my plan is to resize hda6 down so that i can create a
> nicely sized hda7 and move the data from hda6 that i want to
> retain onto hda7. then i would like to nuke the rest of the
> drive and construct something like this:
>
> hda1 - 4G - win32
> hda2 - 64M - /boot
> hda3 - 512M - swap
> hda4 - extended
> hda5 - 4G - /usr
> hda6 - 4G - /home (previously created hda7)
>
> is this a sane approach?
>
> 3. in doing this, i will need to destroy my current hda2
> extended partition and create a new hda4 extended partition
> with a different start cylinder. is this going to cause
> problems for the hda7 partition that will have lived under
> hda2, so long as i remember the start and end cylinders and
> don't reformat that partition?
>
> - donald
>
> _______________________________________________
> TriLUG mailing list
> http://www.trilug.org/mailman/listinfo/trilug

-- 
Dave Hamby, Lance, and Dinky
Lance, just a country greyhound
Dinky <- Fox Lee Sarina <- Unruly Rocket <- Unruly



More information about the TriLUG mailing list