Community discussions

MikroTik App
 
User avatar
normis
MikroTik Support
MikroTik Support
Topic Author
Posts: 26977
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

New exciting features for storage

Fri Feb 07, 2025 8:26 am

Those of you who are testing 7.18 might have noticed, but most of you probably did not notice yet.
There are plenty of new features in one specific category - storage.

Those of you with devices that support any kind of external storage, like the RB1100, X86, CHR systems or even devices with USB hubs with external drives attached, it would be great if you could test things like:

In default package: https://help.mikrotik.com/docs/spaces/R ... 3346/Disks
- Disk formatting and partitions
- Storage on RAM (tmpFS) when you don't have storage space, but have free RAM
- Swap
- Mount file as block device

In ROSE package https://help.mikrotik.com/docs/spaces/R ... SE-storage
- RAMdisk (slightly different from tmpFS)
- Mounting SMB or NFS onto your router from some NAS and storing files there
- RAID

- BtrFS https://help.mikrotik.com/docs/spaces/R ... 9711/Btrfs

and more

Why are all these features there? Well, soon you will find out, but if you can test some of them, that would help, thanks
 
teslasystems
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Aug 09, 2015 3:00 pm

Re: New exciting features for storage

Fri Feb 07, 2025 10:45 am

I want to share my feedback about SMB client (/disk add type=smb ...) and about working with large amount of files.

After connecting a new SMB share with about 50 files, a file tree is loaded pretty quickly, all files are visible in WinBox, but then RouterOS starts doing something weird. It creates a huge load on a network and eats a lot of traffic from SMB server. Within about 30 minutes it has downloaded about 4.5 GB of traffic from the server. And this never stops until you dismount your SMB disk. What the hell is it doing? (TILE, 7.18beta4)
On the Dude graph it looks like this:
.
SMB_traffic.png
--------------------------------------------------------------------------------------------------------------------------------------------------

Regarding woking with large amount of files, I often hear that you are improving the behavior for this scenario. But it will never work normally with large amount of files in current implementation. The reason is simple: RouterOS scans a whole file structure completely. If you have 10K files, 100K files, it will uselessly scan all these thousands of files, creating an unneeded load on network and server. And this process will begin over and over again after each reboot.

To work with large amount of files, file management mechanism should be completely revised:

1. RouterOS should never scan a whole file structure, only content of root directories on the disks.
2. In WinBox, 'File List' should be replaced by 'File Browser' with ability to navigate between directories like it's done in any OS.
3. CLI file commands should also change their behavior. If you type /file print, it should show the contents of root directory only. If you need to show the contents of some subdirectory, you may specify it in 'where' parameter like /file print where name~"subdir/". Sometimes, it may required to show the contents including subdirecories, in such case an additional parameter could be added, like "/file print include-subdirs" for example.
In Linux there is an 'ls' command, so it shouldn't be a problem to translate file commands into 'ls' command accordingly.

It may sound wild for those who get used to current behavior, but without this, any adequate behavior with large amount of files is impossible.

--------------------------------------------------------------------------------------------------------------------------------------------------

P.S. It's still unclear if SMB client feature is incuded in ROSE-storage package, because it works even without this package.
You do not have the required permissions to view the files attached to this post.
Last edited by teslasystems on Fri Feb 07, 2025 10:53 am, edited 1 time in total.
 
User avatar
normis
MikroTik Support
MikroTik Support
Topic Author
Posts: 26977
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 10:51 am

Which version is this?
 
teslasystems
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Aug 09, 2015 3:00 pm

Re: New exciting features for storage

Fri Feb 07, 2025 10:53 am

Which version is this?
I have specified it, 7.18beta4
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1092
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 11:24 am

Current situation is a disaster for scripts. I have reported my issue here:
viewtopic.php?t=214071#p1120688

... but did not yet open an issue for support. Looks like the implementation is racy, so all scripts that handle files are randomly crashing.

Sometimes even file is available for find, but remove fails anyway, something like:
/file/remove [ find where name="file/with/path" ];
 
User avatar
normis
MikroTik Support
MikroTik Support
Topic Author
Posts: 26977
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 12:00 pm

Changelog tells you about how to do it, use the new parameters (not a bug)

*) file - allow printing specific directories via path parameter;
*) file - added "recursive" and "relative" parameters to "/file/print" for use in conjunction with "path" parameter;
 
jaclaz
Forum Guru
Forum Guru
Posts: 2288
Joined: Tue Oct 03, 2023 4:21 pm

Re: New exciting features for storage

Fri Feb 07, 2025 12:01 pm

Meh, this shows how old (and grumpy) I am getting , personally I don't feel particularly excited, the whole stuff appears to be at the moment more wishful thinking than anything else, and anyway it all sounds to me like, to make the usual automotive comparison:
"Hey! We added round wheels, an exciting new development from the square ones we had till now".
(the triangular ones, one bump less, were tested but abandoned earlier)
 
User avatar
Ullinator
just joined
Posts: 17
Joined: Tue Jun 08, 2021 12:53 pm
Location: North-West Germany

Re: New exciting features for storage

Fri Feb 07, 2025 12:03 pm

I totally agree eworm.
hc_483.jpg
this sccrenshot was made on a rb5009 with ROS 7.18beta4.
The failed script in the sceenshot downloads FW blocklists, merge them and create list entries.
To do this, some files (size <200kb) are downloaded, stored in "Files" and after creation of the "Address List" in the FW menu these files were deleted.
It runs fine on every ROS before ROS7.18Beta2 and now Beta4.
The script itself is provided by eworm.
(please see at https://git.eworm.de/cgit/routeros-scripts/about/)
Please look at it, thank you!
You do not have the required permissions to view the files attached to this post.
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1092
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 12:22 pm

Changelog tells you about how to do it, use the new parameters (not a bug)
Wait... What!?

So find is aware of the file and returns an id. But remove still can not remove it. Does that require a path now, for a unique id?
:local FileID [ /file/find where name="file/with/path" ];
/file/remove path="file/with" $FileID;
🤪

That's bullshit, no?

Please have another look at that.
 
User avatar
normis
MikroTik Support
MikroTik Support
Topic Author
Posts: 26977
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 1:35 pm

We can't replicate what you are saying, but actually it would be better and more correct to do it this way:
/file/remove file/with/path
and not
/file/remove [ /file/find here name="file/with/path" ]
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1092
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 2:24 pm

All that fails the same way. Not every time, but way too often.

As this is racy you need to remove a file that's not too old. Perhaps I should open an issue and provide more details... The problem is that behavior on racy things changes all the time, so there is no perfect reproducer.
 
User avatar
normis
MikroTik Support
MikroTik Support
Topic Author
Posts: 26977
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 2:47 pm

yes, please make a ticket with details how to replicate, how many files you have, which file you removed etc.
 
itimo01
Frequent Visitor
Frequent Visitor
Posts: 71
Joined: Thu Jun 29, 2023 2:55 am
Location: Germany
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 3:14 pm

- Swap
Swap appears to be working great since I'm now able to spin up a minecraft server on my ax3 :D
While previously trying to get it working, the router would crash with an OOM condition.

container/envs/add key=EULA name=mcsrv value=TRUE
container/envs/add key=MEMORY name=mcsrv value=512M

container/add remote-image=itzg/minecraft-server:latest interface=veth1 envlist=mcsrv root-dir=/usb1-part1/containers/store/mcsrv comment=mcsrv logging=yes
container/start [find comment=mcsrv]

ip/firewall/nat/add action=dst-nat chain=dstnat disabled=yes dst-address=192.168.41.1 dst-port=25565 protocol=tcp to-addresses=172.17.0.2 to-ports=25565
Sadly i cant upload my screenshot right now. (linked it externally)
Image
 
Valerio5000
Member Candidate
Member Candidate
Posts: 113
Joined: Fri Dec 06, 2013 2:38 am

Re: New exciting features for storage

Fri Feb 07, 2025 3:23 pm



Why are all these features there? Well, soon you will find out, but if you can test some of them, that would help, thanks
I'll take a guess..you want to enter the NAS market? tell the truth :D

Anyway it's always nice to see the MK team developing and proposing new features ;)
 
User avatar
dang21000
Frequent Visitor
Frequent Visitor
Posts: 93
Joined: Sat Feb 25, 2023 2:30 pm
Location: France

Re: New exciting features for storage

Fri Feb 07, 2025 9:01 pm

Exciting features... ? I don't understand why other networks products, forti, xtrem, cisco do like you !
Minecraft on container on network security gateway... it's a joke ?

And during this time, with evolution of routerOS, their more and more constraints about device mode, functions before allowed are now locked and need the physical button press to be changed. When router are far, it's a great feature, for sure ! But it's better to transform routerOS as a NAS, gaming server....
 
User avatar
normis
MikroTik Support
MikroTik Support
Topic Author
Posts: 26977
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 9:28 pm

Who said you have to run Minecraft? One forum user did it for testing?
You can run Greylog or Grafana.
 
itimo01
Frequent Visitor
Frequent Visitor
Posts: 71
Joined: Thu Jun 29, 2023 2:55 am
Location: Germany
Contact:

Re: New exciting features for storage

Fri Feb 07, 2025 9:37 pm

Minecraft on container on network security gateway... it's a joke ?
Yes, and you can definitely run more useful things on a router if you so desire.
 
teslasystems
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Aug 09, 2015 3:00 pm

Re: New exciting features for storage

Sat Feb 08, 2025 5:22 am

need the physical button press to be changed. When router are far, it's a great feature, for sure !
Don't want to sound rude and sorry for offtopic, but having hardware on remote location without having additional devices (like GSM-sockets or something similar) that allow to remotely power-cycle your hardware is very strange at least. Anything could happen and power-cycling often helps. In case of device-mode changing it would also solve the problem. So, as to me, having such devices is a mandatory thing and I don't know how to explain when people don't have them. May be they like to drive (or even fly) to their remote sites each time something happens...
 
eider
newbie
Posts: 36
Joined: Thu Nov 30, 2017 10:14 pm

Re: New exciting features for storage

Sat Feb 08, 2025 6:26 am

This is RouterOS, not StorageOS. If you desire to add file management and make a NAS out of a router then just spinoff ROS into another branch that is developed separately. Storage device does not need BGP and MPLS and router/switch does not need NFS, Btrfs support, RAID, NVMe over TCP or fancy UI for collaborative file sharing. You already have strong base with basic networking, just cut unnecessary slack, integrate rose-storage into base and sell it as separate OS to be ran on new class of devices.

The naming of ROSE is also pretty poor, "RouterOS Enterprise" - 100% enterprise storage, 0% enterprise networking.

---
You can run Greylog or Grafana.
I wouldn't dare any more than you would dare to run it on Junos :> Possible? Yes, absolutely! Good idea? In hell.
 
User avatar
sirbryan
Member
Member
Posts: 421
Joined: Fri May 29, 2020 6:40 pm
Location: Utah
Contact:

Re: New exciting features for storage

Sat Feb 08, 2025 7:03 am

I, for one, welcome our Storage overlords.

Those who are poo-pooing things haven't been paying close attention to the hyper-convergence of functions the last decade or two. Cisco built a virtual router for VMware 15 years ago, and VMware created vSAN shortly thereafter. Now you have Proxmox VE + Ceph, and with a CHR (or two) in the mix, or FRR on the bare metal, customers can build (and have) practically anything on commodity hardware.

Look at what TrueNAS has done with TrueNAS Scale. You put the server on a decent PC, spin up your ZFS pool, go download a bunch of free apps, and/or put a VM on the box. MSP's love this kind of stuff.

It looks like MikroTik is trying to get their hardware and software into this market. You can do a barebones PC, or you can buy a beefy router (RB5009, CCR2004, CCR2x16 or CHR + Ampere) with simple storage, and, like with TrueNAS scale, load up apps (micro services) on your router.

When ROSE came out, I put an NVMe to SATA adapter in a 2116, punched a hole, ran some thin SATA cables out, and hooked up six SATA drives in a bay the size of a CDROM. It works pretty well.

The advantage MikroTik has over a PC is wirespeed switching/routing (on Marvell platforms). I run a bunch of containers on my 2116. Going to have to add the Minecraft one (didn't know it existed for ARM64).
 
Rox169
Member
Member
Posts: 468
Joined: Sat Sep 04, 2021 1:47 am

Re: New exciting features for storage

Sat Feb 08, 2025 8:43 am

Mikrotik NAS?
 
noradtux
newbie
Posts: 41
Joined: Mon May 24, 2021 6:33 pm

Re: New exciting features for storage

Sat Feb 08, 2025 9:29 pm

How I see it 'Tik are just making the existing features of the kernel accessible to the user. I welcome that and I do use containers and storage in private and intent to use it in enterprise.
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1703
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

Re: New exciting features for storage

Sat Feb 08, 2025 9:40 pm

@sirbryan, that’s not gonna happen. ROS is designed as an embedded NOS with its own limitations. When it comes to running ROS as CHR, there are way better options. Plus, MT lacks the skill set and experience, and ROS is too unreliable for storage solutions like hyper-convergence.
 
User avatar
Kentzo
Long time Member
Long time Member
Posts: 631
Joined: Mon Jan 27, 2014 3:35 pm
Location: California

Re: New exciting features for storage

Sun Feb 09, 2025 2:51 am

I think it makes a great SoHo router though. A couple of SMB shares and SWAP for memory heavy containers is all I need. Finally can retire an rpi and run Homebridge directly on my AX3.
 
eider
newbie
Posts: 36
Joined: Thu Nov 30, 2017 10:14 pm

Re: New exciting features for storage

Sun Feb 09, 2025 5:34 am

SWAP for memory heavy containers is all I need
SWAP over USB is a horrible idea and recipe for kernel deadlocks and freezes - definitely not something you want on a device that is also processing your network traffic. Will it work? Yes, and its also likely you won't see any issues... until you hit them hard and waste days debugging it.
 
User avatar
Kentzo
Long time Member
Long time Member
Posts: 631
Joined: Mon Jan 27, 2014 3:35 pm
Location: California

Re: New exciting features for storage

Sun Feb 09, 2025 5:46 am

I got an impression that their SWAP implementation is only for containers and otherwise unused (and isolated) from network functionality.
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 3103
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: New exciting features for storage

Sun Feb 09, 2025 3:59 pm

...
Why are all these features there? Well, soon you will find out, but if you can test some of them, that would help, thanks
My bet: fast stable shared resource to provide true HA.
 
teslasystems
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Aug 09, 2015 3:00 pm

Re: New exciting features for storage

Sun Feb 09, 2025 4:33 pm

Oh, and regarding this,
- Storage on RAM (tmpFS) when you don't have storage space, but have free RAM
Please read
viewtopic.php?t=214077
 
eider
newbie
Posts: 36
Joined: Thu Nov 30, 2017 10:14 pm

Re: New exciting features for storage

Sun Feb 09, 2025 9:13 pm

I got an impression that their SWAP implementation is only for containers and otherwise unused (and isolated) from network functionality.
Since containers share kernel with host, there is no distinction here. Only consider it for devices which have PCI-E lanes exposed over physical slot (RBM33G does for example, but it's hardly a good base for it anyway because of MMIPS and 16M of storage).
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22378
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: New exciting features for storage

Sun Feb 09, 2025 11:08 pm

Zerotrust cloudflare on a storage device??? ;-PP
 
guipoletto
Member Candidate
Member Candidate
Posts: 210
Joined: Mon Sep 19, 2011 5:31 am

Re: New exciting features for storage

Mon Feb 10, 2025 5:08 am

Regarding tmpfs:
i ran a script to create "/tmp" on several production devices:
/disk/add slot=tmp type=tmpfs;
this should create a ramdisk with "upto" 50% of RAM

it failed on all "64M" devices (RB2011iL, RB2011iLS, RB750r2, RB433)
for these, the default of 50% should probably be reviewed
they accepted up to 30M for tpmfs, even when "free-memory" was around 20-24mb

this leads to another observation:
a Netpower 16P reports 183mb free (out of 256), and also failed to create the ramdisk, with the same message as the 64m ones;
"failure: too much memory requested for tmpfs/ramdisk"

another Netpower 16P with 199mb "free" successfully created the ramdisk with the same parameters

this is weird, as 128mb are clearly free

and also leads to my main question:
when ramdisk is created near boot-time (when ram is mostly free and unfragmented),
what would be the expected behahviour when system-ram usage grows, and the ramdisk already exists with "upto" 50% of ram, but is empty / near-empty?
 
teslasystems
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Sun Aug 09, 2015 3:00 pm

Re: New exciting features for storage

Mon Feb 10, 2025 7:05 am

@guipoletto
It seems, that there is some "reserved" memory. My TILE router with 2 GB of RAM, goes to reboot with out-of-memory if free RAM goes down to about 150 MB.
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1092
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: New exciting features for storage

Mon Feb 10, 2025 5:40 pm

yes, please make a ticket with details how to replicate, how many files you have, which file you removed etc.
Decided against. While this breaks my scripts, I can not find a really good reproducer. This drove me crazy - every time I though I am near it changed behavior. 🤪

Instead I modified my scripts. I bumped the required version to RouterOS 7.15 - the new code for directory creation (
/file/add type=directory name=$dir;
instead of
/file/add name=$dir/file; /file/add name=$dir/file;
) made it less likely to hit the issue. Also introduced a global function for removal - there I have a central point to catch and ignore the error. 🤪
The only downside is that stale files may be around... But as I put everything into a tmpfs this is not much of a concern - a reboot does clean up.