1

I am forced to re-install ubuntu because upgrading from 14.04 to 16.04 gave me problems.

However, I would like to save my files in my home directory first before proceeding with re-install.

using "Try ubuntu", I do not see my files unlike the suggestions made by many here. I was able to download nautilus, etc but I cannot find home/my_name.

Any suggestions? I am a bit desperate, it's been a long day.

Edit: I was able to access gparted. I found my home directory. Can I just connect a hard drive and copy this directory into that hard drive so I can save my home files? Will that override all my files in my external hard drive?

  • The home folder is just a folder like any other. Since you mentioned gparted, is your home folder on a separate partition? – danzel May 04 '19 at 20:35
  • Yes, it is on /dev/sda8. I am dual booting Windows and Ubuntu. Ubuntu is installed in a partition. – user1237300 May 04 '19 at 20:41
  • If I am not mistaken, the partition should show up in nautilus and be automatically mounted when you click on it. If not, sudo mount /dev/sda8 /mnt should mount the filesystem to the /mnt folder of the live system so you can copy the files from it. As long as you just copy the files/folders and don't use something like dd, the files on your external drive will remain untouched. If the external drive is formatted as NTFS or FAT, you can pack the whole home folder in a tar archive to preserve file ownership information. – danzel May 04 '19 at 20:49
  • Thanks! I was already able to access them. nautilus isn't working well - it asks me to create the directory /root/.config/nautilus – user1237300 May 04 '19 at 20:58
  • Don't run it as root (i.e. sudo nautilus). – danzel May 04 '19 at 20:59
  • I had a failed 16.04 LTS to 18.04 LTS lubuntu upgrade (old t43 x86; but flavors get 3 years of life not 5), so I wrote the 18.04 LTS I wanted to a thumb drive; installed from it using 'something else', selecting my partitions ensuring 'no format' was selected & installed. I then rebooted & am now upgraded. Yes files should be backed up, but this method erases system directories, installs, puts back software I'd added & didn't touch my $HOME. – guiverc May 04 '19 at 22:14

1 Answers1

0

If you can find your /home partition, you can try mounting it:

sudo mkdir /rescue    
sudo mount /dev/sdax/ /rescue

Replace sdax with your /home partition. If you run into permission problems, you can try giving yourself full permissions with:

sudo chmod -R 766 /rescue

Please keep in mind that this will give all group and non-group members full permissions (except execute) as well. You should change these after your rescue is done.

If you can't access /home through your file manager or you can't change the permissions, you can try using chroot to get into the damaged system. Boot up a live disk, then run the following:

sudo mount /dev/sda1 /mnt
sudo chroot /mnt

Replace sda1 with your root partition.

This should give you command line access to the damaged install, and you should be able to access your /home directory.

circo
  • 116
  • Thank you. This works! Is there a GUI way to do this so that I can copy my files to my harddrive? – user1237300 May 04 '19 at 20:40
  • Actually, I found how to access it by going to the mnt folder. You're a life saver! I realized that some folders there in my home directory require root access but when I right click, I can't change permissions. Is there a way to get around this? – user1237300 May 04 '19 at 20:46
  • The gui way would be using nautilus to move your files. If you can access the drive and the partitions from the live disk, you can use sudo mkdir /rescue && sudo mount /dev/sda8 /rescue. You will create a new mountpoint (/rescue), and mount your /home partition to it. You can then use your graphical manager to access your files. – circo May 04 '19 at 20:47
  • @user1237300 If you have used chroot it should give you cli access to your damaged system - you can run chmod to edit your files permissions. As you're rescuing the files' and will be deleting them later, you can use broad permissions like 766 to make sure you have full access to all the files. You can use this recursively: chmod -R 766 /path/to/home – circo May 04 '19 at 20:49
  • Thank you so much! chmod -R 766 worked. As my second comment indicates, after typing the commands you gave above, I'm able to navigate to the mnt folder and my home files were there. Thank you again!!! – user1237300 May 04 '19 at 20:55
  • I have edited my answer to include all the possible steps. – circo May 04 '19 at 20:56