コマンドラインでUSBドライブを umount
する方法を教えてください。私はUbuntu 12.04 LTS 32-bitを使用しています。
例えば、USBドライブが /media/usb
にマウントされているとすると、次のようにすればよいでしょう。
sudo umount /media/usb
usb ドライブが /dev/sdb1
にマウントされていたとすると、次のようにもできます。
sudo umount /dev/sdb1
また、私の質問のひとつである、接続されているすべての usb デバイスをひとつのコマンドで umount する方法についての回答もご覧ください。https://unix.stackexchange.com/questions/43594/umount-all-attached-usb-disks-with-a-single-command
sudo`でrootになってアンマウントするよりも、pmountパッケージをインストールしてアンマウントする方が良いでしょう。
pumount /media/usb
man pumount`が言うように。
NAME
pumount - umount arbitrary hotpluggable devices as normal user
SYNOPSIS
pumount [ options ] device
DESCRIPTION
pumount is a wrapper around the standard umount program which permits
normal users to umount removable devices without a matching /etc/fstab
entry.