Skip to content

Instantly share code, notes, and snippets.

@jmorenoamor
Last active March 5, 2023 10:20
Show Gist options
  • Save jmorenoamor/063573ef14ed963db013e0bfe241c375 to your computer and use it in GitHub Desktop.
Save jmorenoamor/063573ef14ed963db013e0bfe241c375 to your computer and use it in GitHub Desktop.
Linux drive management

Linux drive management

Show devices

sudo lsblk -f
sudo blkid
sudo blkid
/dev/nvme0n1p3: UUID="lZpnDq-ptqw-e5pN-MgOz-xohK-pXK8-8Qvh3q" TYPE="LVM2_member" PARTUUID="489187e9-518c-414b-bbc6-cb63daad7cb9"
/dev/nvme0n1p1: UUID="B7BB-3858" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="42073e97-6cf8-4524-abde-d9e33ad708a6"
/dev/nvme0n1p2: UUID="a578d41c-9199-43c5-b327-4637f2d7f969" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="3a312550-4ee9-4dbe-a0bd-4f3bccd53193"
/dev/sdb1: LABEL="HDD1" UUID="724B-28C1" BLOCK_SIZE="512" TYPE="exfat" PARTLABEL="My Book" PARTUUID="b298b2f9-5700-4352-a533-816f636b1191"
/dev/mapper/ubuntu--vg-ubuntu--lv: UUID="35280470-596e-4610-bdd2-61ae88d9d490" BLOCK_SIZE="4096" TYPE="ext4"
/dev/sda: UUID="b9573ae9-8390-45e4-a14c-3cff7cbfc7a0" BLOCK_SIZE="4096" TYPE="ext4"

exFAT

exfat-utils has been replaced by exfatprogs (tools to create, check and label exFAT filesystems) in Ubuntu 22.04 and later.

sudo apt install exfat-fuse exfat-utils
sudo apt install exfatprogs

Mount from fstab

UUID=<UUID of the drive>   <mount point>   <drive format>   defaults,noatime,nofail  0  1

Change drive permissions

sudo chmod -R 777 /mnt/exHDD
sudo chown -R pi:pi /mnt/exHDD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment