Prev | Current Page 384 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"

To use umount, you can give it either a directory name or a
device name. For example:
# umount /mnt/floppy
This unmounts the device (probably /dev/fd0) from the mount point /mnt/floppy. You can
also unmount using the form
# umount /dev/fd0
In general, it??™s better to use the directory name (/mnt/floppy) because the umount command
will fail if the device is mounted in more than one location. (Device names all begin with /dev.)
171
Learning Basic Administration 4
If you get the message device is busy, the umount request has failed because either a process
has a file open on the device or you have a shell open with a directory on the device as a current
directory. Stop the processes or change to a directory outside the device you are trying to unmount
for the umount request to succeed.
An alternative for unmounting a busy device is the -l option. With umount -l (a lazy unmount),
the unmount happens as soon as the device is no longer busy. To unmount a remote NFS file system
that??™s no longer available (for example, the server went down), you can use the umount -f
option to forcibly unmount the NFS file system.
A really useful tool for discovering what??™s holding open a device you want to unmount
is the lsof command. Type lsof with the name of the partition you want to unmount
(such as lsof /mnt/floppy).


Pages:
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396