Moving & Extending Linux partitions.

Alex Buell (alex.buell@tahallah.demon.co.uk)
Thu, 8 Apr 1999 22:36:20 +0100 (GMT)


I have been thinking about this problem for a while tonight, the crux of
the problem is that I now have a 400MB partition that is going to be nuked
pretty soon (thank you, VMware 8). The thing is, I would like to add this
extra free space to my /home partition. Normally, I'd just tar (using bru
for integrity reasons) the /home partition's contents to my /archive
partition on my 2nd hard disk, nuke the /home partition along with the
newly freed up partition and then create a new /home partition.
Unfortunately, perhaps because I didn't think about it enough in the first
place, it's not that easy.

My mass storage system is made up of the following

/dev/hda (6.4GB hard disk)
contains
/dev/hda1 1 13 104391 16 Unknown
/dev/hda2 14 64 409657+ 16 Unknown
/dev/hda3 * 65 319 2048287+ 83 Linux native
/dev/hda4 320 826 4072477+ 5 Extended
/dev/hda5 320 811 3951958+ 83 Linux native
/dev/hda6 812 826 120456 82 Linux swap

As you can see, it's a problem[1] =) It is now apparent to me that the
answer to the problem is an utility that can be booted off a floppy (maybe
contains a Linux kernel & an init that loads the utility). This utility
could then allow the user to do:

1) Moving partitions
2) Resizing partitions

With such a utility, it would then be immediately obvious to me that all I
have to do is a) move the /dev/hda3 partition into the space left by
nuking /dev/hda2. (It goes without saying that LILO would need to be rerun
to note the new positions) b) move the entire extended partition into the
space left by the moved /dev/hda3 partition. c) resize the extended
partition so it takes up all the free space towards the end of the media
d) Move the /dev/hda6 swap partition *back* to the end. e) Finally, resize
the /dev/hda5 partition so it takes up all the free space.

And that's it. Has anyone got plans to implement such a utility in the
near future?

[1] I know I could just back it all up onto tape and restore but my tape
drive is broken 8(

Cheers,
Alex

-- 
"Bullshit. It's a cesspool, and has been for a long time. RMS chucked
another turd in our midst and his sheep drop their daks and follow suit."
- Richard Gooch.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/