Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the capacity of the ramdisk

I compile the ramdisk as a module in the kernel.Then I want use the cmd :insmod brd rd_size = 10000 to set the capacity of the ramdisk.But it says I give the wrong parameters. Then I go to see the source code of this module. static int __init brd_init(void).There is no parameters list. If I want to set the capacity of the ramdisk,What can I do?

like image 651
qyanqing Avatar asked Dec 29 '25 19:12

qyanqing


1 Answers

Try modprobe brd rd_nr=1 rd_size=1048576 max_part=0

That should give you one 1G partition at /dev/ram0.

Solution referenced from here with a code reference here

like image 191
Justin B. Avatar answered Dec 31 '25 09:12

Justin B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!