User avatar
misho.petrov
Posts: 52
Joined: Mon Oct 21, 2013 8:52 pm

Workaround for file size

Wed Oct 06, 2021 12:46 pm

Hello,

I have made a simple DLNA home server from an old RPi2 with 8 GB card and an external 500 GB USB hard drive. It has only basic (console only) version of raspbian with pi's password changed, samba and minidlna installed. Everything works fine and I'm able to watch it directly on TV. But the problem is that Samba does not allow me to upload big files or a batch of "smaller" files (for example 12x2 GB) to the mounted hard drive. The hard drive itself is mounted as a folder at home directory. The free space left on the card is 5.2 GB. Is there any workaround for this "limitation"?
Thank You.
1. RPi2 DLNA server.
2. Pokodi (Pocket Kodi) - https://pin.it/35G6aTQ
3. PiDA - https://pin.it/2cDbx0V

User avatar
thagrol
Posts: 5839
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Workaround for file size

Wed Oct 06, 2021 2:22 pm

What file system has the USB drive been formatted with?

Is your share pointing to a directory on he SD card that contains the mount point, the mount point, or a directory on the drive below the mount point?

How are you mounting the drive and with what options?

See here too: https://www.samba.org/samba/docs/curren ... REECOMMAND
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

User avatar
misho.petrov
Posts: 52
Joined: Mon Oct 21, 2013 8:52 pm

Re: Workaround for file size

Wed Oct 06, 2021 6:31 pm

Thanks for the reply.

The filesystem on hdd is NTFS. It has 2 partitions formatted as such, but I'm using only one of them (435 GB).

The partition is mounted by adding the following line to rc.local:

Code: Select all

sudo mount /dev/sda5 /home/pi/hdd/
The share is accessed from Win10 machine by

Code: Select all

run -> \\ras.pi.ip.add
and then providing username and password.

Currently the storage space on both points is as follows:

Code: Select all

Main storage size is 7.1G
Free space on the main storage is 5.2G

Media 1 storage size is 436G
Media 1 free space is 298G
(I have my own script)
1. RPi2 DLNA server.
2. Pokodi (Pocket Kodi) - https://pin.it/35G6aTQ
3. PiDA - https://pin.it/2cDbx0V

User avatar
thagrol
Posts: 5839
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Workaround for file size

Wed Oct 06, 2021 6:43 pm

You should probably switch to using /etc/fstab rather than rc.local. See my guide in the beginners section.

Are you certain the mount worked? You can check with the mountpoint command.

Please answer my second question.

Lastly please post the output of
testparm -s
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

User avatar
misho.petrov
Posts: 52
Joined: Mon Oct 21, 2013 8:52 pm

Re: Workaround for file size

Wed Oct 06, 2021 6:51 pm

Yes. I'm sure the mount points have worked and are working, as we speak. The point is that if I drag&drop 12 episodes of 2 gigs each, samba reports something like "not enough free space on pi". But if I drag&drop them one by one by creating a multi copy scenario, everything works without such warnings and the files are being copied successfully.

the output of

Code: Select all

testparm -s
is

Code: Select all

rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
        log file = /var/log/samba/log.%m
        logging = file
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:                                                                * %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        server role = standalone server
        unix password sync = Yes
        usershare allow guests = Yes
        idmap config * : backend = tdb


[homes]
        browseable = No
        comment = Home Directories
        create mask = 0700
        directory mask = 0700
        read only = No
        valid users = %S


[printers]
        browseable = No
        comment = All Printers
        create mask = 0700
        path = /var/spool/samba
        printable = Yes


[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
1. RPi2 DLNA server.
2. Pokodi (Pocket Kodi) - https://pin.it/35G6aTQ
3. PiDA - https://pin.it/2cDbx0V

User avatar
thagrol
Posts: 5839
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Workaround for file size

Wed Oct 06, 2021 9:44 pm

misho.petrov wrote:
Wed Oct 06, 2021 6:51 pm
Yes. I'm sure the mount points have worked and are working, as we speak. The point is that if I drag&drop 12 episodes of 2 gigs each, samba reports something like "not enough free space on pi". But if I drag&drop them one by one by creating a multi copy scenario, everything works without such warnings and the files are being copied successfully.
I think that's new information. Knowing that earlier would have helped.
the output of

Code: Select all

testparm -s
is

Code: Select all

rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
        log file = /var/log/samba/log.%m
        logging = file
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:                                                                * %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        server role = standalone server
        unix password sync = Yes
        usershare allow guests = Yes
        idmap config * : backend = tdb


[homes]
        browseable = No
        comment = Home Directories
        create mask = 0700
        directory mask = 0700
        read only = No
        valid users = %S


[printers]
        browseable = No
        comment = All Printers
        create mask = 0700
        path = /var/spool/samba
        printable = Yes


[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
OK. If you'd answered my second question here earlier I would have given you the solution earlier.

From testparm, you appear to be relying on the [homes] share then writing to a directory under it which happens to be a mount point.

This confuses samba. The shared directory is on the SD card so the free space samba sees and reports to clients is that of the SD card not that of the mounted drive. Files and groups of files, whit a total size less than that will copy. Ones bigger will not, regardless of how much free space there is on the mounted drive.

The solution? Either add a new share starting at the mount point and write to that or investigate the dfree parameter I linked to earlier. The former is probably the easier option.
I'm a volunteer. Take me for granted or abuse my support and I will walk away

All advice given is based on my experience. it worked for me, it may not work for you.
Need help? https://github.com/thagrol/Guides

User avatar
misho.petrov
Posts: 52
Joined: Mon Oct 21, 2013 8:52 pm

Re: Workaround for file size

Thu Oct 07, 2021 8:34 am

I made it. Thank you for the guiding tips. It was simply a matter of adding an additional share exclusively for the external drive. Now it accepts any filesize within the hdd free space limits. The only downside is that the same share appears twice - once on itself and once inside the home folder, but it is not a big deal. And I have "migrated" from rc.local to fstab.
1. RPi2 DLNA server.
2. Pokodi (Pocket Kodi) - https://pin.it/35G6aTQ
3. PiDA - https://pin.it/2cDbx0V

Return to “Media centres”