Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I hope someone can help. I installed a 2nd HDD, set up 2 partitions on it.

I set up both partitions to mount automatically in /etc/ftsab.

One of the partitions has a mount point of my home directory /home/nick

Trouble is, I forgot to copy everything from the original /home/nick before testing my /etc/fstab by rebooting. (Yes, I'm an idiot). Now I cannot log in (it just bounces back to the login screen), and when I go to a terminal (ctrl+alt+f1) and log in there, my home dir is empty. When I comment out the changes in /etc/fstab, I still cannot log in. I even created a new user, and cannot log in with that either.

My questions:

Is there any way of recovering my lost home directory?

How can I unbrick my system?

thanks...

share|improve this question
1  
You just mounted another filesystem on top of a directory. Nothing to worry about - unmounting the filesystem will make your files visible again. –  gertvdijk Jun 18 '13 at 8:54
add comment

1 Answer

You probably want to mount both the old and the new home directory without logging in as "nick". As root in a rescue shell:

  1. Create two directories like /mnt/old-home and /mnt/new-home.
  2. Change /etc/fstab to mount the home directories on these directories.
  3. mount -a
  4. Move the files.
  5. Unmount both directories.
  6. Change /etc/fstab to use /home/nick instead of /mnt/new-home.
  7. mount -a
  8. Exit the rescue shell and tell Ubuntu to boot normally.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.