raspberry pi mount a usb drive tutorial

# fdisk is a tool to manage disks on Linux
# this will display all disks
# At the end of the displaying lines, you will see your usb drive, check the filesystem, device name, and the size
sudo fdisk -l

# df stands for “disk-free”, and is typically used to show the available disk space for file systems, but it also displays the name of the filesystem
sudo df -h

# check where your drive has been mounted
# Any USB drives are typically at the bottom of the output
sudo cat /proc/mounts

# When you format a disk, the system assign an ID to the disk
# We call this the UUID. This allows us to know this a known drive and do something specific when you plug it on your Raspberry Pi
# To get this UUID, run this command:
sudo ls -l /dev/disk/by-uuid/

# Run the following command to retrieve information about your drive
sudo blkid /dev/sda1

# Now since the Pi will likely have automatically mounted the drive, we will need to unmount the drive
sudo umount /dev/sda1

# Once the drive has been umounted, we can now go ahead and mount it again
sudo mount -o umask=0022,gid=pi,uid=pi /dev/sda1 /mnt/usb

# check it
ls -al /mnt/usb

How to mount a USB drive on the Raspberry Pi?
Raspberry Pi Mount a USB Drive Tutorial


EOF

posted on 2022-09-18 14:43  明天有风吹  阅读(22)  评论(0编辑  收藏  举报

导航

+V atob('d2h5X251bGw=')

请备注:from博客园