After another reboot of the "raspberry", the USB-to-SATA controller suddenly died, I had to change the "box" and for an unprecedented reason, the disk settings were reset.
Once again I was looking for recipes on the Internet and after spending enough time, I decided that I needed to make a note on hand. It's simple, but when you do it once every five years, you have to remember which commands, where and why.
And so there are several steps:
- Getting data about a connected disk
- Setting up Auto Mount
- Configuring Samba Balls
And so let's go, I'll be succinctly brief as before:
- Getting data about a connected disk
To find out the data about the connected disk, run the command:
sudo blkid
and we see the result and the disk ID is important to us:
/dev/sda1: LABEL="data" UUID="8A8A7B898A7B7095" TYPE="ntfs" PARTUUID="da8c9ec1-01"
I have one disk with NTFS so I don't have to bother with disk identification
- Setting up Auto Mount
Now we need to open fstab and enter the data for auto-mounting
sudo nano /etc/fstab
adding the auto mount line
UUID=8A8A7B898A7B7095 /mnt/data ntfs auto,exec,rw,user,dmask=002,fmask=113,uid=1000,gid=1000,nofail 0 0
where, /mnt/data , is the place where we mounted the disk
then we reboot.
And we check that we have a disk on the way of mounting, if not, then we do
sudo mount -a
- Configuring Samba
Now you need to edit the file to access the resource over the network
nano /etc/samba/smb-shares.conf
we add data on the disk to the end of the file:
[data]
path = /mnt/data/
writeable = yes
read only = no
browseable = yes
where, /mnt/data/ , is the previously specified path of the mount point. Then we overload and go to the disk over the network.
Additionally, I still password-locked the entrance in principle. This greatly restricts its use as a media source, but it has long been just a file storage and media center for my TV.