Operating System - Linux
1832267 Members
3665 Online
110041 Solutions
New Discussion

Create file system in RAM on Linux box?

 
SOLVED
Go to solution
Joakim Brosten
Frequent Advisor

Create file system in RAM on Linux box?

Hi,

I would like to create a file system RAM for disk performance measuring purpose.

Any one that could help me out?

Thanks in advance, /Joakim
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Create file system in RAM on Linux box?

Shalom,

Some forms of Linux already do this to an extent.

none 1014M 0 1014M 0% /dev/shm

I've never bothered to try and write a file to it and recommend not filling it up.

I just copied a small file into it and deleted it without difficulty.

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alan_152
Honored Contributor
Solution

Re: Create file system in RAM on Linux box?

Vitaly Karasik_1
Honored Contributor

Re: Create file system in RAM on Linux box?

As far as I understand, tmpfs is the preferred method for using RAM as filesystem.

It's simple:

# make the mount point for our temporary filesystem
mkdir /mnt/tmpfs
# create and mount a 100 megabyte (100M) temporary memory filesystem
sudo mount -osize=100m tmpfs /mnt/tmpfs -t tmpfs
(from http://256.com/gray/docs/misc/linux_memory_tmp_filesystem_fs.shtml)

for more - http://www.mjmwired.net/kernel/Documentation/filesystems/ramfs-rootfs-initramfs.txt
Joakim Brosten
Frequent Advisor

Re: Create file system in RAM on Linux box?

Thank you everyone,

I added "ramdisk_size=10000000" in "/boot/grub/meny.lst" as boot option. Rebooted and then run "mkfsreiser" on /dev/ram0 and mounted it on /mnt. (=10 GB disk in RAM)

I havn't tried the tmpfs way but will do so later.

/Joakim