Mount a mobile hard drive or USB flash drive to the Raspberry Pi
- When an external U disk or mobile hard disk is connected, it will not be automatically mounted by default, so you need to mount it with the mount command. Usually we create a new directory under the /mnt or /media directory as the mount point.
sudo mkdir /mnt/500G_move_disk
sudo mount -o uid=pi,gid=pi /dev/sda1 /mnt/500G_move_disk
# 卸载
sudo umount /mnt/500G_move_disk
- Mount the hard drive
- Mounting the hard disk in NTFS format (mounting in read-write mode)
By default, mounting the hard disk in NTFS format only has read-only permission, which requires the help of other tools.
#安装所需软件包
sudo apt-get install fuse-utils ntfs-3g
#加载内核模块
modprobe fuse
#编辑fstab让移动硬盘开机自动挂载
sudo nano /etc/fstab
#在最后一行添加如下内容
/dev/sda1 /mnt/myusbdrive ntfs-3g defaults,noexec,umask=0000 0 0
#保存重启,即可生效
sudo reboot
- Mount FAT32 formatted hard disk
#创建挂载点
sudo mkdir /mnt/myusbdrive
#编辑fstab让移动硬盘开机自动挂载
sudo nano /etc/fstab
#在最后一行添加如下内容
/dev/sda1 /mnt/myusbdrive auto defaults,noexec,umask=0000 0 0
#保存重启,即可生效
sudo reboot
– To be continued
Reference