Useful commands on Raspberry Pi

In this post I’ll gather all useful commands that I used during my experiments with RPi


Lists all attached bulk storage devices


List all drives by uuid

ls -l /dev/disk/by-uuid/

Mount drive

sudo mount -o uid=pi,gid=pi /dev/sda1 /media/usb 

you have to use uid and gid in order to delete add new devices.

Automount drive at start-up

sudo nano /etc/fstab

and add

UUID=18A9-9943 /media/usb vfat auto,nofail,noatime,users,rw 0 0

The “nofail” option allows the boot process to proceed if the drive is not plugged in. The “noatime” option stops the file access time being updated every time a file is read from the USB stick. This helps improve performance.

Check free SD card space (source)

df -Bm


How To Mount A USB Flash Disk On The Raspberry Pi