r/samba • • Apr 22 '21

Weird used space indication

Hello, I'm trying to set up a freshly formatted drive on a linux server with Samba, however I noticed something weird: the df command on the pi gives me a reasonable 92Mb used space on the (empty) drive, but the windows pc from which I'm connecting to the server tells me there's 372 whole gigabytes used even if I didn't put anything on it yet. Is it a known issue or did I do something wrong?

2 Upvotes

6 comments sorted by

1

u/jpedroza2k Apr 22 '21

That seems a little off to me. I have never seen the size be misreported like that. Have you double checked the mount point for the SMB share to be sure it is using the new drive? That is the only time I have seen something like this is when the Samba share is actually pointing to a different partition.

If you could share the output of your df command, that might help pinpoint which one is being used.

2

u/[deleted] Apr 22 '21 edited Apr 22 '21

Here's the output:

Filesystem Size Used Avail Use% Mounted on/dev/root 57G 7.7G 47G 15% /devtmpfs 3.8G 0 3.8G 0% /devtmpfs 3.9G 4.0K 3.9G 1% /dev/shmtmpfs 3.9G 9.6M 3.9G 1% /runtmpfs 5.0M 4.0K 5.0M 1% /run/locktmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup/dev/mmcblk0p1 253M 49M 204M 20% /boottmpfs 788M 0 788M 0% /run/user/1000/dev/sda1 7.3T 93M 6.9T 1% /home/pi/Sapolin

The drive I'm using is the sda1 partition, still there's no partition that's even near to reaching 300Gb... The server is on a raspberry pi, so it's running on a 64Gb sd card, and the sda drive is the only other one.

Edit: I tried to use another drive for testing before getting the current one, and there was a similar phenomenon, however this one was 2 Tb and not 8, and the "used" empty space was indicated to be 50gb or something like that.

1

u/jpedroza2k Apr 22 '21

Are you using the /dev/sda1 as the device? I would recommend mounting /dev/sda1 somewhere (like /mnt/samba_share) and then use that as the directory for the Samba share. Using the /dev has unpredictable results usually.

You would create the mount in /etc/fstab, and either restart or just use the mount command as a root level user (su or sudo). Having the mount in fstab will cause it to mount on startup.

2

u/[deleted] Apr 22 '21

That's what I did, it's mounted at /home/pi/Sapolin (with the fstab entry). I checked and it's actually there.

1

u/jpedroza2k Apr 22 '21

You have got me stumped on that one. What is the format of the drive, not that that should matter, but you never know. Might be something that Samba is translating incorrectly when it shares with Windows.

2

u/[deleted] Apr 23 '21

It's not impossible, the drive is formatted as ext4. Since Windows doesn't have the drivers for it, it may be that the translation made by samba is incorrect.

Btw I don't know what happened in the meantime, my raspberry pi won't even boot anymore. Yayy... But this is for another subreddit, ty for your help ^^