Updated 10 hours ago

12768 products + 13431 members

The pain-free guide to switching Linux distros

How to effortlessly swap between distros without losing files

November 9th 2008 | Tell us what you think [ 2 comments ]

switch-linux-distros

Make sure you tell Yast, SUSE's labyrinthine system configuration tool, where you want to put home, and make sure you've selected 'Do not format'

<>

The most recent official count of Linux distros put the number at 'one hell of a lot'.This is good because it gives us plenty of choice, and choice provides freedom and freedom is good, right? Maybe it can feel as if there's a little too much choice at times, but there's no doubt that the huge variety of distributions makes Linux more interesting.

However, trying different distros isn't as easy as experimenting with a new web browser, word processor or even desktop environment.

Switching to a different distro means formatting at least part of your hard disk and starting again with configuration of your system. It could also wipe out all of your personal files, depending on how your disk is partitioned.

You can use a virtual machine like VirtualBox to try new distros, but when you find one you like, it's time to bite the bullet and install it for real. The process of switching distros is largely the same whatever system you want to install, but differences between the way various distros organise themselves mean that there are inevitable variations.

We'll use the transition from Ubuntu Hardy Heron to OpenSUSE 11.0 as an example, but the basic steps are the same with most combinations of distros.

The main drawback of a new installation is that it reformats your filesystems, destroying whatever files were on them. That's fine for the distro itself, but what about your personal files?

The most important asset when switching from one distribution to another is a separate partition for /home. Not only does it prevent your personal files and settings from being destroyed when you're installing a different distro, it also gives you somewhere to save useful information, such as backups of system configuration files.

Without a separate /home partition, you need to back up everything before you start, and you can forget any idea of running a realistic dual-boot system with two distros in use at once.

A /home of your own

While a separate /home partition is a good idea, either when switching or dual booting distros, you should use a different home directory (the /home/username directory) for each distro. This is because some of the settings files in your home directory can be specific to one particular distro, desktop environment or program version and trying to apply them to another can cause problems.

To solve this we use a new directory on the same home partition and copy over only the files we want to share. If you don't already run a separate /home, it's time to divide your programs and data.

Set up /home

As always, when you're messing around with disk partitions and file systems there's a small – but real – risk of losing data. The risk isn't from the software you use; the danger is that the process might be interrupted by a power failure or another piece of software crashing the computer. If in doubt, back up first. Working with in-use file systems should be avoided, too – a Live CD/DVD is best for this, and we'll use the Ubuntu disc.

There are three stages to the process: resize your root partition, create a new /home partition in the space made available and move your data over. It's a lot easier if you have plenty of free space – if your drive is nearly full, move some files to DVDs or an external disk. Then run GParted from System > Administration > Partition Editor.

 

Your comments (2) Click to add a new comment

flymo


September 6th

2. Nice one, Neil. Thanks.

@ pete_l Good point - although our experience with USB peripherals under Linux has been at least as good as Windows in the last year. Latterly we find that running (eg) XP in Virtualbox/KVM under Ubuntu is the better compromise for us.

We can then run the occasional stuff we want to in XP, without exposing all that fragile MS code to the nasties on the internet - so no need for a ton of aftermarket protection. Without the drag of that stuff, XP can benchmark slightly faster when virtualised under Linux than when running on bare metal with all the necessary protection loaded and running. Depends on the application, of course. Still no Direct-X, but I hear that it is coming.

Alert a moderator

pete_l


November 9th 2008

1. As the article says, use VirtualBox. It removes all the fuss with testing out a new distro. You simply allocate a file or 2 - 8GB on your existing system: which can be Windows or any major Linux (or one or two other O/S's, too) and some memory (.25-1GB) for the "guest" to use and off you go - no risk, no reformatting and since you can share files between host & guest, you can even keep your old /home on the host and access it on the guest without having to do anything to it.

Only things to look out for are video, which doesn't support accelerated thingy's and USB - which (like all Linux's) is not handled well. You also can't aceess any PCI peripherals through VB.

However, once you've found a guest O/S you like, just buy a new disk and load it up fresh, on that. Since you've already tested out the new distro, there's little risk of wasting your money and you never have enough disk space anyway.

Alert a moderator

Tell us what you think

You need to Log in or register to post comments

By submitting this form you agree to our Terms of Use and so are legally responsible for anything you submit. DO NOT submit anything which may violate the Terms of Use or another person's rights including copyrighted or offensive materials.