ramdisk for linux: mount /ramdisk

ramdisk for linux: mount /ramdisk

Post by Ray Ead » Thu, 11 Feb 1999 04:00:00



Here's a feature I would like--anyone else seen something like this:

I would like to be able to mount a ram disk in the filesystem,
somewhat like an Amiga ramdisk.  

# cat /etc/fstab
/dev/hda6                  /                    ext2    defaults
/dev/hda1                  /boot                ext2    defaults
8megs of physical memory   /mnt/ramdisk         ram     defaults

# mount /mnt/ramdisk

This would be terribly convenient.  Anyone else wondered about this?

--

  reads.vcf
< 1K Download
 
 
 

ramdisk for linux: mount /ramdisk

Post by Tom Fawcet » Fri, 12 Feb 1999 04:00:00



> Here's a feature I would like--anyone else seen something like this:

> I would like to be able to mount a ram disk in the filesystem,
> somewhat like an Amiga ramdisk.  

> # cat /etc/fstab
> /dev/hda6             /                    ext2    defaults
> /dev/hda1             /boot                ext2    defaults
> 8megs of physical memory   /mnt/ramdisk            ram     defaults

> # mount /mnt/ramdisk

> This would be terribly convenient.  Anyone else wondered about this?

Linux has a ramdisk driver.  You should read about it.
/usr/src/linux/Documentation/ramdisk.txt

Since ram is volatile and doesn't keep a filesystem between boots, I'm not
sure what you expect your "mount /mnt/ramdisk" command to do.

-Tom

 
 
 

ramdisk for linux: mount /ramdisk

Post by Steve Marton » Fri, 12 Feb 1999 04:00:00



>I would like to be able to mount a ram disk in the filesystem,
>somewhat like an Amiga ramdisk.  
># cat /etc/fstab
>/dev/hda6              /                    ext2    defaults
>/dev/hda1              /boot                ext2    defaults
>8megs of physical memory   /mnt/ramdisk             ram     defaults
># mount /mnt/ramdisk
>This would be terribly convenient.  Anyone else wondered about this?

In DOS/Windows I use a 32MB ramdrive for almost all my activity.  I
have, from time to time, set up ramdrives in linux, but because of the
superior memory management in linux there just doesn't seem to be much
added benefit.
--
 
 
 

ramdisk for linux: mount /ramdisk

Post by Karsten M. Sel » Mon, 15 Feb 1999 04:00:00



> Here's a feature I would like--anyone else seen something like this:

> I would like to be able to mount a ram disk in the filesystem,
> somewhat like an Amiga ramdisk.

> # cat /etc/fstab
> /dev/hda6                  /                    ext2    defaults
> /dev/hda1                  /boot                ext2    defaults
> 8megs of physical memory   /mnt/ramdisk         ram     defaults

> # mount /mnt/ramdisk

> This would be terribly convenient.  Anyone else wondered about this?

I believe you'd have to create the filesystem, then mount the ramdisk.
This isn't something you can do automatically through your /etc/fstab
file, I'd make it part of my init.d sequence.  AFAIK, Linux defaults
ramdisks to 4 MB, I haven't messed around enough to find out how to
bypass this limitation.

For the poster (above) asking what the advantages of a ramdisk would be,
over, say, a cached disk partition, my understanding is:

 - A ramdisk is addressed as memory, not as a filesystem.  On a
   sufficiently volatile system, a given disk page will not remain in
   cache for long.

 - A ramdisk, OTOH, will be swapped out if system memory loads demand.
   This swapped image is _still_ addressed as memory, which is faster
   than the corresponding disk access.

....not that I've tested this myself, but that's the theory.

OTOH, a Sun E10K I used with 11GB RAM mounted as /tmp did perform fairly
spectacularly..... <g>

--

    What part of "Gestalt" don't you understand?
    Welchen Teil von "Gestalt" verstehen Sie nicht?

web:       http://www.netcom.com/~kmself
SAS/Linux: http://www.netcom.com/~kmself/SAS/SAS4Linux.html    

 11:01pm  up 3 days, 10:29,  6 users,  load average: 0.01, 0.08, 0.08

 
 
 

ramdisk for linux: mount /ramdisk

Post by oak » Tue, 16 Feb 1999 04:00:00


This, or some variation, should work - assuming you've
got ramdisk supportin the kernel:

# I don't know if this line is really neccessary
bash# dd if=/dev/zero of=/dev/ram0 bs=1k count=8192

# These are:
bash# mkfs.ext2 /dev/ram0 8192
bash# mount /dev/ram0 /mnt/ramdisk

Ramdisks are very helpful. I don't care how good memory management is it can
never guess what you are going to do. If you have a lot of files being
written to /tmp for example , every time you write a file there you access
the drive not only writing the data but also writing time stamps  and access
time. Another way to go is to keep things from being written to disk by
extending the update time....I'm planning on extending update to something
like an hour or so! I'm going to purchase a power backup first though.

-Tony

 
 
 

1. problem with creating ramdisk: kernel loads, but hangs when it tries to mount ramdisk

Hi,

I built a ramdisk root partition for redhat 5.2, but it seems to crash as
soon as the kernel jumps to the ramdisk.
The last message I see is:
    VFS: Mounted root (ext2 fileseystem).

I built the ramdisk according to the instructions in docs/bootdisks
(followed it precisely)

Basically, I zeroed /dev/ram, made it an ext2 file system, and then mounted
it on /mnt.
I then created /mnt/dev, /mnt/etc, /mnt/bin, /mnt/sbin, /mnt/lib, /mnt/usr,
and /mnt/var
I populated dev with cp -dpR /dev /mnt
I then copied most of the /bin and /sbin binaries into their respective
locations.  I issued an ldd /mnt/bin/init and copied all of the libraries
required by init.  I stripped out the debug information with objmove from
the libraries and maintained symbolic links.

I then unmounted /mnt and copied the contents of /dev/ram to a file with a
dd if=/dev/ram of=rootfs bs=1k
It said there was a read/write error at this step.  Not sure what caused the
error.

Could someone post a generic redhat 5.2 (intel) ramdisk root partition (one
that can be mounted by the kernel and contains basic binaries)?  I would
really like to try a ramdisk that I know is working.

Thanks,

Oscar Stiffelman

2. How to troubleshoot lan card problems.

3. - ramdisk.image.gz (0/78) Re: potato on beige G3: where is ramdisk?

4. Booting from CD-ROM?

5. init ramdisk vs. root ramdisk

6. RZ on Solaris

7. ramdisk driver initialized: 16 ramdisks of 4096K size

8. problem compiling libc

9. Q: RAMDISK, how to make use of a ramdisk specified in kernel Makefile

10. Can I set up a ramdisk as a mounted directory?

11. lilo.config to load hda1 to ramdisk & mount it as root fs?

12. Mount /etc on ramdisk (booting from HD)

13. Mount an uncompressed fs on ramdisk?