23

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...)

1 Answer 1

31

Keep the /home partition

Steps updated for Ubuntu 22.04

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.

Select the existing Ubuntu system partition /.

enter image description here

Click the Change... button below and make sure:

  • The Use as: is Ext4 journaling file system
  • The format partition box is checked
  • The Mount point: is /

Once everything as set, click OK, you will see a warning popup message like:

enter image description here

Click Continue.

Select the existing Ubuntu HOME partition /home.

Note the partition will not be marked as Home. Click the Change... button below and make sure:

  • The Use as: is Ext4 journaling file system
  • The format partition box is NOT checked
  • The Mount point: is /home

enter image description here

Once everything as set, click OK, you will see a warning popup message like before.

The final Install Type window will look something like this:

enter image description here

Note:

  • The system partition must have the mount point / and format box is checked.
  • The Home partition must have the mount point /home and format box is NOT checked.

Warning: If the format box for the home partition is checked, you will lose all your personal files.

Once you are satisfied, click Install Now and continue as usual.

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

10
  • 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, 2015 at 16:04
  • 7
    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, 2015 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, 2015 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, 2015 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, 2020 at 22:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .