I would like to install Ubuntu 14.04.02 LTS on my machine which currently has Mageia 4.1.

So, I have the following partitions: One for /, one for swap and one for /home.

I have some important data on /home which I wouldn't like to lose (I have backed them up, but I would prefer to keep them) after a clean install. I plan to reformat partitions one and two as above and keep the /home one.

Will I be able to tell Ubuntu to do so during an installation? By this I mean: Will it be able to recognize the /home partition and keep all its data intact while formatting the rest? And one more question: Will it be able to keep the users as they are our will I be forced to change them too? (I have the bad feeling that it won't be able to keep the users as they are...)


Keep the /home partition

Yes! You can keep the existing home partition using one of the advanced installation options called Something Else

enter image description here

After choosing this option, you will be able to tell the installation process to use the existing / and /home partitions.

  • Make sure to choose to format / partition as ext4 and
  • Not format (remove the check mark) the /home partition.

Keeping the users

Before you start the install process

From inside the Mageia installation, run the follwoing command:

cat /etc/passwd

This will give you the list of current usernames and user-numbers. Write the names and numbers down, as you will need them later when you recreate the users in Ubuntu. Thanks Arronical for the comment.

During installation

During Ubuntu you will be prompted to create the first user. This user will have sudo privileges. This user is internally identified as user number 1000. Assuming that Mageia uses the same convention, you should use the same username you had before. Ubuntu will setup to use your existing /home/username.

After installation

For all other users, you will have to wait till after the installation. See Why can't I click the button to add a new user? for details. If you create them in the same order as you did in Mageia, they will get user numbers in the same order as 1001, 1002, etc. Again, use the same usernames, and their existing home folders will be assigned to them. (You will be prompted to choose the existing folders or create new ones.)

Cleaning up

Note: your home folder /home/$USER contains your data as well as configuration files (your preferences) for the applications you use. These are kept in hidden folders with names starting with a dot (.). Since configurations in Mageia may not always match that in Ubuntu, you may get some errors when running an application for the first time. If this happens, you may need to delete the corresponding folder (or file) with dot in the the beginning. Alternately, you may want to delete all the hidden folders and files inside your home folder to get a fresh start in terms of application configuration.

Also see Changing to another distro: can the -home partition be kept?

Hope this helps

  • 1
    @Arronical Good point! I didn't need to do this, as I have only a handful of users, and I always add them in the same order. I will add this to the answer. – user68186 Jun 1 '15 at 16:04
  • 6
    I'd add this important point: BACK UP YOUR DATA BEFORE STARTING!!! Although user68186's procedure should work without problems, an easy-to-make mistake could easily wipe out all your user data. Also, if you've got just a few users, my advice would be to create new users. Give them different usernames initially. You can change the usernames after installation so that they have the same usernames you like but use different home directories. That will avoid problems with application configuration files. You can then move your user data files and eventually delete the old home directories. – Rod Smith Jun 1 '15 at 20:50
  • Thanks very much for the great guide!!! I have spread backed up my data but I am not sure whether my mail will integrate with Thunderbird automatically. I hope it does. Anyway I will try this today. – Jason Jun 2 '15 at 5:52
  • 1
    +1 to author and +1 to @RodSmith comment in my case when I was reinstalling once I also formated / though I had a seperate /home partition so as Rod Smith explained even after creating new user I just moved data from an old /home to the new one and deleted the old one. – JoKeR Jun 8 '15 at 19:38
  • 1
    @AlexisWilke Good idea. Sometimes it is easier to pull up the old config from the old /etc folder than start from scratch. – user68186 Jan 14 '20 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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