Please take care that you have no unsaved work if you test this.  I ran this command as an experiment, but how can I undo it without rebooting?  # mount --rbind / /mnt   What I have tried   # umount /mnt umount: /mnt: target is busy.  # strace -f -e umount,umount2 umount -R /mnt umount2("/mnt/var/lib/nfs/rpc_pipefs", 0) = 0 umount2("/mnt/sys/kernel/security", 0)  = 0 umount2("/mnt/sys/fs/cgroup/unified", 0) = -1 EBUSY (Device or resource busy) umount: /mnt/sys/fs/cgroup/unified: target is busy. +++ exited with 32 +++  # umount -l /mnt # findmnt findmnt: can't read /proc/mounts: No such file or directory   (this is the catastrophe I warned you about).   Environment  Fedora 28.
121342
Asked on  but didn't get enough attention, so reposted here, with the hope some people here know the answer.  There is another  discussing about umounting rbind mounts, but the solution has unwanted effect.  Consider the following directory layout:  . ├── A_dir │   └── mount_b ├── B_dir │   └── mount_c └── C_dir   Now I bind C_dir to B_dir/mount_c and rbind B_dir to A_dir/mount_b:  [hidden]$ sudo mount --bind C_dir B_dir/mount_c [hidden]$ sudo mount --rbind B_dir A_dir/mount_b [hidden]$ mount | grep _dir | wc -l 3   Now umount A_dir/mount_b will fail, which is not surprising.  According to the answers everywhere on the web, we need to umount A_dir/mount_b/mount_c first then umount A_dir/mount_b. However, umount A_dir/mount_b/mount_c will also unmount B_dir/mount_c, which is unwanted:  [hidden]$ sudo umount A_dir/mount_b/mount_c [hidden]$ mount | grep _dir | wc -l 1   Now my question is, how do I unmount A_dir/mount_b but leaving B_dir unaffected, i.e. there is still a bind B_dir/mount_c to C_dir?  EDIT: this problem doesn't seem to appear in Ubuntu. More specifically, it works fine on my Ubuntu 14.04 but not working on Fedora 23 and CentOS 7. Why there is the difference and what's the work around for Fedora and CentOS?  EDIT: some more information on the actual problem that I am trying to solve.  I tried to create a sandbox and used --rbind to mount the /dev and /proc to the sandbox.  When destroying the sandbox, it seems I can't cleanly destroy it because unmounting &lt;sandbox-root&gt;/dev/pts in FC23 and CentOS7 will unmount /dev/pts, after which my shell and SSH connections hang and I have to reboot the machine. That's why I am asking if there is a way to unmount the --rbind mounts without affecting submounts.
121775
looking at df -h, I realized I have this /dev/loop0 mounted on /snap/core/3604 and it's always 100% full :   root@maxipc:~# df -h Filesystem      Size  Used Avail Use% Mounted on udev            7.8G     0  7.8G   0% /dev tmpfs           1.6G  9.9M  1.6G   1% /run /dev/sda3       116G   38G   73G  35% / tmpfs           7.8G   20M  7.8G   1% /dev/shm tmpfs           5.0M  4.0K  5.0M   1% /run/lock tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup /dev/loop0       84M   84M     0 100% /snap/core/3604 /dev/sda1       239M  111M  111M  50% /boot cgmfs           100K     0  100K   0% /run/cgmanager/fs tmpfs           1.6G   44K  1.6G   1% /run/user/1000   When I do a umount /snap/core/3604orumount /dev/loop0 it will unmount so it's apparently not busy at all(also when i try to remount /dev/loop0 again, it doesnt remount because, of course, it's not in fstab. in it, it looks like there is a whole little, cute and tiny root filesystem squashed in that 84M:   root@maxipc:~# ls -la /snap/core/3604 total 4 drwxr-xr-x 24 root root  333 Nov 30 12:39 . drwxr-xr-x  3 root root 4096 Dec 26 20:29 .. drwxr-xr-x  2 root root 1937 Nov 30 12:38 bin drwxr-xr-x  6 root root  129 Nov 30 12:38 boot drwxr-xr-x  4 root root 1160 Nov 30 12:38 dev drwxr-xr-x 80 root root 2399 Nov 30 12:38 etc drwxr-xr-x  2 root root    3 Apr 12  2016 home drwxr-xr-x 20 root root  406 Nov 30 12:38 lib drwxr-xr-x  2 root root   43 Nov 30 12:38 lib64 drwxr-xr-x  2 root root    3 Nov 30 12:35 media drwxr-xr-x  3 root root   45 Nov 30 12:39 meta drwxr-xr-x  2 root root    3 Nov 30 12:35 mnt drwxr-xr-x  2 root root    3 Nov 30 12:35 opt drwxr-xr-x  2 root root    3 Apr 12  2016 proc drwx------  2 root root   46 Nov 30 12:38 root drwxr-xr-x  8 root root  115 Nov 30 12:38 run drwxr-xr-x  2 root root 2349 Nov 30 12:38 sbin drwxr-xr-x  2 root root   58 Nov 30 12:39 snap drwxr-xr-x  2 root root    3 Nov 30 12:35 srv drwxr-xr-x  2 root root    3 Feb  5  2016 sys drwxrwxrwt  2 root root    3 Nov 30 12:37 tmp drwxr-xr-x 11 root root  151 Nov 30 12:38 usr drwxr-xr-x 12 root root  172 Nov 30 12:38 var drwxr-xr-x  2 root root    3 Nov 30 12:36 writable   and when I try to do a fuser -m /snap/core/3604 to see who uses the mount, nothing shows up. it reappears every single boot, and I don't know how the heck it's coming up, oh also, there is no sign of it in /etc/fstab. it's also squashfs file system. it looks like it's harmless but I just wanna know why it does what it does. what is it? any help/reply would be appreciated.  Thank you in advance,   MG  ps: I thought this question is different because the loop device is mounted as if it is an primary and working filesystem eventhough it's not busy at all. it gets umounted everytime if you want to, but it shows up again after boot. usually loop devices come up by df -H but for me this loop device comes up even among things that gnome graphical tools show, just like how a hardrive shows in your nautilus.
103581
Please suggest me any particular unnecessary file that I can clean to back everything to normal condition(temporarily). (i.e. any log or archieve or anything ). My var/log has only 40MB and Home directory has 3GB of space(so I believe that's not a problem). Other than that what I can clean up to make space.   [user@host]$ df -h Filesystem            Size  Used Avail Use% Mounted on /dev/mapper/vg_inamivm-lv_root                        18G   17G     0 100% / tmpfs                 1.9G     0  1.9G   0% /dev/shm /dev/sda1             485M   71M  389M  16% /boot   I am in a debian machine.   UPDATE1:  output of  cd /; du -sxh *  6.1M    bin 61M     boot 156K    dev 22M        etc 3.3G    home 306M    lib 18M     lib64 16K     lost+found 4.0K    media 4.0K    mnt 408K    opt du: cannot access `proc/18605/task/18605/fd/4': No such file or directory du: cannot access `proc/18605/task/18605/fdinfo/4': No such file or directory du: cannot access `proc/18605/fd/4': No such file or directory du: cannot access `proc/18605/fdinfo/4': No such file or directory 0       proc 208K    root 9.7M    sbin 0       selinux 4.0K    srv 0       sys 8.0K    tmp 536M    usr 187M    var   Update2  Output of ls -la /  dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 . dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 .. -rw-r--r--.   1 root root     0 Aug  7 08:42 .autofsck dr-xr-xr-x.   2 root root  4096 Mar 28 16:53 bin dr-xr-xr-x.   5 root root  1024 Mar 28 16:54 boot drwxr-xr-x.  16 root root  3580 Sep  9 03:13 dev drwxr-xr-x.  69 root root  4096 Aug 23 09:19 etc drwxr-xr-x.   9 root root  4096 Jun 29 16:10 home dr-xr-xr-x.   8 root root  4096 Mar  7  2012 lib dr-xr-xr-x.   9 root root 12288 Mar 28 16:53 lib64 drwx------.   2 root root 16384 Mar  7  2012 lost+found drwxr-xr-x.   2 root root  4096 Sep 23  2011 media drwxr-xr-x.   2 root root  4096 Sep 23  2011 mnt drwxr-xr-x.   3 root root  4096 Mar  7  2012 opt dr-xr-xr-x. 355 root root     0 Aug  7 08:42 proc dr-xr-x---.   5 root root  4096 Aug 17 18:27 root dr-xr-xr-x.   2 root root  4096 May  2 09:13 sbin drwxr-xr-x.   7 root root     0 Aug  7 08:42 selinux drwxr-xr-x.   2 root root  4096 Sep 23  2011 srv drwxr-xr-x.  13 root root     0 Aug  7 08:42 sys drwxrwxrwt.   3 root root  4096 Sep 13 03:37 tmp drwxr-xr-x.  13 root root  4096 Mar 28 17:53 usr drwxr-xr-x.  18 root root  4096 Mar  7  2012 var
47190
Can we undo operations done in a terminal, for example, file deletion through rm?  Solutions obtained:  Aliasing Undelete utilities Backup utilities  Versioning (FUSE)
28468
I deleted an important directory with rm -R command. This is an very populer host data. It was located /var/zpanel/hostdata/ayrintilih After remove ayrintilih directory has gone everything.  I tried to undelete with ext4magic program. But it need to another hdd volume for recovery.  Error message:   ERROR: can not use "/root/recoveried" for recover directory. It's the same filesystem : "/dev/dm-0"   My ISP just replied my request:  Unfortunately there is no way to add another Volume to a virtual Instance.  If it would be a dedicated Server, we could do it, but not in a Cloudserver.  You could try to minimize the partition and create another one, that would  count as another Volume. We also recommend to have allways a  Backup for your Important files.
89195
My Macbook (Snow Leopard OS) was giving me the rainbow wheel of death so I tried booting into safe mode and repairing the disk, with no luck. So I decided to pull the drive out and plug it into my Ubuntu 12.04 desktop with a SATA to USB cable to recover some data before reinstalling the OS. I'm having a lot of trouble trying to mount the drive. I have installed hfsplus hfsprogs and hfsutils and run the following command.  sudo mount -t hfsplus /dev/sdd1 /mnt/"AppleMount"   Which gives me this error.  wrong fs type, bad option, bad superblock on /dev/sdd1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail  or so   Running dmesg tells me this.  [39666.815423] end_request: critical target error, dev sdd, sector 536 [39666.815429] Buffer I/O error on device sdd1, logical block 62 [39670.526393] sd 6:0:0:0: [sdd] Unhandled sense code [39670.526397] sd 6:0:0:0: [sdd]  Result: hostbyte=invalid driverbyte=DRIVER_SENSE [39670.526402] sd 6:0:0:0: [sdd]  Sense Key : Medium Error [current] [39670.526407] sd 6:0:0:0: [sdd]  Add. Sense: Unrecovered read error [39670.526412] sd 6:0:0:0: [sdd] CDB: Read(10): 28 00 00 00 02 18 00 00 08 00 [39670.526422] end_request: critical target error, dev sdd, sector 536 [39670.526427] Buffer I/O error on device sdd1, logical block 62 [39763.562415] hfs: unable to find HFS+ superblock   So I think I'm stuck at this point. Can anyone guide me in the right direction? Thank you!
6616
Please note: The answers and comments to this  question contains content from another, similar question that has received a lot of attention from outside media but turned out to be hoax question in some kind of viral marketing scheme. As we don't allow ServerFault to be abused in such a way, the original question has been deleted and the answers merged with this question.      Here's a an entertaining tragedy. This morning I was doing a bit of maintenance on my production server, when I mistakenly executed the following command:  sudo rm -rf --no-preserve-root /mnt/hetznerbackup /  I didn't spot the last space before / and a few seconds later, when warnings was flooding my command line, I realised that I had just hit the self-destruct button. Here's a bit of what burned into my eyes:  rm: cannot remove `/mnt/hetznerbackup': Is a directory rm: cannot remove `/sys/fs/ecryptfs/version': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/inode_readahead_blks': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_max_to_scan': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/delayed_allocation_blocks': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/max_writeback_mb_bump': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_stream_req': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_min_to_scan': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_stats': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/trigger_fs_error': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/session_write_kbytes': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/lifetime_write_kbytes': Operation not permitted # and so on..   I stopped the task and was relieved when I discovered that the production service was still running. Sadly, the server no longer accept my public key or password for any user via SSH.  How would you move forward from here? I'll swim an ocean of barbed wire to get that SSH-access back.  The server is running Ubuntu-12.04 and hosted at Hetzner.
80678
I've got this error and I can't access my files located in a different partition when I'm using Ubuntu, but when I'm using Windows 8 my files are accessible. I'm using Ubuntu as my main OS. I tried shutting down Windows 8 properly but still nothing happened. Is there any way where this can be fixed?  Error mounting /dev/sda4 at /media/kris/BackUp Files:  Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,dmask=0077,fmask=0177" "/dev/sda4" "/media/kris/BackUp Files"' exited with non-zero exit status 14:  The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sda4': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option.
78382
This is a followup to .  I figured out something is unmounting my device right after I mount it.  This device is being used by a database (Vertica), which is down and not using the directory while I'm running the mount command.  I'm trying to figure out:   Is systemd the one which unmounts the device? How can I debug why is that happening? How do I fix it?   Here's an example of what is happening:  [root@mymachine systemd]# mount -t ext4 /dev/xvdx /vols/data5; ls -la /vols/data5; sleep 5; ls -la /vols/data5 total 36 drwxr-xr-x   5 dbadmin verticadba  4096 Jul 23  2017 . drwxr-xr-x   9 root    root          96 Jul 16 18:52 .. drwxrwx--- 503 dbadmin verticadba 12288 Jul 23 13:51 somedb drwx------   2 root    root       16384 Nov 30  2016 lost+found drwxrwxrwx   2 dbadmin verticadba  4096 Jun 20 08:32 tmp total 0 drwxr-xr-x 2 root root  6 Jun  8  2017 . drwxr-xr-x 9 root root 96 Jul 16 18:52 .. [root@mymachine ~]#    fstab:  # # /etc/fstab # Created by anaconda on Mon May  1 18:59:01 2017 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=29342a0b-e20f-4676-9ecf-dfdf02ef6683 /                       xfs     defaults        0 0 /dev/xvdb swap swap defaults,nofail 0 0 /dev/xvdy /vols/data ext4 defaults 0 0 /dev/xvdx /vols/data5 ext4 defaults 0 0   Some more logs as per 's suggestion:  Aug 01 16:55:19 mymachine kernel: EXT4-fs (xvdx): mounted filesystem with ordered data mode. Opts: (null) Aug 01 16:55:19 mymachine systemd[1]: Unit vols-data5.mount is bound to inactive unit dev-xvdl.device. Stopping, too. Aug 01 16:55:19 mymachine systemd[1]: Unmounting /vols/data5... Aug 01 16:55:19 mymachine umount[353194]: umount: /vols/data5: target is busy. Aug 01 16:55:19 mymachine umount[353194]: (In some cases useful info about processes that use Aug 01 16:55:19 mymachine umount[353194]: the device is found by lsof(8) or fuser(1)) Aug 01 16:55:19 mymachine systemd[1]: vols-data5.mount mount process exited, code=exited status=32 Aug 01 16:55:19 mymachine systemd[1]: Failed unmounting /vols/data5.
5953
I have this file (see attached);   And I cannot delete it. it doesn't exist...  I have tried typing rm in the prompt then dragging the file on to it, I have gone to the actual location of the file and it's not there, I have deleted .Trash folders left right and center and I still can't find it... I have just run First Aid on ALL the volumes I have and the file still mocks me. Does anyone else have any suggestions?
80155
If I do  # cd / # ln -s /home test # cd test # mount --bind $PWD /mnt   the entry in /proc/mounts is  /dev/sda2 /mnt ext4 rw,noatime,data=ordered 0 0   which is the device that is mounted to /home and is not easily deducible from $PWD which is /test. How can I determine which device (i.e., /dev/sda2) is going to show up in /proc/mounts in general given that the bind mount may be to a directory/file that is potentially "obscured" by symlinks, other bind mounts, etc?
106590
Hello. I was trying to make a bootable flash drive from the startup disk creator, and when I went to erase the flash drive I accidentally erased the wrong drive, a 1TB removable drive. The operation took less than a second and gave no warning. I tried erasing the flash drive and it took about a minute, but it took but a second to erase the 1 TB drive, which is very surprising.  Please help, Gabriel
97937
Computer was humming away happily.  It had downloaded a kernel update eariler in the week and been asking for a reboot since.  This morning I relented.  When the computer powered back up it made a loud repeated clicking noise which I tracked down to my hard drive by opening the cover.  Since then I can't boot the computer - it keeps failing out to netboot (which goes nowhere).  Based on a quick google I think the disk is history.  Does anyone know of a way to recover the disk?  I realise I'm probably SOL but it's worth asking.   Edit  Thanks for the answers.  All very interesting and informative.  Nothing on the drive is worth the cost of a professional recovery service and my backups cover the important bits anyway.  I was just hopeful that I might be able to avoid the nuissance of a rebuild on a new disk.
113399
I'm getting the following output when the mount command is executed.  [root@]# mount /dev/sda2 on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw) /dev/sda1 on /boot type ext4 (rw) /dev/sda3 on /home type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)   I'm not able to understand the output of this command. Can anyone give the explanation for this output?
75928
I know of this command:  find /path/to/mountpoint -inum &lt;inode number&gt;   but it is a very slow search, I feel like there has to be a faster way to do this. Does anybody know a faster method?
47383
I'm using Ubuntu 12.04, and when I rigth click on a my flash drive icon (in the Unity left bar) I get two options that have me confused: eject and safely remove.  The closer I came to an answer was , which concludes that (for a flash drive) they are both equal and also equivalent to use the umount command. However, this last assertion seems to be false.  If I use umount from the console to unmount my flash dive, and then I use the command lsblk, I still see my device (with nothing under MOUNTPOINT, of course). On the other hand, if I eject or safely remove my flash drive, lsblk does not list it anymore. So, my question is, what would be the console command/commands that would really reproduce the behaviour of eject and safely remove?
28281
On several machines that I've upgraded from Natty to Oneiric, I get an error every boot (one for every NTFS partition):  Serious errors were found while checking the disk drive for /windows/c.  Press I to ignore, S to skip mounting, or M for manual recovery   Following the suggestion in , I ran fsck from the manual recovery shell. I got this output:  fsck from util-linux 2.19.1 fsck: fsck.ntfs: not found fsck: Error 2 while executing fsck.ntfs for /dev/sda1   I can't find fsck.ntfs, and command-not-found doesn't help either. How can I make this error go away?  By the way, I've tried booting into Windows (XP) several times, thinking that Windows would repair the filesystems. But apparently Windows thinks the filesysystems are just fine. And it's odd that all NTFS filesystems are affected.  Also, I can work around this problem by dropping to a recovery shell and issuing mount -a, but for my coworkers' sakes I need unattended boot.