![]() Now for each device you registered, add the following line to the bottom of the fstab file. To make the storage device mount automatically during startup, we must edit the fstab file: sudo nano /etc/fstab Sudo chmod -R ug=rwx,o=rx /home/shares/public/disk1įinally, mount the device on the folder: sudo mount /dev/sda1 /home/shares/public/disk1 Mount the Devices When Starting the Raspberry Pi Sudo chown -R root:users /home/shares/public/disk1 Next, create a directory, change the owner, and change the read, write, and execute permissions just how we did with the Raspberry Pi’s main microSD card: sudo mkdir /home/shares/public/disk1 If it isn’t, you can format it using the command below: umount /dev/sda1 You must format your device with a Linux file system, such as ext3 or ext4. If you’re connecting the first storage device, the name should be sda1. Then, identify the name of the storage device by entering the following command in the terminal: dmesg You can add multiple storage devices to a Raspberry Pi NAS, but it is best to configure things one by one to simplify the procedure.įirst, connect your storage device to the Raspberry Pi. Now we need to mount the USB flash drive or external storage drive on the Raspberry Pi. Otherwise, you can enter the line below to add user “pi” and assign a password manually: sudo smbpasswd -a pi Mount the Storage DeviceĪt this point, you can already access all of the Raspberry Pi’s memory with any connected device in your network. It will ask for your SMB password for client authentication. There should be a GUI that pops up after restarting the Samba service. Restart the Samba service to enable the changes: sudo /etc/init.d/smbd restart ![]() This will allow you to write files to your NAS so that you can send and save files to it: read only = noįinally, add the public parameters below. It’s under the Share Definitions section. In the Samba configuration file, press CTRL + W and search for “Authentication”: # Authentication # You can limit the connections to your NAS by adding authentication. Then, edit the configuration file using the nano text editor: sudo nano /etc/samba/smb.conf To install Samba on your Raspberry Pi, enter the command below: sudo apt install samba samba-common-bin Moreover, the current version of Samba offers interoperability between Windows and Linux systems and any other popular operating system or computer connected to the network. With Samba, Windows computers can read, write, or execute files without knowing it is from a Linux host. It was created to allow Windows clients access to a Linux host’s file and print services. Samba is an open-source re-implementation of SMB (Server Message Block), a network protocol originally used between a Microsoft client and server. Now that we’ve finished setting up the Raspberry Pi as a NAS server let’s work on installing the NAS software itself. Sudo chmod -R ug=rwx,o=rx /home/shares/public Sudo chown -R root:users /home/shares/public Finally, allow read, write, and execute permissions on the current user and group while read and execute only for others: sudo mkdir /home/shares Then change the public folder’s owner to root and the group to the current user. Setting up the Raspberry PiĪs always, first update your Raspberry Pi OS to the newest version: sudo apt updateĪfter the update is complete, create the public and private folders accessible with the NAS. I recommend using a USB flash drive or an external hard drive. ![]() The Raspberry Pi’s onboard microSD card just won’t cut it. The first thing you need when building a Raspberry Pi NAS from scratch is the storage device. ![]() In this article, we will configure the Raspberry Pi and an external storage device to operate as a NAS on private network. A NAS can also be cheaper than a cloud service, and it’s easy to add more storage as needed. Why not just use a cloud service? Most importantly, the NAS is hosted on your own network so it is completely private. ![]()
0 Comments
Leave a Reply. |