How to reserve fixed amount of memory for ramdisk?
How do I reserve a fixed amount of memory (16 MB) for RAM disk and do not allow the kernel to use it for other stuff?
Any pointers are appreciated. Everything that I find says "the RAM disk dynamically grows as data is being written into it" Details: ----------- I recently installed IPCop on a flash card. I used the LinITX image <http://linitx.com/support/download.php> All works well, except after having run for a while I can no longer write to the ram disk, even though it is not full. This creates all sort of problems. > root@ipcop:/var/log # mkdir test > mkdir: cannot create directory `test': No space left on device > root@ipcop:/var/log # df -h /ram > Filesystem Size Used Avail Use% Mounted on > /dev/ramdisk 16M 5.2M 11M 34% /ram I can see there is 25M available memory, but it does not want to use it. > root@ipcop:/var/log # free -k > total used free shared buffers cached > Mem: 94872 69216 25656 0 4192 46584 > -/+ buffers/cache: 18440 76432 > Swap: > 0 0 0 BTW: I have 96 MB or RAM, but can't install more, because it is an old Pentium 133 motherboard with the old 72 pin SIMM memory. --- Iassen Hristov P.S. If this matters the kernel is stock 2.4.27 |
Hello,
the amount of reserved RAMDISK is defined during kernel selection option stage. I mean when you hit "enable RAMDISK" box there's a box below which appears and ask you the amount you want to reserve (by default 4Mo) Oliv' |
Quote:
IPCop is using grub. Here is the /boot/grub/grub.conf Code:
|
Quote:
And you'll never be able to do so... 'cause it's RAMDISK so its filesystem is cramfs and that's a read only filesystem :( So you must configure it properly, then generate it and you can't modify it anymore when it's in RAM |
We are clearly not understanding each other. This disk is not cramfs, it is ext2. This is a ram disk that IS writeable after I boot. All the log files are written to it. Then after the system has ran for a while I can no longer write to it with a message "No space left on device".
I don't know if the RAM disk specified in the grub config is the same as this one. I think this RAM disk is created at boot time as part of the init process from the file /etc/rc.d/rc.flash.up Code:
umount -n /dev/ramdisk Actually this got me thinking and it appears I am running out of inodes. Code:
root@ipcop:/ram # tune2fs -l /dev/ramdisk |
All times are GMT -5. The time now is 08:23 AM. |