I have been trying for a while to view files, hidden by a mount on my device sporting Debian 6, to no avail, and being new to Linux, I am compelled to ask the question: How do you view files hidden by a mount on Debian 6?
I have gone over the many duplicates I came across as I was drafting this question the first 1 or 10 times and the following answers did not help in my case:
- Answer to "Access to original contents of mount point"
- Answer to "Where do the files go if you mount a drive to a folder that already contains files?"
- Answer to "What happened to the old files if we mount a drive to the directory? [duplicate]"
I also found this, but it was a little intimidating to try that with my limited knowledge of what I am even doing.
I also asked Linux users around me, who all (both) say that it's impossible to see my files without umount
ing.
So just to make things clear, this is what I am working with:
/tmp # mkdir FOO
/tmp # cd FOO/
/tmp/FOO # touch abc
/tmp/FOO # cd
~ # mount /dev/sda1 /tmp/FOO/
~ # ls /tmp/FOO/
bbb
~ # cd /tmp/
/tmp # mkdir BAR
/tmp # cd
~ # mount --bind / /tmp/BAR
~ # cd /tmp/BAR/
/tmp/BAR # ls
bin etc lib media proc sbin sys usr
dev home linuxrc mnt root selinux tmp var
/tmp/BAR # cd tmp/
/tmp/BAR/tmp # ls
/tmp/BAR/tmp #
@John1024:
~ # mount | grep /tmp/
/dev/sda1 on /tmp/FOO type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=cp932,iocharset=cp932,errors=remount-ro)
/dev/root on /tmp/BAR type jffs2 (ro,relatime)
What and to where should I mount --bind
to see the files that were in /tmp/somefolder
? Could the functionality of the solutions linked above be related to what build of Debian I am using?
Edit: For clarification, these are some of the commands I tried:
~ # mount --bind /tmp/somefolder /tmp/anotherfolder
~ # mount --bind / /tmp/anotherfolder
~ # mount --bind /dev/sda1 /tmp/anotherfolder
mount | grep /tmp
?mount --bind /tmp /tmp/BAR
?~ # ls /tmp/BAR/FOO
showsabc