[sclug] Moving root filesystem from one drive to another

John Barron mail at europa.demon.co.uk
Wed Aug 2 21:12:02 UTC 2006

On Wednesday 02 August 2006 13:41, James Wyper wrote:
> Hello everyone,
> My Linux server has two disks (and no room for any more).  hda is an
> old 3.2GB drive, hdb is a more recent 80GB one.  The PC has Mandriva
> Linux 10.1 installed, with / on hda, and /usr, /home, and swap on
> separate partitions on hdb.
> I want to put a bigger disk in the machine to replace the 3.2GB one,
> and at the same time switch to a clean kubuntu install.  But because
> this machine holds the family email and acts as firewall and router for
> the whole house, I want to ensure that this change minimises disruption
> / downtime and allows me to quickly revert to Mandriva should I need
> to.
> Here's what I plan to do - could you let me know if I've missed
> anything or if you can suggest shortcuts:
> 1.  Backup /home and /usr, just in case.

Step 1 sounds sensible, the rest all seems way too complicated to my mind.

Just put in your new hard drive as the primary master (hda), and partition it 
as follows:
1. Swap (e.g. twice memory size)
2. Partition for '/' root, ext3 or whatever you prefer, say 10GB?
3. Partition for '/usr/', ext3 or whatever, same size as before?
or whatever makes sense?
4. Partition for '/home/' ext3 or whatever, the rest

Do the partitioning first, whether from Knoppix or the Kubuntu LiveCD should 
be able to do the trick. 

Make sure you have your ethernet and router/internet connection working with 
the LiveCD before you begin. It's not crucial, but Kubuntu will look for it 
while installing so it's helpful if you've got it. (if you're not using a 
router yet, back up a step and go and do that first - it's basically a really 
good idea whatever setup you're using).

Restore (or transfer from the original drive) the /usr/ and /home/ partitions 
(you can do this with a LiveCD, if need be).

Install Kubuntu. Choose manual partitioning, select the Swap (1.) and root '/' 
(2.) for format, choose '/usr/' and '/home/' to live on (3.) and (4.) 
respectively, and do not format those! Install Kubuntu - when I did something 
similar on Monday, I actually created a brand new 'admin' user for sudo when 
I did so, to avoid clashing with any existing users already in my '/home/' 

After installing, recreate your users, and use Konqueror to assign ownership 
of their entire sub-folder to their new user (uid). Maybe there's a neater 
way to do this, but it worked for me.

Very similar to what I recently did, updating from Mepis to Kubuntu, while 
preserving my '/home/' directory, except I also wiped /usr/ which I didn't 
have on a separate partition - see my blog:

If you need to revert to your original Mandriva, then plug your original hda 
and hdb back in as they were, since you don't need to mess with those at all 
anyway. And BACK THEM UP before unplugging in the first place!

Hope that helps

More information about the Sclug mailing list