Community discussions

MikroTik App
 
talkohn
just joined
Topic Author
Posts: 3
Joined: Thu Sep 16, 2021 1:47 pm

SMB Share reporting incorrect available space

Wed Sep 29, 2021 1:35 am

Hi,
using rb5009 with ROS 7.1rc4
An ext3 formatted 32GB USB Drive connected - when accessing the share from Windows + Ubuntu it is reported as a 1GB drive.
I've copied a few files over and checked the drive locally, files are written to it (Router's NAND is not mistakenly used)

I'm suspecting that the free space reported IS the free space of the router itself since it's storage size is 1GB, but yet the data is written to the correct place anyway.

Any ideas apart from the hate for SMB? :-)
 
aclarke
just joined
Posts: 12
Joined: Tue May 13, 2014 12:47 am

Re: SMB Share reporting incorrect available space

Fri Nov 12, 2021 4:25 am

I received my new MikroTik RB5009 yesterday with v7.0.5 firmware. I used a Linux Mint computer to format (ext3) a brand new 1TB Crucial SATA SSD drive then I plugged it into the MikroTik's USB 3.0 port using a SATA-to-USB 3.0 adapter. I successfully configured the drive to be shared via SMB and was able to copy files to it from a Windows 10 file manager (explorer.exe) and using (\\ip-address\sharename). I experienced some very strange phenomena. After copying about 1 GB files to it, I tried to copy a single 450MB file to it and got a message saying, "There is not enough space on share1. You need an additional 331 MB to copy these files." So I tried to copy a 104MB file to it and succeeded. Then I tried to copy a 450MB file and it too succeeded!! I continued to copy some more files then I got the message that there wasn't enough space when trying to copy a 122KB file. So I copied (8) 1KB files successfully then I followed that with a 122KB file and it copied successfully!! To make a long story short, I succeeded in copying some additional 450MB files then I hit the roadblock saying there wasn't enough disk space. The drive currently has 11.8GB of files on it. So it behaves as if there is some daemon running in the background that causes the drive's free space to fluctuate. I just now deleted all of the 11.8GB of files then succeeded in copying 3.7GB of files back before getting a message that I didn't have enough space when trying to copy a 145GB file. Rebooting the router didn't improve anything but I was able to copy another 450MB file by dragging it from my Desktop to the file folder inside Winbox. After this I tried to copy a 800MB file using \\ip-address\sharename but it stopped midway through and the router locked up requiring me to reboot it by disconnecting the power plug.
 
aclarke
just joined
Posts: 12
Joined: Tue May 13, 2014 12:47 am

Re: SMB Share reporting incorrect available space

Fri Nov 12, 2021 6:45 am

I upgraded my RB5009 to v7.1rc6 and still have the same copying to USB drive problems mentioned in the previous post.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: SMB Share reporting incorrect available space

Fri Nov 12, 2021 12:28 pm

What does internet explorer report as capacity/free space of share when you try to copy largeish file and fail? If the free space shown corresponds to the message about missing space, then it would seem like SMB service, running in ROS, somehow rolls over at 1GB (which is 2 to the power of 30) and reports low number to client ... which should be fixed of course.
 
aclarke
just joined
Posts: 12
Joined: Tue May 13, 2014 12:47 am

Re: SMB Share reporting incorrect available space

Fri Nov 12, 2021 4:15 pm

What does internet explorer report as capacity/free space of share when you try to copy largeish file and fail? If the free space shown corresponds to the message about missing space, then it would seem like SMB service, running in ROS, somehow rolls over at 1GB (which is 2 to the power of 30) and reports low number to client ... which should be fixed of course.

Thanks mkx. Your response was very helpful. Assuming that by "internet explorer" you mean "Windows Explorer" which is the file manager and not the web browser, it is reporting 531MB free space of 1.4GB total size which is strange because the drive is a 500GB USB. I had to map the MikroTik shared drive in Windows before it showed up in Windows 10 as follows:

Image

The USB drive is different than the earlier one as I wanted to make sure that the problem wasn't related to a defective drive. It is a 500GB Western Digital PCIe SSD mounted inside a Thunderbolt 3 / USB 3.1 Gen 2 case:

WD_BLACK 500GB SN750 NVMe Internal Gaming SSD Solid State Drive - Gen3 PCIe, M.2 2280, 3D NAND, Up to 3,430 MB/s - WDS500G3X0C
https://www.amazon.com/gp/product/B07MH2P5ZD

Plugable USB C to M.2 NVMe Tool-free Enclosure USB C and Thunderbolt 3 Compatible up to USB 3.1 Gen 2 Speeds (10Gbps).
https://www.amazon.com/gp/product/B07N48N5GR

So I'm not suspecting any problems with the drive since I'm experiencing the exact same problems with it as with the one I described in my earlier post. When I copied the 882MB file to it, the transfer speed that Windows reported was 80MB/sec which is very fast and shows that MikroTik's RB5009 USB 3.0 port is an improvement over their USB 2.0 ports. I formatted the drive using Linux gparted and selected msdos for partition table type and ext3 for file system type.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: SMB Share reporting incorrect available space

Fri Nov 12, 2021 4:50 pm

Right, I meant windows explorer. Sorry for confusion.

So your test confirms my guess that SMB service in ROS wrongly reports file system size (and amount of free space).

It's hard to do exact calculations ... however SDD producers tend to use decimal unit prefixes (i.e. 500GB is 500*10^9 bytes) while most (if not all) SW tools still use binary unit prefixes (1GB = 2^30 bytes). New standards avoid confusion by specifying that binary prefixes should include "i" ... i.e. 500 GiB. Not many software products follow the standard sadly.

Which means 500GB disk usually shows as 465GiB disk (and slightly less after it's formatted). Now if we assume integer wrap-around (2^32), such file system would show as 1.7GiB large file system. If you would manage to push slightly more than 1.7GiB worth of files, it would show free space of around 4 GiB ... which would mighty upset any software comparing full size and free space as free space (4GiB) would exceed full size (1.7GiB).
 
aclarke
just joined
Posts: 12
Joined: Tue May 13, 2014 12:47 am

Re: SMB Share reporting incorrect available space

Sat Nov 13, 2021 11:53 pm

I tried copying a 3.9GB file from Linux Mint v20.2 to MikroTik's RB5009 shared USB drive, and like Windows 10, I got the same warning that insufficient drive space was available even though the 500GB USB drive had nothing on it. But unlike Windows 10, Linux gave me the option of copying the file anyway and I was able to do so with no problem:

Image

Then I found this webpage which explained everything perfectly:

https://superuser.com/questions/1423396 ... ectly-bene

If MikroTik could implement something similar to that described above, copying a large file to a shared USB drive on a MikroTik router could be accomplished without having to modify one's operating system.
 
aclarke
just joined
Posts: 12
Joined: Tue May 13, 2014 12:47 am

Re: SMB Share reporting incorrect available space

Wed Jan 05, 2022 3:29 am

I contacted MikroTik directly on the above problem and received the following email:

Date: 12-21-2021
From: Oskars K. (Jira) <support@mikrotik.com>
Subject: MikroTik support #[SUP-67805]: 64GB USB drive share on RB5009 reports only 2.3GB free space

Hello,

Thank you for the report!

We look forward to fixing it on upcoming RouterOS versions, unfortunately, I cannot provide an ETA now.

Best regards,
Oskars K.
 
talkohn
just joined
Topic Author
Posts: 3
Joined: Thu Sep 16, 2021 1:47 pm

Re: SMB Share reporting incorrect available space

Fri Jan 28, 2022 7:53 pm

--UPDATE--

Looks like the space issue is fixed with version 7.2rc3 !!

Who is online

Users browsing this forum: No registered users and 14 guests