Skip to content

USB Drives

Drew Daniels edited this page Oct 7, 2025 · 6 revisions

Mounting

Locate the block device:

lsblk

Optionally list the FileSystem Type (exfat, vfat, ext4, etc.) by adding the -f flag:

lsblk -f

Create the mount directory:

sudo mkdir /mnt/usb-drive

Mount the drive (specifically, a partition) to this directory:

sudo mount /dev/sda2 /mnt/usb-drive

Access the files:

cd /mtn/usb-drive || exit

Unmounting

sudo unmount /mnt/usb-drive

Mounting - With udisksctl

List devices (E.g., /dev/sda)

udisksctl status

Mount a block device partition:

udisksctl mount /dev/sda2

Unmount a block device partition:

udisksctl unmount /dev/sda2

Formatting

https://linuxvox.com/blog/linux-usb-stick-format/

Example of formatting a USB partition, and giving it a persistent label of SANDISK-USB, instead of whatever it was before, or a default value.

sudo mkfs.fat -F 32 /dev/sda1 -n 'SANDISK-USB'

Changing Device Label

Unmount the device:

udisksctl unmount -b /dev/sdb1

Update the label (assuming device is formatted as exFAT)

sudo tune.exfat -L 'MusicSSD' /dev/sdb

Clone this wiki locally