1

I'm connecting a HDD to the pi to share in my network. I setup SAMBA as directed, install ntfs-3g (my HDD is NTFS), then set specific UUID in /etc/fstab to the mountpoint located on my pi:

UUID=XXXXXXXXXXXXXXXXX /home/pi/share/A ntfs nofail,uid=pi,gid=pi 0 0

where share and A both are chmod 777

Everything works, except when I transfer a file that exceed the size of the SD card that the pi runs off, i.e.8GB card will have ~4GB limit (4 goes to system files) or 16GB card will have around 12GB limit (again 4GB is system file).

Any idea how to resolve that limitation?

Output of df -h:

pi@TestPi:~ $ df -h /home/pi/PiMedia/A
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 1.4T 692G 706G 50% /home/pi/PiMedia/A

Output of sudo fdisk -l /dev/sda1:

pi@TestPi:~ $ sudo fdisk -l /dev/sda1
Disk /dev/sda1: 1.4 TiB, 1500299395072 bytes, 2930272256 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6e697373

Device Boot Start End Sectors Size Id Type
/dev/sda1p1 1936269394 3772285809 1836016416 875.5G 4f QNX4.x 3rd part
/dev/sda1p2 1917848077 2462285169 544437093 259.6G 73 unknown
/dev/sda1p3 1818575915 2362751050 544175136 259.5G 2b unknown
/dev/sda1p4 2844524554 2844579527 54974 26.9M 61 SpeedStor

Partition table entries are not in disk order.

Output of sudo fdisk -l /dev/sda:

pi@TestPi:~ $ sudo fdisk -l /dev/sda
Disk /dev/sda: 1.4 TiB, 1500301910016 bytes, 2930277168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x29cc0ff5

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2930274303 2930272256 1.4T 7 HPFS/NTFS/exFAT

SOLUTION:

Summary - I created multiple folders (in one directory) to mount multiple drives for sharing. However, when sharing, I shared the one root directory of those multiple folders/mounted drives. This creates a problem where the OS sees that root directory belonging to the pi and inherits the file size limitation based on the SD card size.

e.g. fstab mount drive usb1 --> /share/USB1; samba --> /share/USB1 ----- WORKS; no size limit

but: fstab mount drive usb1 --> /share/USB1; samba --> /share ---- file size limitation exists

To fix this, you can mount and shared individual drives. But this would create multiple shared points on your network.

Or the better solution: You can spoof SAMBA check for system space. Where SAMBA share will report a higher value than the actual space that is on the SD card.

edit smb.conf with

[global]
dfree command = /usr/local/bin/dfree

then edit dfree with

#!/bin/sh
df $1 | tail -1 | awk '{print 50000000" "50000000}'

Remember to give dfree permission.

This will trick SAMBA into thinking root directory has 50TB limit, thus removing the file size transfer limitation.

  • Comments are not for extended discussion; this conversation has been moved to chat. Mathnerd18, please feel free to include additional information - as requested in the comments / now chat - into the question. If - for whatever reason - you are not able to join the chat, give me a note. Thanks. – Ghanima Jan 5 at 11:27

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.