2

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.

2 Answers 2

2

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
1
  • It gets better. Since I didn't do a persistent mount, I just had to reboot! <facepalm> Jun 27, 2011 at 20:03
2

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 ~

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .