How to reinstall ubuntu and preserve home directory [duplicate]

After spending the better part of a day on this, I finally have a good idea of what's going on. The installation package was on my flash drive, but Ubuntu itself was installed on the partition of my hard drive. So, the way to reinstall is to use the same flash drive that had the installation package and boot directly through that. This allows Ubuntu to do the installation process again, and about halfway through the installation process, you will have the option to either upgrade or install alongside the current version of Ubuntu, or "do something else". Since the installer version on my flash drive was actually older than the current version on the hard drive, I decided to re-download the most up-to-date version of Ubuntu on a new flash drive, and boot through that one instead. Then, using that, I chose the "do something else" option and was able to manually select the partition I wanted. The dialog box showed which one Ubuntu was already installed on, so I chose that partition, and then changed the mount point to '/'. Choosing this one meant that all of my stuff would stick around, and lo and behold, it did!

NOTE: if the version on the flash drive is newer than the version on the hard drive, your best bet is the upgrade option. This updates the OS but preserves all of your information/files/etc. I didn't have this option because my flash drive and hard drive versions ended up being the same.

This site contains a useful step-by-step guide, if you need any additional direction.


The last line and the link indicates that you have a persistent Live USB

If you have a full installation in an USB drive see Re-install Ubuntu without losing data in home folder

The instructions for reinstalling while preserving the /home directory is for a full installation in an internal hard drive. This may or may not work for a full install in an USB drive. These instructions will definitely not work for a persistent live USB.

See What would be the differences between a persistent USB Live Session and a installed Ubuntu in a USB drive? for some detailed answer about the differences between full install USB and persistent USB.

If you can boot from the USB and get to your personal files, copy them in a different USB and in the internal drive so that you don't lose your data.

To copy your personal data into your internal drive, follow these steps:

  1. Boot from the USB
  2. Open "Files," the second icon on the left.
  3. You should see your home folder. right click on the folder(s)/file(s) you want to copy and select copy. You can select multiple folders/files by holding down Ctrl button and clicking on different files and folders.
  4. On the left panel of "Files" look for hard drive icons under Devices.
  5. Click on the one that has your other personal files.
  6. Navigate through folders to get to the folder where you want to put the files/folders you have copied. Create a new folder if you want.
  7. Right click at an empty space inside the folder and select paste.

Once you have your data safe and secure, you can use the tutorial you had used before to format the USB drive and start over again.

If you want to have a full install in an USB, you will need two USB drives.

First one to install from, a Live USB, like the one you have now.

Second one 8GB or a bigger one to install to.

Follow the instructions at How do I install Ubuntu to a USB key? (without using Startup Disk Creator) for creating a full install in an USB.

If you have a full installation in an USB

First, you will not be able to use that USB to install Ubuntu in another disk. If you are choosing "Install Ubuntu" from your USB then you don't have a full install.

If you have a full installation in an USB, you will need another Live USB that you can boot Ubuntu from. Use the second USB to install Ubuntu in your first USB.

Hope this helps