On Wed, Jul 31, 2002 at 06:58:48AM -0700, Craig Dickson wrote:
> Okay, so my new 80 GB HD is installed and seems happy. Now I'd like to
> make some changes to my original 20 GB hard disk. Originally, I left
> /home and /usr in the root partition, and I'd like to split them out.
> What's the easiest way to split an existing root partition into three
> without ruining everything?
Rule #1: Make backups. At least at file-level. If possible also at
disk-block level.
Rule #2: Verify the backups
Rule #3: Always obey rule 1 and 2.
> The plan I have at the moment is like this:
>
> 1. Boot from rescue diskette.
> 2. Mount first HD's root partition and a partition of equal or greater
> size on the second HD.
> 3. Copy all files from root partition to second HD.
Beware of symbolic links...
> 4. Unmount root partition.
> 5. Run cfdisk, destroy root partition, recreate new one along with
> separate partitions for /home and /usr in the space of the original
> root partition.
> 6. Create new filesystems in new partitions (mke2fs -j).
> 7. Mount new filesystems, copy files back from second HD.
> 8. Edit /etc/fstab to match the new reality.
> 9. Run lilo (/boot is a separate partition already, which won't change,
> but this seems like a good idea and harmless at worst).
> 10. Reboot!
>
> Does this sound good? Is there an easier way to split an existing root
> partition? I have gparted, but have never used it, and I'm guessing that
> in this situation it won't be useful (except perhaps as a substitute for
> cfdisk in step 5) because of the need to move existing files from the
> current root partition into the new ones.
[Note: I never tried gparted]
You may want to look into ext2resize, it claims to be able to resize a
filesystem (but you still have to resize the underlying partition
afterwards).
> Any comments?
Dont forget to obey rule #3.
Another way to do this could be to
- make a backup of /etc and /var
- save the output from "dpkg --get-selections"
- do a complete reinstall on the new root partition
- restore /etc (I'm not sure about /var...)
- make sure you install the same packages as you had before:
dpkg --set-selections < yourfile && apt-get dselect-upgrade
The above list is probably not complete, but I'm sure you get the idea.
Bottom line: Use whatever method you are comfortable with.
HTH
--
Karl E. Jørgensen
karl@jorgensen.com
www.karl.jorgensen.com
... An rfc2324 advocate
http://www.rfc.net/rfc2324.html
Attachment:
pgpTf1aeg7LHo.pgp
Description: PGP signature