| Home > Computersystemen > Services > USB Devices |
Using USB devices on Linux
On the departmental Linux computers USB devices are managed by the hotplug subsystem.
This means that such devices are identified automagically and the corresponding drivers are loaded without any further manual intervention ... just plug them in and wait a few seconds to let everything load and settle.
-
USB keyboards should work without any further settings.
- The system's idea about the keyboard layout that is being used is of course set at boot time and therefore you might have problems finding the right key if the layout of the additional keyboard differs from the default one.
-
USB mice should work without any further settings.
- You might have to move it around and click several times before the exact type is recognized and then activated.
-
USB memory sticks, MP3 players, USB hard disks, etc.
- The exact way such devices are detected and mounted, depends on the system/environment you are using (see below).
-
The directory on which a device is mounted, can usually be found with the command:
mount | grep usb - The owner of this directory (and all files in it) is the person who is currently logged in under X. If nobody is logged in, the owner is root.
- You can manipulate the files on these devices with the standard Unix file manipulation tools, in exactly the same way as you do with files on (regular) hard disks (e.g. cp, mv, rm, ...)
- When you are done, do not forget to de-activate the device with the appropriate command, BEFORE UNPLUGGING IT, otherwise you might loose some or all data on the device:
-
Take care to actually check whether the device is effectively de-activated.
You can use the commands
mountordffor that. If it didn't succeed, use the command:
to look for the processes that are still using the device in question ... make sure you select another directory in all file manager windows and cd to another directory in all terminal windows.fuser -m /directory/device/is/mounted/on- They will be detected automagically and can be mounted/umounted using several GUI elements
- Usually the devices are mounted under the /media directory tree
- De-activate/unmount using the appropriate GUI element
- You need to start a removable-device-manager yourself ... you can use
ivman - The manager automagically detects and mounts all removable devices, usually under the /media directory tree
- Sometimes this does not succeed for various reasons ... lookup the device in question with the
dmesgcommand and mount it manually using:
(Replace /dev/sdb1 with the actual device node your device is known to the kernel of course ... you can find this in the dmesg output)pmount /dev/sdb1 - De-activate/unmount using:
(Replace /media/usbdisk with the actual directory your device is mounted on of course)pumount /media/usbdisk - Do not forget to stop the manager when logging out ... otherwise the next
user of the system might get into trouble:
killall ivman - They will be detected and mounted automagically as /usb/usb-storage/device-*.
-
Sometimes this does not succeed for various reasons ...
executing the command
usb-mountwithout arguments usually mounts them as expected. - De-activate/unmount using:
(Replace the 0 with the actual number your device is mounted on of course)usb-umount /usb/usb-storage/device-0
Ubuntu with KDE and/or GNOME
Ubuntu without KDE and/or GNOME
Debian Sarge
