Sunday, April 9, 2017


For most users these days, accessing flash drives in Linux is handled nicely by the desktop and file managers. But sometimes it's convenient to be able to mount a flash drive from the command line, as a normal user; for that, try the udisksctl tool.

I tested this in Antergos, in Debian Stable ("Jessie"), and in Debian Testing ("Stretch"). Insert the flash drive and run lsblk to check for the device name:

sdb1 is the device name for my flash drive. To mount it, I used:

$ udisksctl mount -b /dev/sdb1

The -b switch is short for --block-device, according to udisksctl mount --help.

Running lsblk again shows the flash drive mounted:

To unmount the flash drive, I used:

$ udisksctl unmount -b /dev/sdb1

For more info see man udisksctl, udisksctl help, udisksctl mount --help, and these excellent articles:

No comments: