hosea1008
7/20/2019 - 10:01 AM

树莓派自动挂载ext4格式U盘

Found the UUID of your USB drive by:

sudo blkid

Add a new line in /etc/fstab like:

UUID=93ddc2e0-48e1-457c-9d59-f6a34596e6e1 /media/SSD-120GB ext4 defaults,nofail 0 0
  • Use UUID rather than the device node (/dev/sda1) as the device node can change across reboots especially if drives are added or removed.
  • Include "nofail" in the mount options to prevent the Pi hanging if it is booted without the drive attached.

Save and close /etc/fstab

Connect the HDD and reboot