Community discussions

MikroTik App
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

RAMdisk

Tue May 09, 2017 11:36 pm

On the "new style" devices with only 16MB Flash the "Files" section is a RAMdisk with the Flash memory in a "flash" sub directory.
On a "classic" device with 128MB Flash the "Files" section links directly to the Flash and I think there is no RAMdisk directory.
Is it possible to have a RAMdisk on those devices? Some of them have a lot of unused RAM that could store traces, logs etc before download.
 
User avatar
genesispro
Member
Member
Posts: 304
Joined: Fri Mar 14, 2014 12:33 pm

Re: RAMdisk

Thu May 11, 2017 3:45 pm

indeed a RAMDisk would be very useful to keep sector writes as low as possible!!!
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Thu Jul 20, 2017 4:37 pm

How about implementing this in the RC?
I want to run a script on a CCR that will require a temporary file and needs to run once a minute.
It would be nice when I could save the Flash by using RAMdisk for this.
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: RAMdisk

Fri Jul 21, 2017 9:31 am

It would be really useful. But instead damaging internal storage, you can use cheap external USB or SD storage. Unfortunately it is another source of failure...
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Fri Jul 21, 2017 11:23 am

I think I will use a USB stick. However, all the code for having a RAMdisk should already be available as the new 16GB Flash models all have it.
So it should be easy to add it for models like CCR as well. Our CCR has 2GB memory and it is almost all unused (no internet BGP tables).
 
msatter
Forum Guru
Forum Guru
Posts: 2941
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: RAMdisk

Fri Jul 21, 2017 12:26 pm

I think I will use a USB stick. However, all the code for having a RAMdisk should already be available as the new 16GB Flash models all have it.
So it should be easy to add it for models like CCR as well. Our CCR has 2GB memory and it is almost all unused (no internet BGP tables).
With 16 GB of flash partitioning would be at least possible. ;-)
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: RAMdisk

Sun Jul 23, 2017 11:13 am

Yep. 16GB flash... What a sound of far future....
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Sun Jul 23, 2017 11:56 am

Well, 16MB of course(?).
At work I am replacing the 16GB M.2 Flash modules in thin clients with 120GB modules because of space shortage...
Unfortunately there is no M.2 slot in the CCR (only in the RB1100AHx4).

However, let's not distract from the wish to have a RAMdisk capability in all models. It should be easy and useful.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26912
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

Re: RAMdisk

Mon Jul 24, 2017 2:23 pm

Well, 16MB of course(?).
At work I am replacing the 16GB M.2 Flash modules in thin clients with 120GB modules because of space shortage...
Unfortunately there is no M.2 slot in the CCR (only in the RB1100AHx4).

However, let's not distract from the wish to have a RAMdisk capability in all models. It should be easy and useful.
CCR1072 does have a M.2 slot.
 
jarda
Forum Guru
Forum Guru
Posts: 7756
Joined: Mon Oct 22, 2012 4:46 pm

Re: RAMdisk

Mon Jul 24, 2017 2:36 pm

Normis, the point is elsewhere... What about to allow a user to configure ramdisk within the ros?
 
Chupakabra303
just joined
Posts: 14
Joined: Tue Jun 20, 2017 3:07 pm

Re: RAMdisk

Tue Jan 09, 2018 11:18 am

+1
RAM disk is very good.
I have 2 scripts that use priodical call fetch function.
 
Largelos
just joined
Posts: 14
Joined: Thu Jan 31, 2013 1:24 pm

Re: RAMdisk

Wed Aug 15, 2018 3:57 am

+1, will be userfull for fetch scripts
 
User avatar
floaty
Member
Member
Posts: 357
Joined: Sat Oct 20, 2018 1:24 am
Location: 52°08'32.34"N 14°39'05.0"E

Re: RAMdisk

Thu Oct 24, 2019 1:37 am

+1
.
would be a neat thing
have a ppp-up (-down) script which needs helper-files to store dialer-states
... that's scratchy ... not so healthy for a flash or even for an usb-disk
... so definitly plus one
( ... even in v6.44+ [letting v7 be a good man] ... ... wanna show this to my colleagues ... ... not only to my grandchilds : )
 
jetelina
newbie
Posts: 34
Joined: Thu Jun 27, 2013 11:22 pm

Re: RAMdisk

Wed Aug 19, 2020 8:46 pm

+100

Why this isn't implemented already? I have CRS328-24P-4S+RM, it has 512 MB RAM and only 16 MB FLASH and it does NOT have USB port!
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Wed Aug 19, 2020 9:46 pm

+100

Why this isn't implemented already? I have CRS328-24P-4S+RM, it has 512 MB RAM and only 16 MB FLASH and it does NOT have USB port!
But that one should have a RAMdisk already. I am discussing RAMdisk on 128MB(and more) flash models, like the RB1100, RB2011, old RB750, CCR, etc.
 
jetelina
newbie
Posts: 34
Joined: Thu Jun 27, 2013 11:22 pm

Re: RAMdisk

Sat Sep 05, 2020 4:10 am

But that one should have a RAMdisk already.
You are right. It was enough just to read the manual. Here is described:
Warning: If device has a directory named "flash" in its file list, then files which you want to be kept after system reboot/power cycle must be stored within it. As anything outside of it is kept within a RAM disk and will be lost upon reboot.
I though that "flash" is root directory and you cannot be (or move) outside, but yes you can.
Simply root "/" is above "/flash" and is invisible to non-trained eye. Weird UX, but shame on me.
 
User avatar
berisz
newbie
Posts: 43
Joined: Tue Dec 12, 2017 12:50 am

Re: RAMdisk

Wed Mar 24, 2021 10:07 am

+1 RAMdisk!
 
markmcn
Member Candidate
Member Candidate
Posts: 121
Joined: Wed Mar 03, 2010 2:15 am

Re: RAMdisk

Wed Mar 24, 2021 11:20 am

It would be great to see,
However I opened a ticket to request this as it would allow for a standard file structure, All devices have a flash folder rather than this mixture of some flash some not. Sadly support weren't interested and just said no.
Maybe if they see this on the forum they might reconsider.
MT Support please please bring in a ramdisk system standard for all devices
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Wed Mar 24, 2021 11:25 am

I can understand why they would not want to change the directory structure of existing devices to match what is now on 16MB flash devices, because that would surprise existing users that are running user manager, dude, custom scripts, etc.
But I cannot understand why it is not possible to add ramdisk to existing devices and make e.g. a ramdisk subdirectory for that.
Probably that should have been done in the first place for the new models with small flash (some users were surprised that e.g. an export file saved in the root dir would be lost after reboot, and had to learn about the flash folder the hard way), but it is too late for that as well.
 
User avatar
berisz
newbie
Posts: 43
Joined: Tue Dec 12, 2017 12:50 am

Re: RAMdisk

Tue Sep 07, 2021 9:12 pm

+1 RAM-disk!
For example, scripts could write there.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: RAMdisk

Tue Sep 07, 2021 9:15 pm

when your RouterBoard have got a /flash then / is mounted as ramdisk.
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Wed Sep 08, 2021 10:39 am

when your RouterBoard have got a /flash then / is mounted as ramdisk.
Yes, we know that.
The request is to make a ramdisk and mount it as /ramdisk on those devices that do NOT have a /flash.
The older router models and the new powerful ones have a lot of RAM and a larger NAND flash so no /flash, the / is the flash, but there is no ramdisk.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12554
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: RAMdisk

Sat Feb 26, 2022 11:42 am

:-?
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Sat Feb 26, 2022 12:33 pm

We still don't have a RAMdisk on all routers... I now have a router with 1GB of RAM, 90% unused, still no RAMdisk...
 
holvoetn
Forum Guru
Forum Guru
Posts: 6753
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: RAMdisk

Sat Feb 26, 2022 12:58 pm

We still don't have a RAMdisk on all routers... I now have a router with 1GB of RAM, 90% unused, still no RAMdisk...
It's basic Linux so adding it would be rather trivial.
Heck, even on some Raspberry PI configs (DietPI being my favorite) it's foreseen to use a small part of the memory (few has it has, the little bugger) for logfiles and other stuff which change in a rapid pace. No need to burden the SD card with that. Or any other flash-component.
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Sat Feb 26, 2022 1:05 pm

The RAMdisk in Linux is quite clever in that it does not use a fixed area of memory but dynamically allocates memory depending on how many files are stored (with a configurable max).
The code is already there, the 16M :) flash devices have it. It should be simple to make a ramdisk of up to half the memory and mount it as /ramdisk.
 
User avatar
Znevna
Forum Guru
Forum Guru
Posts: 1352
Joined: Mon Sep 23, 2019 1:04 pm

Re: RAMdisk

Sat Feb 26, 2022 2:10 pm

Oy, MikroTik, Y U NO RAMdisk on all yer products? Eh?
I know this change can't be made over night and without cries from admins which don't read changelogs, there will be bug reports like: "but muh files in / were persistent until yesterday!!! merkertik pls fix11!! I lost all my data because I don't keep backups!!!111" and such.
But on those devices there could be made another mountpoint for the RAMdisk, or make the user somehow agree with the change (make it configurable?).
Now who wants to submit a nice feature request?
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: RAMdisk

Tue Mar 08, 2022 4:16 pm

Image
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Tue Mar 08, 2022 4:27 pm

What is it that you want to add to the discussion, SiB? I seem to miss it.
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: RAMdisk

Tue Mar 08, 2022 4:50 pm

At RouterOS who have got a /flash folder we have
/ <- root folder is temfs, it's ramdisk itself
/flash <- all files here are at physical nand
 
holvoetn
Forum Guru
Forum Guru
Posts: 6753
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: RAMdisk

Tue Mar 08, 2022 4:56 pm

when your RouterBoard have got a /flash then / is mounted as ramdisk.
Yes, we know that.
The request is to make a ramdisk and mount it as /ramdisk on those devices that do NOT have a /flash.
The older router models and the new powerful ones have a lot of RAM and a larger NAND flash so no /flash, the / is the flash, but there is no ramdisk.
Already mentioned and answered...
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Tue Mar 08, 2022 4:56 pm

At RouterOS who have got a /flash folder we have
/ <- root folder is temfs, it's ramdisk itself
/flash <- all files here are at physical nand
Ok, so it was irrelevant. We all know that. This topic is not about that.
 
guipoletto
Member Candidate
Member Candidate
Posts: 201
Joined: Mon Sep 19, 2011 5:31 am

Re: RAMdisk

Tue Mar 08, 2022 5:50 pm

Adding to the real usefulness of ramdisk:

yesterday i was doing a TFTPPUT from a Uboot/device to a CCR1036

i tried everything and the transfer always failed. Wireshark/sniffer told me that a late-ack caused a packet# to be resend, breaking the flow;

the problem: when the CCR stopped responding the TFTP flow to actually write the buffer to flash, the transfer failed
the solution: perform the TFTP to a RB750Gr3.

so ++1 for having a dedicated RAMDISK area in all Mikrotik routers (which is basically exposing /tmp as a path, with some quota to prevent OOM)
 
r00t
Long time Member
Long time Member
Posts: 674
Joined: Tue Nov 28, 2017 2:14 am

Re: RAMdisk

Wed Mar 09, 2022 12:02 am

Just name the directory "ramdisk", anyone knowledgeable enough to be able to use winbox will surely know any file put there is temporary.
And this thread is from 2017, it's clear there is demand for this feature... but NOPE.
I really just don't understand what's the problem here for Mikrotik still refusing to implement this.
Some devices are already using ramdisk (to even be usable with 16MBs of flash). It would clearly help with ftpgets and downloading of temporary files.
But NOPE.
No reasons given.
No feedback.
Only reply from anyone from Mikrotik (normis) in this thread is laughable at best, completely unrelated: "CCR1072 does have a M.2 slot."
So after 5 years, situation is still the same:
*lalalalala* "is that damn ramdisk thread still active? oh no!" *lalalalalalala* "I can't hear you" *lalalalalala*
 
pe1chl
Forum Guru
Forum Guru
Topic Author
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: RAMdisk

Wed Mar 09, 2022 11:52 am

@r00t I agree. It should be made a /ramdisk folder (of course that is how it should have been done on the 16MB units from the beginning, and there would be no confusion) and it should be a very simple task to change this as all the code and underlying OS support is already there, it only has to be enabled on the relevant devices. It does not have to be configurable, it can just be there all the time, just like on the 16M flash models.
But MikroTik do no seem to see the point.

Well, at the moment there are more important problems, like getting v7 in a feature-complete state. But in the years that this topic already exists, there could have been opportunities to just include this in a new v6 release.
(at the moment my use case from 2017 on the CCR1009 no longer exists, but there are enough use cases for it)
 
User avatar
SiB
Forum Guru
Forum Guru
Posts: 1888
Joined: Sun Jan 06, 2013 11:19 pm
Location: Poland

Re: RAMdisk

Wed Mar 09, 2022 3:13 pm

In old days we have no ramdisk at all.
The / was a NAND only.

Next MikroTik do at some devices the build-pack at NetInstall but we can still use additional package and do NetInstall with own system + .. package and have filesystem at old way.

Currently many devices out-of-box have got a ramdisk as / and /flash is mounted as nand.

I have no problem to TFTP on both direction with all my switches/routers and other devices. Maybe you should do a capture of TFTP traffic and just create a ticket and complain at TFTP itself and not a ramdisk.
 
guipoletto
Member Candidate
Member Candidate
Posts: 201
Joined: Mon Sep 19, 2011 5:31 am

Re: RAMdisk

Wed Mar 09, 2022 6:17 pm


I have no problem to TFTP on both direction with all my switches/routers and other devices. Maybe you should do a capture of TFTP traffic and just create a ticket and complain at TFTP itself and not a ramdisk.

i have the Pcaps (50+ with all sorts of tweaks), the problem is not TFTP itself, the problem is that for a split second, while the CCR1036 is busy flushing the cache into the NAND, there is a delay in sending the ACK for the last received data-packet
So the device sending the TFTP simply repeats the Not-yet-acked packet, and causes the transfer to fail. (possibly due to the specific version of that Uboot, which is not really fixable)

When transfering to a RAMDISK, as there is no flush-to-nand-delay, the underlying BUG (whatever side it's on) is not triggered

This is a claim about the actual usefulness of having a RAMDISK,(for all mikrotik platforms) with an actual, real-world "saved my ass" recounting of facts.

Plus, it's already implemented (for the 16mb devices), so it is more of a "turn the switch on and test-it" scenario, rather than "develop this feature from the ground up" sceario.

If there is any downside to having a RAMDISK available, i'm all ears.
 
teslasystems
just joined
Posts: 23
Joined: Sun Aug 09, 2015 3:00 pm

Re: RAMdisk

Wed Nov 09, 2022 3:04 pm

+1 for adding ramdisk. Particularly I need it on CCR router.
 
arainbow
newbie
Posts: 36
Joined: Sat Sep 15, 2012 12:05 pm

Re: RAMdisk

Thu Oct 12, 2023 11:51 am

Allocate RAM to folder
Starting from 7.7 it is possible to add folders linked to RAM. Folders will be emptied on reboot or power loss.
RAM will be filled up to tmpfs-max-size and if this variable in not provided - up to 1/2 from available RAM.

[admin@MikroTik] > /disk add type=tmpfs tmpfs-max-size=100M slot=RAM
[admin@MikroTik] > file print
Columns: NAME, TYPE, SIZE, CREATION-TIME
# NAME TYPE SIZE CREATION-TIME
0 RAM disk dec/12/2022 11:01:48

https://help.mikrotik.com/docs/display/ROS/Disks
https://www.youtube.com/watch?v=uZKTqRtXu4M

Who is online

Users browsing this forum: No registered users and 29 guests