Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been considering migrating my laptop from Ubuntu to Debian. I didn't set up a separate home partition. Is it as easy as just installing Debian over Ubuntu?

share|improve this question

2 Answers 2

up vote 12 down vote accepted

First thing first, move that home directory to a new partition. It's really not that difficult to do (I made the same mistake, took ~30 min to do, most of it copying). I'll give you a simple step-by-step, but more detailed walkthroughs are available.

  1. Create a new ext3/ext4 (or other fs) partition on a drive (eg /dev/sda3) in gparted.
  2. Mount the new drive:
    • sudo mount /dev/sda3 /media/disk
  3. Copy the entire contents of your /home directory to the new drive. There is some debate whether to use rsync or cp for this, but cp worked fine for me (using the -a flag as nagul pointed out to maintain file permissions and ownership).
    • sudo cp -a /home /media/disk
  4. Edit your /etc/fstab file and create a new entry for /dev/sda3 and set its mount point as /home.
  5. Move your existing home directory (don't delete it yet in case something goes wrong).
    • sudo mv /home /home_old
  6. Now you can either unmount and remount /dev/sda3 to /home or just reboot the computer.

After you have /home on its own parition, changing your distro is incredibly simple. Just download a live cd and/or an installation disk for the distribution you want and install it on the same partition hosting your current distro (or on a seperate partition for multi-boot purposes).

Then, after you have the distro installed, just follow steps 4-6 again (if the options for a custom /home partition weren't available in the installer). Now you have all your old files, settings, etc but with a brand new shiny distro.

share|improve this answer
4  
You should investigate using cp -a if you want to retain permissions and ownership info. –  nagul Sep 11 '09 at 17:28
    
OR, move the /home directory to a different physical drive, which is what I do. –  djangofan Sep 11 '09 at 17:35

An over-the-top upgrade will not work.

Before you do anything else, backup your data (though that should go without saying).

Then you could:

  1. Make space for a new install by shrinking and moving partitions
  2. Install Debian in the newly freed space
  3. Once setup mount the old partition somewhere and make /home a synlink to /home on the old partition.
    (note: file/dir ownerships will be wrong, as users will not have the same UIDs nor groups the same GIDs, you'll need to adjust them or mess around to make the UID->user and GID->group relations the same on the new setup as the old)

or

  1. Wipe the system
  2. Install fresh
  3. Restore /home from backup
    (you may still need to mess with file/dir ownership)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.