Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to break some files out of my VirtualBox install of Ubuntu, and I accidentally mounted a VirtualBox shared folder onto ~, thereby erasing the very files I was trying to get at. Is there any way to recover my hard work, or am I just going to have to sudo rm -f /bin/mount and start over?

And no, I don't seriously intend to rm -f /bin/mount.

share|improve this question
up vote 2 down vote accepted

Mounting just hides the files under the mount point, it doesn't change them. If you unmount the VB share, you'll see your files again. You don't even need to unmount the share; you can move it:

mkdir /media/foo
mount --move ~ /media/foo
share|improve this answer
It gets better. Since I didn't do a persistent mount, I just had to reboot! <facepalm> – Matt Jun 27 '11 at 20:03

While the contents of a directory become inaccessible when you mount a file system over the top, they aren't lost. Unmounting the file system should make them visible again. Something like the following:

sudo umount ~
share|improve this answer

Your Answer


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.