LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-24-2004, 10:00 AM   #1
Rikra
LQ Newbie
 
Registered: Oct 2004
Location: Netherlands
Distribution: Debian
Posts: 18

Rep: Reputation: 0
Can't mount a ramdisk on startup


I want a 'ramdisk' on my server, so some temporary files can be stored in the RAM. I can create a ramdisk like this:

riksserver root # mke2fs -j /dev/ram0
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
2048 inodes, 8192 blocks
409 blocks (4.99%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
2048 inodes per group

Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
riksserver root # mount -t ext3 /dev/ram0 /ramdisk

And it works! But I want this to be done every time Linux boots.
So I put this in the fstab:

/dev/ram0 /ramdisk ext3 noatime 0 0

But of course it doesn't work, because /dev/ram0 needs to be created with an ext3 filesystem first.

How can I mount ram0 as ext3 every time I boot Linux?

I am using Gentoo Linux, btw.
 
Old 10-24-2004, 10:36 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
You could try writing a simple shell script with the commands as you've listed them (mke2fs followed by mount) and call the script from /etc/init.d/boot.local (or the Gentoo equivalent). It might be necessary to insert a sleep or wait command between the two, to give enough time for the first command to run to completion before calling the second.
However, the SuSE documentation says the boot.local script is run after boot and before going to the first runlevel. So, the script might cause the system to hang. I don't know. Be prepared to boot from cd or some such to edit the boot.local script to remove the call to the script if it does cause problems.

Last edited by bigrigdriver; 10-24-2004 at 10:37 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RAMDISK: couldn't find valid ramdisk image starting at 0. iotc247 Slackware 10 12-10-2010 03:08 PM
how do i mount ramdisk created with splashutils? jogurt666 Linux - General 1 09-30-2005 05:52 PM
Load Ramdisk at Startup mooreted Mandriva 4 02-06-2005 01:50 PM
creating a ramdisk runtime from another ramdisk code123 Linux From Scratch 0 10-11-2004 08:59 AM
mount everything to ramdisk alaios Linux - General 1 05-18-2004 08:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration