Questions tagged [unmounting]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
40
votes
2answers
61k views

Eject / safely remove vs umount

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 ...
9
votes
1answer
2k views

Why is lazy MNT_DETACH or `umount -l` unsafe / dangerous?

I've read in a few places that umount -l is unsafe: In an answer by @cas: don't use umount's --lazy option if you care about when the external drive can be safely unplugged A comment by @...
55
votes
7answers
96k views

How do I find out which processes are preventing unmounting of a device?

Sometimes, I would like to unmount a usb device with umount /run/media/theDrive, but I get a drive is busy error. How do I find out which processes or programs are accessing the device?
10
votes
1answer
2k views

Unmount a rbind mount without affecting the original mount

Asked on serverfault but didn't get enough attention, so reposted here, with the hope some people here know the answer. There is another question discussing about umounting rbind mounts, but the ...
12
votes
4answers
12k views

Recursive umount after rbind mount

When entering a chroot is sometimes necessary to mount /sys and /dev using -rbind instead of -bind in order to insure everything is in it's right place when somebody goes looking. The problem comes ...
5
votes
2answers
3k views

List current inotify watches (pathname, PID)

How do I get a list of: Pathnames currently being watched by inotify, and PID of the process watching I ask because I have found that syncthing's inotify watches were preventing my disk from being ...
2
votes
1answer
477 views

Why is usb-drive not visible with `lsblk` after having been ejected from Thunar?

If I put a USB-drive in, it will automount. I can see it with lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 1 7,5G 0 disk └─sdb1 8:17 1 7,5G 0 part /media/user/usb-...
36
votes
6answers
168k views

Busy Device on Umount

I often experience a problem to umount a directory: umount /mnt/dir umount: /mnt/dir: device is busy There are many reasons why the device is busy. Sometimes there are processes running which have ...
62
votes
3answers
14k views

Why is 'umount' not spelled 'unmount'?

I am wondering if there is any historical or practical reason why the umount command is not unmount.
2
votes
2answers
2k views

How do I know when lazy `umount -l` completes?

I am running Linux and want to safely unmount my external HDD. I want to use umount --lazy: Lazy unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this ...
16
votes
5answers
32k views

How to unmount a formerly chroot'd filesystem?

I'm using a rescue-live-system (similar to a live-cd) to fix some issues with my Debian server, like that: # mkdir -p /mnt/rescue # mount /dev/md2 /mnt/rescue # mount --bind /dev /mnt/rescue/dev/ # ...
7
votes
1answer
8k views

Umount all attached usb disks with a single command

Is there a (safe) way to umount all partitions on all attached usb devices (usb-hdds, usb-sticks) with a single commandline command, including several encrypted luks partitions? Only the partitions ...
5
votes
3answers
2k views

Ensure that loopback root and host are unmounted on shutdown

I'm trying to setup a Linux system that runs from an LVM-formatted image file. After some tinkering with the initramfs and boot options I managed to make it up and running by mounting the host file ...
2
votes
1answer
825 views

How to prevent fs from unmounting?

I'm trying to back up a disk that has been acting very strangely lately, but my back-up attempts fail after a few minutes, because the disk's file system (at /dev/disk4) "spontaneously" unmounts. (I ...
6
votes
1answer
2k views

How to mount a Truecrypt container with a timeout from the command line?

I'm mounting a truecrypt container via the command line (i.e. truecrypt file dir). Is there any way to have truecrypt automatically unmount the container after a given amount of inactivity in dir?
5
votes
2answers
3k views

systemd: running a script on shutdown after filesystems are mounted read-only

Is there a way to run a script on shutdown, after the file system is remounted as read-only? I've a raspberry pi connected to a wireless socket, which I can control via a sender and a script. I want ...
3
votes
4answers
20k views

mount.nfs: Stale file handle error - cannot umount

Every time I try to mount a NFS share I get this: >> mount -t nfs gitlab-replica-storage.blah.com:/export/registry-gitlab-prod-data-vol /mnt/test mount.nfs: Stale file handle The problem is ...
7
votes
7answers
39k views

umount /home does not work

I trying to merge my separate /home partition with my / partition in linux mint 13. I was told to umount /home, mount it on a different location and copy the contents to the /home directory on the / ...
6
votes
1answer
16k views

sshfs - can't unmount the point

I mounted a folder on a remote machine using sshfs, but didn't specify -o allow_other flag thus can't access the mounted directory. When I try to mount over with -o allow_other option sshfs gives me ...
5
votes
1answer
449 views

Is `mount -o remount,ro` guaranteed to fail if there are files open for writing?

I am working on a safe and race-condition-free alternative to umount -l with removable devices: I'm planning on: umount --move under a 000 permissions directory so no more files can be opened by ...
5
votes
2answers
5k views

Mounting and unmounting in same shell script results in error

I need to mount a volume, tar the contents of the mounted volume and unmount that mounted volume, in a single shell script. So I coded as, $ cat sample.sh sudo mount -o loop Sample.iso /tmp/mnt cd /...
4
votes
1answer
94 views

What can still be done with a lazy-unmounted filesystem?

umount --lazy calls umount(2) with the MNT_DETACH flag set. umount(2) says that will: "Perform a lazy unmount: make the mount point unavailable for new accesses, immediately disconnect the ...
2
votes
1answer
422 views

How do I automatically force a umount on a usb drive that has already been removed?

I have debian system that auto mounts an entry in my fstab file when a usb drive is connected. This is done so as a read only device The device is mounted to /media/usb1 If i'm in the console and I ...
2
votes
1answer
167 views

How works the “eject usb driver” from Gnome?

I have a question for some time in my head: I have an external hard drive, when I want to dismount it I simply give in the icon that says: "Remove unit safely" in the Nautilus (use Nautilus from ...
1
vote
1answer
575 views

Automatically run command before umounting a filesystem

I want to execute a command automatically shortly before a filesystem is unmounted. The command still needs the filesystem to be mounted but I am interested in information as "new" as possible. ...
1
vote
2answers
370 views

List processes accessing device after `umount --lazy`

I want to remove my external HDD as safely as possible. I want to use umount --lazy: Lazy unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this ...
0
votes
1answer
446 views

How do I set up a udev rule to mount the SanDisk Cruzer USB upon insertion in order to eliminate an fstab entry?

Suppose I run sudo mount -a after setting /etc/fstab to: /dev/usbhd1 /path/to/mount/point ntfs rw,auto,nofail 0 1 Yesterday, upon asking what steps our architect and I should do next after a ...
0
votes
1answer
297 views

Ensure writing has completed after `umount -l / --lazy`

One of many issues with umount -l is that there's way to know when it has completed. Is there a way to: Know all writing processes have finished and all data has been written to disk. Prevent future ...
0
votes
0answers
24 views

Unwanted permanent umount [duplicate]

The problem I've got a simple question: what's the difference between ejecting flash drive using GNOME Files (formerly known as Nautilus) button (see image below) and umount command? Before you will ...