Computing.Net > Forums > Linux > mount a ram drive

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

mount a ram drive

Reply to Message Icon

Name: mitra
Date: October 6, 2002 at 10:47:17 Pacific
OS: linux redhat 7.3
CPU/Ram: intell3,128mg
Comment:

how can I create and mount a ram drive?



Sponsored Link
Ads by Google

Response Number 1
Name: shyam
Date: October 6, 2002 at 10:59:19 Pacific
Reply:

first create a ram drive using
dd if=/dev/zero of=/dev/ram0 count=2048( 1Meg size )
then format it using your fs, for eg
mke2fs -m0 /dev/ram0

Then mount you ram drive on any directory say /rd using the command
mkdir /rd
mount /dev/ram0 /rd -o loop
That should do it


0

Response Number 2
Name: Richard
Date: October 6, 2002 at 11:36:07 Pacific
Reply:

Or, if you have tmpfs compiled into your kernel (or as a module) use

mount -t tmpfs tmpfs /mnt/wherever

This will create a ramdisk with half of you physical memory (but it doesn't get used until you copy stuff there). You can change this though, look at the mount manpage for tmpfs options.

I use tmpfs as my /tmp, by putting this line in fstab

tmpfs /tmp tmpfs defaults 0 0

I find it works very well, and even speeds up compiles a little. If you do this, (I think) tmpfs can't be a module, but now that I mention it, I might be wrong..., and in fact I think I am!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: mount a ram drive

mounting a zip drive www.computing.net/answers/linux/mounting-a-zip-drive/26324.html

mount a network drive www.computing.net/answers/linux/mount-a-network-drive/3185.html

Mounting a W2k Fat32 drive in Linux www.computing.net/answers/linux/mounting-a-w2k-fat32-drive-in-linux-/11123.html