Operating System - Linux
1830207 Members
1751 Online
109999 Solutions
New Discussion

Re: how to create 1 1g ram drive

 
Donny Jekels
Respected Contributor

how to create 1 1g ram drive

Does anyone know the procedure to setup a 1GB ram drive.

all the ram block devices that comes with the system is only 15MB

redhat linux.
"Vision, is the art of seeing the invisible"
6 REPLIES 6
Ivan Ferreira
Honored Contributor

Re: how to create 1 1g ram drive

When you compile the kernel, you define the maximum size for a ram disk. I don't know the maximum size that can be increased while reconfiguring the kernel.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Donny Jekels
Respected Contributor

Re: how to create 1 1g ram drive

for those who might need it one day

dd if=/dev/zero of=onegigram bs=1k count=102400
mke2fs -i 1024 -b 1024 -m 5 -F -v onegigram
mount onegigram /mnt/ramdisk/ -t ext2 -o loop

enjoy
"Vision, is the art of seeing the invisible"
Vitaly Karasik_1
Honored Contributor

Re: how to create 1 1g ram drive

AFAIK, this won't create ramdisk. you should increaze ramdisk size using kernel boot parameter and "dd" to /dev/ram, not just regular file.
See http://fxr.watson.org/fxr/source/Documentation/ramdisk.txt?v=linux-2.6.9 for example.
Ivan Ferreira
Honored Contributor

Re: how to create 1 1g ram drive

That is not a file system on memory, that is a file system on a disk file.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Mike Stroyan
Honored Contributor

Re: how to create 1 1g ram drive

The tmpfs filesystem is effectively a RAM disk as long as the system has plenty of RAM. It will page out to swap if memory space starts to get tight. You can use the 'size' mount option to limit its maximum size.

sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1g tmpfs /mnt/ramdisk

Andrew Bruce
Valued Contributor

Re: how to create 1 1g ram drive

Hey, great idea!

You could create a 1GB RAM disk and set it up as swap. That way, your swap will run really fast!!

Just kidding! :-D

Regards,

Andy Bruce

ps No points for me please (unless you count entertainment value, then again, that'd probably be negative points... ;-)
I Love it when a plan comes together!