【树莓派--教程】挂载移动硬盘并设置共享文件夹

fdisk -l
apt-get install ntfs-3g
mkdir -p /share/disk1
chown pi.pi /share/disk1
mount -t auto /dev/sda1 /share/disk1
echo "/dev/sda1   /share/disk1    ntfs    defaults    0    0">>/etc/fstab
chmod 777 /share/disk1
apt-get install samba samba-common-bin
echo "security = user" >>/etc/samba/smb.conf
echo "[disk1]" >>/etc/samba/smb.conf
echo "path = /share/disk1" >>/etc/samba/smb.conf
echo "valid users = @users" >>/etc/samba/smb.conf
echo "force group = users" >>/etc/samba/smb.conf
echo "create mask = 0660" >>/etc/samba/smb.conf
echo "directory mask = 0771" >>/etc/samba/smb.conf
echo "read only = no" >>/etc/samba/smb.conf
/etc/init.d/samba restart
smbpasswd -a pi
echo "sudo /etc/init.d/samba restart">>/etc/rc.local

你可能感兴趣的:(linux)