fdisk -lfor the new device partitions
mount -o MOUNT-OPTIONS PARTITION /mnt/MOUNTPOINT
The automounters of Gnome or KDE are even worse: they mount all new disk
partitions without request as
How should one know which device this means?
And you cannot change the mount options!
When you unmount ("eject") an USB device the filesystem write cache has to be written to it.
But you see no progress. You just have to wait. And wait...
framstag@moep:~: usbmount /dev/sdc: 8 GB Multiple Card_Reader [a] /dev/sdc1 (vfat 8 GB) /dev/sdd: 29 GB Lexar USB_Flash_Drive [b] /dev/sdd1 (vfat 13 GB) [c] /dev/sdd2 (btrfs 16 GB) mount partition: [a] mount-name=Multiple:Card_Reader mount-name=CR mount-options=noatime,nodiratime,flush,shortname=lower # mount -t vfat -o noatime,nodiratime,flush,shortname=lower,user,uid=1001 /dev/sdc1 /usb/CR Filesystem Size Used Avail Use% Mounted on /dev/sdc1 8.1G 4.1k 8.1G 1% /usb/CR starting new bash for mounting (exit this shell for unmounting!): (usbmount CR)framstag@moep:/usb/CR: ll drwxrwxrwx framstag users - 2016-01-12 15:53:42 $RECYCLE.BIN drwxrwxrwx framstag users - 2016-01-12 14:32:26 debilian drwxrwxrwx framstag users - 2016-01-11 21:13:39 taliesin (usbmount CR)framstag@moep:/usb/CR: exit /dev/sdc1 has been unmounted
As you can see at the example,
usbmount works only on user request!
And it mounts the partition under the name the drive identifies itself (here: "Multiple:Card_Reader") or optional under an alternative alias name given by the user (here: "CR").
After mounting the USB device usbmount
starts a bash where you can do your business.
When exiting this bash the device automatically gets unmounted and you will see consecutivly information how much filesystem cache still has to be written.
In opposition to other usbmount programs this one does mounting in async
mode which results in a writing speed plus of factor 2-5!
To enhance data integrity every 30 seconds the file system buffer will be flushed.
Nevertheless you should exit the mounting bash before removing the USB device.
usbmount also can mount all partitions in one go with default mount options:
framstag@moep:~: usbmount -a # mount -t vfat -o noatime,user,shortname=lower,uid=1001 /dev/sdc1 /usb/XD_1 # mount -t ext3 -o noatime,nodiratime,user /dev/sdc2 /usb/XD_2 Filesystem Size Used Avail Use% Mounted on /dev/sdc1 33G 5.5G 28G 17% /usb/XD_1 /dev/sdc2 266G 99G 154G 40% /usb/XD_2 starting new bash for mounting (exit this shell for unmounting!): (usbmount)framstag@moep:/usb: exit /dev/sdc1 umounted /dev/sdc2 umounted
Instead of option
-a you can use an alias argument in which case
only this (previously bookmarked) device will get mounted.
framstag@moep:~: usbmount WDC # mount -t vfat -o noatime,nodiratime,flush,shortname=lower /dev/sdd1 /usb/WDC Filesystem Size Used Avail Use% Mounted on /dev/sdd1 33G 5.5G 28G 17% /usb/WDC starting new bash for mounting (exit this shell for unmounting!): (usbmount)framstag@moep:/usb: exit
usbmount remembers the mount options of known devices.
usbmount can also handle internal (SD) card-readers.
Here is the full usage:
usage: usbmount [-v] [-a] [-F seconds] [-m mount-root-directory] usage: usbmount [-v] [-n] [-m mount-root-directory] alias usage: usbmount [-v] [-l] [-e] usage: usbmount [-v] -u alias usage: usbmount -H options: -v verbose mode -a mount all -m root-directory for mountpoints (default: /usb) -n non-interactive mode: do not fork a bash -l list stored aliases and mount options -e edit alias table -u unmount alias -F flush disk buffer after seconds (default: 30) -H more help
perl -T usbmount INSTALL /usr/local/bin/
On exit usbmount can sort a FAT filesystem, if you have fatsort installed.
(Debian and Ubuntu:
apt-get install fatsort)
Author: Ulli Horlacher