Operating System - Linux
1827482 Members
2046 Online
109965 Solutions
New Discussion

Re: why I can create severl ramdisks, what has been more than my memoy total

 
SOLVED
Go to solution

why I can create severl ramdisks, what has been more than my memoy total

I know the ramdisk only use ram space after it has been formated, Now I am working in customize embed linux, no swap, and system ram is total only 129M, but I have create more than 5 ramdisk with 49M space every one. I wonder Why it can be possible.

Best Regards,
Frederick
frederick van targero
8 REPLIES 8
Balaji N
Honored Contributor
Solution

Re: why I can create severl ramdisks, what has been more than my memoy total

hi fred,

am not able to get your question. u are trying to create RAM disks of 49M and you are unable to create?

-balaji (monday morning blues?)
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Stuart Browne
Honored Contributor

Re: why I can create severl ramdisks, what has been more than my memoy total

I think this one is a straight maths problem.

49 x 5 = 240 (by my calculations).

With 128MB ram, no swap, 240MB of RAM drive's just WILL NOT FIT.

No magick here.

Try telling us why you need 5 drives, each of 49mb, and we'll see if we can come up with other solutions for you.

Embedded linux stuff is fun.. I've not had opportunity to do much with it though :(
One long-haired git at your service...
Stuart Browne
Honored Contributor

Re: why I can create severl ramdisks, what has been more than my memoy total

.. whoa ... my calculations were off too.. 245mb.. monday *sigh*
One long-haired git at your service...

Re: why I can create severl ramdisks, what has been more than my memoy total

Hi balaj,

I can create ramdisk, that is what my wonder.
I use the ramdisk as ram fs , all files extracted from flash-ide1.

In fact, I use the kernel with 64M ramdisk fs support, and option "ramdisk=49000" in lilo.

but in fact only the first ram0 for root fs has 49M ramdisk, others ram1 to ram4 is only 500k to 4M what be used to store application buffer,

just like this:
dd if=/dev/zero of=/dev/ram1 bs=1k count=500

however, once I boot into the system, I df what it mounted, i found all ramdisk has been in 49M while my total ram space is 129M only.

so , I got in confused.

Best Regards,
Frederick
frederick van targero
Sergejs Svitnevs
Honored Contributor

Re: why I can create severl ramdisks, what has been more than my memoy total

The compressed ramdisk image is decompressed into RAM. The bigger your uncompressed ramdisk is, the less RAM you have remaining for the kernel and user programs. This limitation depends on the amount of RAM installed and the amount needed by the kernel and your software to run. Remember that you can have swap space if you do
something RAM intensive once in a while.

Regards,
Sergejs
Stuart Browne
Honored Contributor

Re: why I can create severl ramdisks, what has been more than my memoy total

I'm picking the kernel is mis-reporting the available space on the ramdisk's.

What kernel version are you using on this machine?

If I have a machien with that version here, i'll see if I can re-produce it..

Have you tried a newer (or possibly older) kernel?

In the end, it might just be better to discuss this on the kernel dev list.
One long-haired git at your service...

Re: why I can create severl ramdisks, what has been more than my memoy total

I use the kernel of 2.4.18
frederick van targero
Sergejs Svitnevs
Honored Contributor

Re: why I can create severl ramdisks, what has been more than my memoy total

As of kernel v1.3.48, the old "ramdisk=" has been changed to "ramdisk_size=" to make it clearer.
With "ramdisk_size=XXX" parameter on your kernel command line ALL RAMDISKS ARE THE SAME SIZE.

If the system runs short of memory, a ramdisk's contents
might get swapped out (if swap is on). If the system runs short of memory, a ramdisk's contents
might get swapped out (if swap is on).

Additionally, in 2.4 kernels there is a ram filesystem which automatically resizes the amount of memory used according to how many
files you have in it.

Regards,
Sergejs