0

I have a urgent question which almost make me crazy now.

I used the following command for MATLAB installation:

sudo mount -o loop /home/study/MATLAB/R2017b/iso/iso2.iso /home/caihongzhu

Under /home/study directory, I have all my useful files. After using this command, I lost all files under the /home/study directory (for user caihongzhu).

Thanks a lot for your help!

Byte Commander
  • 107,489
  • This is the dreaded (but easily fixable) "shadow mount": https://superuser.com/questions/389255/is-it-possible-to-access-files-shadowed-by-a-mount –  Dec 31 '17 at 01:00
  • just a comment that I find everything under the home directory is gone! – user777060 Dec 31 '17 at 01:06

2 Answers2

2

The files aren't lost but just not visible as long as the ISO image is mounted on /home/caihongzhu. Just umount it to get them back:

umount /home/caihongzhu

Next time you should better use another mount point for the ISO image, for example /mnt/:

sudo mount -o loop /home/study/MATLAB/R2017b/iso/iso2.iso /mnt/

Then you can access the files at /mnt/ and your files in /home/caihongzhu/ are still visible.

1

None of your data is lost, it is only hidden because you mounted the Matlab iso onto your home directory. Simply unmount it again, and the original content of the directory will be visible again:

sudo umount /home/caihongzhu

Next time, do not mount anything over your existing user directories, but create a new empty directory as mount target, use /mnt or mount stuff using your Files manager, which automatically creates temporary mount points inside /media/USERNAME.

Byte Commander
  • 107,489