Recently I installed Ubuntu 12.10 x64 Server Edition on my PC. Unfortunately, I attempted to install a lightweight desktop but due to the fact that I have an old graphics card, the PC does not perform so well. I am thinking of re-installing an Ubuntu version but I do not want to lose the contents in my home folder. Is there any way to do that with a Live CD?
-
Do you have an extra partition for /home ? You should make a backup bevor you reinstall, this is the best way to save your data. – prophecy201 Mar 19 '13 at 10:50
4 Answers
Ever since Hardy (Ubuntu 8.04) you can reinstall Ubuntu without losing data in /home even without a separate /home partition.
See
https://help.ubuntu.com/community/HomeFolder
https://help.ubuntu.com/community/UbuntuReinstallation
Preserving home when reinstalling Ubuntu
Since Hardy, Ubuntu can be reinstalled while preserving home even without separate /home: see UbuntuReinstallation.
Few people know it, but since Hardy it's possible to reinstall Ubuntu without losing the content of the /home folder (which contains program settings, internet bookmarks, emails... and all the documents, music, videos that you have put in it). Even if /home is not on a separate partition
Of course, you should always have a backup of your data.
-
1why is it that in the 8 (yes 8) times I have reinstalled in the last two years it has never preserved the existing home content even when I specifically want to keep it and I've had to restore from another backup and deal with all the trouble with the permissions and stuff – sbergeron Jul 29 '14 at 21:53
-
3
-
2I haven't, but every single time it has erased my home folder. Is there a way I can rename it beforehand, install, then delete then new one and replace it with the old one I renamed? – sbergeron Jul 29 '14 at 23:51
-
1The title of the article says "UbuntuReinstallation", but the screenshot shows a major version Upgrade. Reduces my faith in whomever wrote the article and makes me wonder if reinstalling the same version from the CD works without screwing up your
/home– MWB Jan 07 '17 at 17:00 -
@sbergeron This bug report calls it "misleading UI" https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1265192 – MWB Jan 07 '17 at 17:13
-
21I didn't find the page mentioned above very clear, but I found the key to success was: In the installation menu, select Something else. On the next screen double-click on the partition where Ubuntu and data is installed and choose use as "ext4 journaling file system" (if that is the format type you are using) and mount point "/". Make sure format box is unticked. Continue installation. When being asked for your name and such, enter the same username you had before. Tested with 16.04 LTS. – holmis83 Jan 22 '17 at 20:04
-
-
@holmis83 This should be the only accepted penultimate answer. Thank you. – Bill Kotsias Apr 07 '20 at 06:50
-
@Panther Can I keep boot, swap and all other partitions same? In short, is it okay if I format only '/'? It's not clear from the page. Thanks – vineeshvs Mar 01 '21 at 14:49
If you have a dedicated partition for /home:
- launch the installer
- when it comes to the choice of disk and partitions, choose "other" and then, manually select the partition for / and /home; check that the installer will format only the / partition, and not the /home
If you have only one partition:
- launch the live cd, select "try Ubuntu"; if you have an old pc, you may try xubuntu instead of ubuntu
- once on the desktop, use the file manager to browse your home directory, display hidden files, select all and copy all on a usb key
- when the installation is finished, you can copy again the files in your /home before restarting
- 1,200
-
4I had separate home partition. I chosen reinstall keep data if possible, and all data on home were deleted. Writing just to tell other people to payattention. – umpirsky Jun 22 '13 at 12:15
-
1
This is an update, 04/2025 (question 1546532)
I have a Ubuntu 24.04-Windows 11 dual-boot setup on a laptop. I started with Gnome with gdm then switched to KDE plasma with sddm.
My Ubuntu Gnome Desktop had quite a few things missing. I suspected the system is corrupted. One example is I couldn't install R with apt. Besides, my Firefox browser didn't work. There are a sleuth of other problems. So I'm thinking about reinstalling Ubuntu and start anew.
Here're the steps:
- Download a Linux distro and create a live USB.
- Boot up from the live USB to the Linux distro.
- Check the size of the partition that currently has Ubuntu on it by
sudo fdisk -l. Ignore home and swap partitions. Remember the size of the root partition. - Select to install the new distro.
- When asked about "Installation Type", choose "Something else" (or "Manual install" in some distros).
- In the partition table, find the Ubuntu root partition. Double check the size and make sure it matches with the root partition.
- Delete the partition. Now you have a free space of the same size (or more if you have had free space before the deletion).
- Create a new partition from the free space. The type of the partition should be "primary" and mount it as "/".
- Check the "Format?" box so the new partition will be wiped out. If you want to keep files, do not check the "Format?" box.
- If you want to keep an existing home partition, you need to mount it as home again.
- Proceed to create user name and password. If you want to access an existing home partition, make sure you use exactly the same user name and password. Otherwise you will have authorization issues.
That's it. You can dual boot as usual.
Update on 04/26/2025:
I tried the method above and it worked. The only unexpected thing was a warning saying something like "efi partition is missing. If you proceed you won't be able to boot blah blah." I quit the installation and made sure I booted from the UFEI flash drive (some systems show two USB devices, one with UFEI in the name and the other without; choose the one with UFEI). If you are sure you booted from the UFEI flash drive, you should be fine.
As it turned out, Calamares provides an even simpler way to replace the ubuntu (replace here means clean slate reinstallation of a new distro). It is called "Replace Partition". With this option, you don't need to worry about deleting/creating partitions, the efi warnings, or existing home/swap partitions. You simply select the partition where the root of the outgoing Ubuntu is located and proceed with installation. Calamares will take care of the rest.
The whole process is like a breeze! It is truly worry free. Note the partition you choose will be wiped clean by default. This is exactly what I want, because I suspect my old system is corrupted. After the re-installation, everything works, including some packages I couldn't install before.
Happy Ubuntu'ing!
- 17
Why reinstall? Just install the (meta)-package that installs the graphical Desk Top Environment (DTE) of your choosing. If you want to reinstall, at least create a separate /home partition. If you really want flexibility use Logic Volume Manager (LVM) so you can easily add, remove and resize partitions (aka "logical volumes" in LVM language). You can also add or remove disks to your logical disk (volume group) without reboot the machine.
But please consider to just install the right DTE first, as you really don't need to reinstall your machine to get a graphical environment. Or even uninstall the DTE you installed, if your don't want it in your machine.
- 1,625
-
7
-
It is a Desk Top Environment, which could be Gnome, KDE, or any other you chooses to use. And yes, that is a proper term. – Anders Jan 26 '18 at 05:04
-
-
5