Skip to content

Archive for

23
Oct

Fix “Unable to unmount, device is busy” error

I am trying to unmount a file system mounted with FUSEFS SSHFS but I get errors and I am unable to unmount the resouce:

# umount -f /mnt/backup
umount2: Device or resource busy
 
# cat /proc/mounts
john@10.0.0.10:/home/john/backup /mnt/backup fuse.sshfs rw,nosuid,nodev,relatime,user_id=0,group_id=0 0 0
 
# fusermount -u /mnt/backup/
fusermount: failed to unmount /mnt/backup: Device or resource busy
 
# ls -la /mnt
/bin/ls: cannot access /mnt/backup: Transport endpoint is not connected
total 8
drwxr-xr-x  3 root root 4096 Aug 29 03:55 ./
dr-xr-xr-x 25 root root 4096 Oct  5 07:36 ../
d?????????  ? ?    ?       ?            ? backup/

To solve the problem we’ll unmount the file system using “lazy unmount”:

umount -l /mnt/backup

And voila, the filesystem is unmounted.

To learn more about -l option just look into umount man page:

      -l     Lazy  unmount.  Detach  the filesystem from the filesystem
hierarchy now, and cleanup all references to the filesystem as soon as 
it is not busy anymore.  (Requires kernel 2.4.11 or later.)
23
Oct

Umount a File System Mounted via FUSEFS

Let’ say we mounted a resouce using FUSEFS SSHFS. To umount that resource run:

fusermount -u /mnt/backup/
17
Oct

LXC work with snapshots

To make a snapshot the container has to be stopped.

Make a snapshot

lxc-snapshot -n mylxc

Make a snapshot with comment

echo "snapshot comment" > snap-comm
lxc-snapshot -n mylxc -c snap-comm
rm snap-comm

List snapshots of a container

lxc-snapshot -LC -n mylxc

Restore snapshots

lxc-snapshot -n mylxc -r snap@

Create new container from snapshot

lxc-snapshot -n mylxc -r snap@ mynewlxc

Delete snapshot

lxc-snapshot -n mylxc -d snap@