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 4 at 20:35
  • Yes, it is on /dev/sda8. I am dual booting Windows and Ubuntu. Ubuntu is installed in a partition. – user1237300 May 4 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 4 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 4 at 20:58
  • Don't run it as root (i.e. sudo nautilus). – danzel May 4 at 20:59
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.

  • Thank you. This works! Is there a GUI way to do this so that I can copy my files to my harddrive? – user1237300 May 4 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 4 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 4 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 4 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 4 at 20:55

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.