TL:DR I did it wrong.
Original Post:
I may be doing this wrong, but I have a USB drive that I hooked up to my dietpi system, mounted it up and then shared it with samba. My windows machine can see the drive just fine, but it shows the capacity of the SD card and not the USB drive. I.E. the drive shows 14gb free instead of the 4TB that I have on the drive.
A little more detail on how I setup the share, I created a folder in /mnt called usb-drive, and inside of usb-drive I made two more folders Share1 and Share2. I partitioned my 4tb drive in half and assigned one partiion to /mnt/usb-drive/Share1 and then the other partition to /mnt/usb-drive/Share2. Then with Samba I shared the /mnt/usb-drives folder so that I would see both partitions. I am guessing somehow I set this part up wrong and it’s seeing the share folders as just sub-folders on the SD card rather than the partitions I made on the usb HDD I have hooked up.
To be sure that it generally works to access mount points inside a Samba share, I tested it to mount an external drive into a Samba share and mount that Samba share on the same system. Probably not the best prove, but let’s say the Samba protocol itself allows it.
You mounted the two partitions first and the Samba mount afterwards, right? It did work that way on my test but could you try to umount and remount the two partitions while the Samba mount is active?
Also to rule out permission issues, could you verify that the “valid users” user has read and execute permissions to the partitions content? Execute permissions on directories are required to allow viewing the directory content list. An alternative would be to switch to valid users = root (and adjust on the mount/client side accordingly).
I guess this is all correct because the SAMBA root folder is /mnt/usb-drives. And this folder is located on SD card. So Windows is going to show the size of the SAMBA root and not of the sub folder.
Ah lol I understood that the content of the partition mounts is as well not shown, but now see that I was not reading careful enough
.
Yes that the SD card size is shown is totally correct as Joulinar said.
So I did do it wrong, is the right way to create a unique samba entry in the smb.conf for each drive/partition?
If you want to see the available space correctly, yes.
is there are a particular reason why you split your hdd into 2 partitions ? Because with your current setup, they are seen as 2 separat folders anyway and not as partitions
I set them up as two partitions because I wanted to use 2tb for backing up files/folders and the other 2tb to store media that I would then hopefully hook to to kodi, plex, or something like that. The one for back ups I would set as not browseable so that my wife doesn’t get confused on which drive to go to get movie for the kids, and I can hook up the backup share to just my main computer as it’s the only one that will use it for now.
You could use your hdd with a single partitions. Just create 2 folders and share each folder individually. The first folder is accessible for user1 only. This way you can protect the folder from your family and use it for your backups. The 2nd folder you can share with your mates and everybody can watch the movies and store own data.
I didn’t think about trying it that way, for some reason I had it stuck in my head that with samba I could only share physical partitions and not individual folders.