Is there a max NTFS disk size accessible via SAMBA

Hi, I have a 4TB Seagate drive connected to my Vero. It mounts fine and I can access it via SAMBA OK which was installed via the OSMC app store.

However, it is nearing 2TB of data and when I try to copy additional files from my Windows 8.1 PC which take it over the 2TB, I get disk full errors.

Does this mean that there is a 2TB max size or can I change some configuration parameters to make it 4TB and if yes, how.

Alternatively, if I create two partitions on the disk from Windows, will these mount independently.

How did you create the partition? Did you create a GPT table instead of an MBR?

It was created as a GUID (GPT) partition on Windows 8.1. When the drive is connected to the Windows box it sees it as 4TB OK.

Log into osmc and do a “df -h” and a “mount” to check how much is indicated to be free and how the partition is mounted.

Do you get the out of space error only if you are copying large files ?

What filesystem is your 4TB drive formatted as - NTFS ? (Edit: sorry, just noticed you said NTFS in the subject)

Check the available space on all disks and partitions with

df -h

And paste the output of this command here so we can see it.

If you’re accessing the drive via the “devices” share, there is a known issue where Samba reports the free disk space of the boot drive (usually the internal SD card ext4 partition) for all of the drives mounted at /media. (eg in the devices share)

So for example say 1.5GB was free on your SD card and you had 100GB free on the external drive, Samba reports that there is only 1.5GB free on the external drive even though it really has 100GB free.

Thus trying to copy a 2GB file would fail with a not enough space error, however you could copy five 1GB files one at a time successfully - because the reported free space would always be 1.5GB before each copy. (Since it is reporting the free space of the wrong drive, it doesn’t change)

If this is your issue we are working on a solution to that which involves automatically creating a separate share for each mounted external drive so that the reported free space for each drive is correct.

A separate issue I have noticed with sharing external exFat or FAT32 drives via Samba is that copying large files (more than a few hundred megabytes) can fail with unusual errors, at least with Windows 7 - this doesn’t happen if the drive is formatted as ext4 or NTFS.

The output of the df -h command would give us a much better idea of what is happening in your case.

df and df -h commands. It looks like it is mounted correctly. Having experimented I think that it is the SAMBA disk size issue. I have copied 9x1Gb files in groups of 4Gb and 5Gb. I then tried to copy an 8Gb file and got a space error. Is there a workaround now or is there likely to be a fix in OSMC the near future

osmc@osmc:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/root 7262040 823052 6047052 12% /
devtmpfs 380796 0 380796 0% /dev
tmpfs 512040 0 512040 0% /dev/shm
tmpfs 512040 13312 498728 3% /run
tmpfs 5120 0 5120 0% /run/lock
tmpfs 512040 0 512040 0% /sys/fs/cgroup
/dev/mmcblk0p1 244988 16920 228068 7% /boot
/dev/sda1 3907010384 754915256 3152095128 20% /media/Seagate 4TB
tmpfs 102408 0 102408 0% /run/user/1000
osmc@osmc:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 7.0G 804M 5.8G 12% /
devtmpfs 372M 0 372M 0% /dev
tmpfs 501M 0 501M 0% /dev/shm
tmpfs 501M 13M 488M 3% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 501M 0 501M 0% /sys/fs/cgroup
/dev/mmcblk0p1 240M 17M 223M 7% /boot
/dev/sda1 3.7T 720G 3.0T 20% /media/Seagate 4TB
tmpfs 101M 0 101M 0% /run/user/1000

I’ve found a workaround but to make it work I had to change the volume name on the device to remove the space. It was Seagate 4TB and it is now Seagate4TB

sudo pico /etc/samba/smb.conf

 Within the [devices] section modify path=/media to path=/media/Seagate4TB
 Save the file with ctrl+X

 restart samba

sudo service samba restart

When you look at the share you now see the top of the USB disk. Unfortunately you see the $RECYCLE.BIN and System Volume Information folders which are hidden on the disk.

It would be good however to not have to make this change.

You have 5.8GB free on your SD card, so the cut-off point where an error occurs would be about 5.8GB.

I have been developing and testing a proper solution for this where each auto-mounted external drive gets its own separate samba share automatically when connected, if you feel a little bit adventurous and would like to help test this, you can manually download and install two updated packages with the following commands:

sudo dpkg -i diskmount-osmc_1.2.4_all.deb
sudo dpkg -i smb-app-osmc_1.1.3_all.deb

Afterwards reboot. You should find that you automatically get shares named after each partition on each externally connected drive (it works with drives with more than one partition as well as one partition) and drives with spaces in the name are OK too.

This solves the incorrect reported free space as every partition will get its own share which reports the correct free space for that partition. Let me know how you get on if you try it.

BTW, I’m not sure why you are seeing the hidden recycle bin with the change you made - in theory you shouldn’t. Let me know if you also see this with my changes. (I don’t see a recycle bin)

Looking a bit further at the hidden files issue - it doesn’t appear that Samba will by default honour hidden files when a client sets a file as hidden. Furthermore an NTFS drive mounted on Linux does not expose the hidden bit of the file in a way that Samba can read it.

Therefore if you plug the NTFS drive into windows and create some hidden files (for example by using the recycle bin, which creates a hidden folder) and then plug that drive into a Linux machine and share it with Samba those hidden files will not be hidden, because the unix file system doesn’t have a standard way to report that the file is hidden. (There is no hidden attribute in unix filesystems - instead a filename starting with a dot is considered to be hidden)

As a workaround you can filter out certain names with an smb.conf option like this:

hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/

But this is only doing so by name, not by actually checking the hidden bit, and hiding files through explorer from a client connected to a share still won’t work.

I see the same issue once I created a recycle bin on a windows PC and I see the issue whether I connect via the devices share or a directly mapped share, so it’s nothing to do with your change to the path option.

Doesn’t look like there is a good solution to this I’m afraid - welcome to the world of Linux and Windows interoperability! :slight_smile:

Sorry fro the delay, bank holiday weekend and a busy week at work. I’ve applied the hide files parameter and it works a treat.

I’m giving your proper solution a go now. I now see a new share for the USB drive but I can’t access it as I get access. The error I get is that the drive is not accessible, you might not have permission to use the network resource. The other shares seem to have gone.

Did you authenticate as osmc/osmc for the username and password ?

The automatically added shares are set to read/write access for the osmc user and no access for anyone else. (Including guest)

If you’re accessing the share from Windows you might need to go into Control Panel -> Credential Manager, then remove the saved credentials for OSMC under Windows credentials.

Then next time you try to go to the share it should prompt you for a username/password, choose osmc/osmc and save them.

I have already cleared the saved user credentials. When I go to the server itself, I see the new drive share, I get the authentication error when I try to get into it… I’m a bit surprised that I don’t see the osmc or devices shares any more as osmc is in the smb.conf file and devices is in smb-shares.conf.

Something not right there. You should still be seeing the osmc share.

Are you sure you don’t have multiple OSMC devices on the same network with the same network name ?

Just the one. I’ve accessed it via IP address and host name just to be sure that their is nothing funny going on at the network level.

Can you try resetting the samba password for the OSMC user like so:

sudo smbpasswd -a osmc

It will prompt you to enter a new password - try entering osmc to set it back to the original password.

Keep in mind that the samba login for the osmc user has a separate password than the osmc login for ssh/ftp - they aren’t kept synchronised even though they both default to the same password on a new install.

No joy on the smb password reset. Interestingly, the first time I access the server using \osmc I get asked for the username and password which is successful. I then see the share but get asked for the credentials again and it is these that fail.

What name should have a Samba Share Credential in the Credential Manager?

I wanted to access to the Shares with a different user, so tried to delete the credential. But haven’t been able to find which one. Neither in Windows Credentials nor in Web Credentials.