![]() ![]() We could also have used directly the device path, like /dev/sda1 however that path may change in case you connect a different device and it is detected first, causing the wrong partition to get mounted. In our case we chose to use UUID because it more reliable. The first column contains identity of the device/partition. Here is the explanation of what these fstab entries do, Make sure you replace my UUID with the UUIDs in the output from Step 4. This is where the magic happens.Įdit /etc/fstab file and add the following lines towards the end of the file, be careful about the white space. Step 5: Create fstab entry for the partitions. Sda1 and sda2 in the above output are the partitions from the external USB drive, and we can see the UUID and FSTYPE columns in the output for UUID and file system type respectively, note these down because you will need them in the next step. NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT To figure out UUID of your partitions, use the lsblk utility, $ lsblk -f Raspberry Pi must know unique identifiers of your partitions to be able to mount them whenever it sees them. Step 4: Figure out UUID and file system type of the partitions. Before moving to the next step, it is necessary that you have already connected the drive that you want to share over network. $ sudo chmod -R 777 /mnt/hdd01/ĭrwxrwxrwx 2 root root 4096 Nov 7 16:13 vol1ĭrwxrwxrwx 2 root root 4096 Nov 7 16:13 vol2 Run this command to recursively set permission 777 for both the folders under “hdd01” and “hdd01” itself. To keep things simple, I will be giving 777 permission so that everybody can access and write to these partitions. Step 2: Set required permissions for the mount point. Verify that the mount points are actually created $ ls -l /mnt/hdd01ĭrwxr-xr-x 2 root root 4096 Nov 7 16:13 vol1ĭrwxr-xr-x 2 root root 4096 Nov 7 16:13 vol2 To create all the two mount points using a single command, enter the following on your Raspberry Pi terminal sudo mkdir /mnt/hdd01/ -p We will create two mount points for the two partitions – /mnt/hdd01/vol1 and /mnt/hdd01/vol2 for the purpose of this article I am putting the two partitions under “hdd01” folder, but you may not do this and can create the mount points directly under /mnt I am going to assume your externally connected drive has two partitions. ![]() You don’t need to do this if you are sharing a local folder from your Raspberry Pi/SBC device. This step is needed so that whenever you reboot your Pi, the partitions from the external USB drive are automatically mounted. In this post I will cover how to permanently mount external disk partition on your Raspberry Pi so that they are auto-mounted when you boot up your Pi, I will also cover how to setup Samba server and how to actually make it work with Windows 10/11 (it doesn’t out of box). While that may work for a lot of people, I felt my Pi would be underutilized, I also wanted to run other services on my RPi and SSH/VNC into it while still being able to share my external USB drive over network.Įnter Samba server – Samba enables you to share local printer and files over network using SMB/CIFS protocol – that basically means you can access any partition or directory from your Raspberry Pi over your Linux, Windows, Mac OS and iOS devices – which is basically what you want in this case. While setting up a NAS server over your Raspberry Pi (or any other SBC) sounds cool, it typically requires flashing a completely specialized distribution on Raspberry Pi. I wanted to share this drive and its content over the home network and the most recommended and obvious solution was to set up a dedicated NAS server. I had a spare 2.5″ spinning hard drive lying around with USB to SATA adapter.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |