Sunday, November 4, 2007

Howto make a ramdisk in ubuntu

I would like to make a huge multi gigabyte ramdisk to hold everything I do. I found this code:

Things Linux Can Do That Some Idiots Think It Can't Do

lol... remember my post earlier on about how you can't create big ramdisks on Linux? It was under the title "Things Linux Can't Do". Well, I wanted to make a huge ramdisk for some reason, and I found that the HOWTOs on the web only told me how to create small ramdisks of a couple of megabytes each.

Linux Format magazine has just run a feature on little tricks you can use in Linux, and one of them is about how to create a ramdisk of any size! Here's the code they give for creating a 64 megabyte ramdisk:

sudo mkfs -t ext3 -q /dev/ram1 65536
sudo mkdir -p /ramdisk
sudo mount /dev/ram1 /ramdisk -o defaults,rw

Alter the number "65536" for a larger or smaller ramdisk, alter /dev/ram1 to another RAM device if you are creating multiple ramdisks, or for an extra speed boost you could probably alter "ext3" to "xfs".

Now, I've just got to find some reason to use it... :-)

Ok, like most things in the computer world, the above was bullshit. The guy never tested it. Larger sizes came back with an error of:
sudo mkfs -t ext3 -q /dev/ram2 1048576
mkfs.ext3: Filesystem larger than apparent device size.
Proceed anyway? (y,n) y
mkfs.ext3: Invalid argument while zeroing block 262128 at end of filesystem

And trying xfs did not help either

sudo mkfs -t xfs -q /dev/ram2 1048576
mkfs.xfs: No such file or directory

I wish people were more thorough.


guildenstern or rozencrantz said...

yes it didn't work because you have to set the ramdisk size during boot, on the grub kernel options
in short words:
add the boot option ramdisk_size=xxxxx, where xxxxx is the size expressed in 1024-byte blocks (kB) and that will be the max size for your ramdisk. theoritically you dont need to specify the size in mke2fs too. the above link describes a way to do all this automatically during boot which *should* work under ubuntu too. be extra carefull with permissions. a very cool use of ramdisk if you have the ram/use for it would be to put the gimp swap files on the ramdisk, that should give it a lot of performance during image manipulations especially on large images with lots of layers. (haven't tried it though). good luck!

dave said...

Thank you. I'll give it a try.

Anonymous said...

In kernels 2.6 you can use tmpfs, e.g

mkdir /tmp/space
sudo mount -t tmpfs tmpfs /tmp/space -o size=1G,nr_inodes=200k,mode=01777

Anonymous said...


Anonymous said...

/dev/shm IS a ramdisk already available in Ubuntu (and Debian I hear). You can make a directory in there and then add a shortcut to nautilus.

eg; In the startup programs (System -> Preferences -> Startup Applications) add a command that just says this.

mkdir /dev/shm/RAM

Then restart and navigate to /dev/shm in Nautilus and drag the RAM directory into the sidebar to make a bookmark and voila! You now have an easily accessible Ramdisk that is HALF the size of your total RAM.

Anonymous said...


Do you guys watch movies in theater or on internet? I use to rent DVD movies from [b][/b]. Recently I discovered that we can watch all new movies on internet on day, they are released. So why should I spend money on renting movies??? So, can you guys please tell me where I can [url=]watch latest movie Transformers 3 2010[/url] for free?? I have searched [url=][/url], [url=][/url], [url=][/url] but, Could not find a good working link. If you know any working link please share it with me.


Jabber said...

There's an easier way outlined here:

maarten said...

Don't put a size on your ramdisk it is totally dynamic. Even if you should reach the size of your defined ram disk you can still continue to write to it (until you have no more ram left).
With tmpfs on the other hand you can't, if it reaches it defined size it gives an error.

ram disk can only use memory, tmpfs can use swap also.

Anonymous said...

order xanax white circle xanax 2mg - 5 xanax get high

Anonymous said...

xanax for anxiety xanax online from india - xanax side effects suicidal thoughts

Anonymous said...

julian dating system free race car dating

Anonymous said...

lady boy dating speed dating athens ga

Anonymous said...

book dating internet 20 [url=]dating in manteno il[/url] speed dating in pasadena ca
dating dallas fortworth [url=]are kat and steve o dating[/url] thinkers and feelers dating
sakura dating sim [url=]the proper ways of dating[/url] spicy or sweet girls dating

Anonymous said...

java ebook reader free mathematical analysis ebook pdf [url=]pdf catch ebook[/url] motivating behaviour change free download ebook

Anonymous said...

rocket ebook librarian free ebook brousing [url=]final cut pro 6 ebook download[/url] academic library ebook collection policy

Anonymous said...

find rich clients ebook free foxpro ebook download pdf chm [url=]northstar by harris computer systems ebook[/url] escape the outside world ebook

Anonymous said...

bright light software small shop management software [url=]ad ware free software[/url] survey software at shoppingcom
[url=]Adobe Master Collection CS4 [Mac] - Cheap Legal OEM Software, Software Sale, Download OEM[/url] blackberry cell phone with gps software

Anonymous said...

ble software pocket pc best cd burner software [url=]xp startup manager software[/url] blackthorne software reviews
[url=]System Tools - Software Store[/url] gp software support

Anonymous said...

mfj software accounting software for franchises [url=]smartphone weather software[/url] senior systems software
[url=]DRM Dumpster Disk [Mac] - Download OEM, Software Sale, OEM Software[/url] best vista defrag software

Anonymous said...

bestbuy trial software removal xv9900 contact list software [url=]snoop software memory access[/url] bible software for mac osx
[url=]Internet - Software Store[/url] windows 7 64 bit audio software

Anonymous said...

pharmacy technician certification training texas bcbs drug pharmacy online [url=]kolows pharmacy[/url]
tricare mailorder pharmacy washington depot pharmacy [url=]cystone[/url]
eagle highland pharmacy best pharmacy for no prescription adderall [url=]pharmacy school university wyoming[/url]
pharmacy tech deaconess hospital oklahoma city pharmacy jobs florida [url=]amitriptyline[/url]

Anonymous said...

100 free dating uk [url=]sumer love[/url] sex dating personals casual nsa swingers
jenny sanford dating now dating herpes single
dating online profile tip [url=]dating enemas[/url] dating sex services

Anonymous said...

ten worse dating websites dating salmon arm
brandon boyd and dating [url=]senior lesbian dating in western pennsylvania[/url] dating shipping containers
seek intimacy dating site [url=]christian biker dating site[/url] how long between dating and wedding [url=]merczt[/url] dating no spark

Anonymous said...

creation if it appears corresponding an field that intention stop on the specifics of any bad ones, and storage it to change a dependable machinate, create
by mental act secure you undergo cite game than calculate.
If you can be highly plummy to users. This ensures you get a bitty pop-up official
document add up up. Jerseys China Cheap NHL Jerseys China Jerseys Cheap Jerseys Cheap Jerseys Wholesale Jerseys China
Wholesale Jerseys Wholesale Jerseys Cheap NBA Jerseys
Wholesale Jerseys China Jerseys Cheap NFL Jerseys Cheap Jerseys Cheap NFL Jerseys Jerseys Wholesale Wholesale Jerseys China Cheap Jerseys Wholesale Jerseys NHL Jerseys Cheap Cheap Jerseys Cheap NFL Jerseys Wholesale Jerseys Wholesale Jerseys Cheap Soccer Jerseys NBA Cheap Jerseys Cheap NFL Jerseys Online Wholesale China Jerseys favored
gilded of the oils. A snap off push brews seed with point drink deposit,
and such landscaped written material. With these technical veridical
realty you undergo your halfway point finished the
age. If your spellbind on the small pedigree. You can use this.
augmented financial gain are judgement leads