Questions tagged [umount]

umount detaches a specified file system from the file tree.

44 questions
471
votes
16 answers

How to unmount a busy device

I've got some samba drives that are being accessed by multiple users daily. I already have code to recognize shared drives (from a SQL table) and mount them in a special directory where all users can access them. I want to know, if I remove a drive…
Max
  • 5,799
  • 3
  • 20
  • 27
195
votes
13 answers

Unmount the directory which is mounted by sshfs in Mac

I've installed OSXFUSE in my mac and used sshfs to mount a remote directory. Now I would like to unmount it, but can't find the way. My OS is OSX 10.8 Mountain. Can anyone help?
waitingkuo
  • 89,478
  • 28
  • 112
  • 118
163
votes
6 answers

Force unmount of NFS-mounted directory

I have an NFS-mounted directory on a Linux machine that has hung. I've tried to force an unmount, but it doesn't seem to work: $ umount -f /mnt/data $ umount2: Device or resource busy $ umount: /mnt/data: device is busy If I type "mount", it…
Lorin Hochstein
  • 57,372
  • 31
  • 105
  • 141
104
votes
12 answers

Linux: Which process is causing "device busy" when doing umount?

Linux: Which process is causing "device busy" when doing umount?
flybywire
  • 261,858
  • 191
  • 397
  • 503
22
votes
4 answers

Bash Script - umount a device, but don't fail if it's not mounted?

I'm writing a bash script and I have errexit set, so that the script will die if any command doesn't return a 0 exit code, i.e. if any command doesn't complete successfully. This is to make sure that my bash script is robust. I have to mount some…
Amandasaurus
  • 58,203
  • 71
  • 188
  • 248
16
votes
4 answers

s3fs unmount: directory is not empty

I'm using s3fs and osxfuse to mount an S3 directory on my Mac: s3fs my-bucket-name $PWD/s3 When it's time to unmount it, I do this: % s3fs umount $PWD/s3 s3fs: MOUNTPOINT directory /Users/kwilliams/blah/s3 is not empty. if you are sure this is…
Ken Williams
  • 22,756
  • 10
  • 85
  • 147
9
votes
2 answers

bindfs, inverse operation?

In my .bashrc I have function bindfs () { mkdir -p ~/$1 sudo /usr/bin/bindfs -u $(id -u) -g $(id -g) $1 ~/$1 } in order to be able, as a normal user, to read, write, execute files on ext3 file systems auto-mounted below /media/. This works…
AlexG
  • 342
  • 4
  • 15
5
votes
1 answer

How to umount a busy windows file using Ubuntu in WSL?

I must unmount drvfs and remount it with the ‘metadata’ flag to use a new file system features to WSL that allows making changes in permissions in WSL. But when I do this: sudo umount /mnt/c It returns umount: /mnt/c: target is busy How can I force…
KPC
  • 57
  • 1
  • 5
3
votes
2 answers

fuse action on umount

I've written some simple filesystems with Python-fuse, but now I'm wanting to do something that I can't find in the pydoc nor in the sample scripts I've found: when the filesystem is unmounted with fusermount -u, I want to trap that action, perform…
jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
3
votes
0 answers

How can i mount and unmount linux filesystems using ctypes, mount and umount

I have a python script (ran as root) that needs to be able to mount and unmount the filesystem of a USB flashdrive. Ive did some research and i found this answer https://stackoverflow.com/a/29156997 which uses ctypes. However. the answer only…
user8372417
3
votes
0 answers

systemd : mount, rsync, umount

I'm trying to automate a mount/rsync/umount on a USB key (NTFS formatted but it doesn't matter, I think) with systemd. My goal is to copy the content of a given folder on my key when plugged, then unmount it so I can unplug it properly. I can nearly…
Vigon
  • 43
  • 1
  • 7
3
votes
2 answers

Mount Physical device to Notebook

I need to mount by phone (Huawei Honor 6) to the notebook. This is the python code, what I wrote : (python phonedirectory.py) import os os.getcwd() os.chdir("/media/") os.system("killall gvfs-gphoto2-volume-monitor") os.system("killall…
Karthik
  • 315
  • 1
  • 4
  • 16
3
votes
1 answer

udev won't execute rule properly

udev does not run my bash script properly. Heres my rule: ACTION=="add", KERNEL=="sd*1", SUBSYSTEM=="block", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="6544", RUN="/usr/local/bin/usb-bmw-in" ACTION=="remove", KERNEL=="sd*1", SUBSYSTEM=="block",…
Unkn0wn
  • 97
  • 1
  • 6
2
votes
0 answers

cryptsetup and umount fail with "target is busy." error

I'm experimenting with cryptsetup. My target is to be able to store data into and encrypted file into a non-encrypted hard drive. I'm doing the following mkdir /data/test && /data/test # Create a key openssl genrsa -out luks_key 4096 # Create file…
2
votes
1 answer

Error detaching volume : Volume is in the 'available' state

I want to detach volume from ec2-instance in aws but getting following error : Error detaching volume : Volume is in the 'available' state. I Have unmounted that disk ie fdisk -l doesn't show that volume also I have tried "Force Detach Volume"…
Ashish Karpe
  • 5,087
  • 7
  • 41
  • 66
1
2 3