LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-14-2006, 11:47 PM   #1
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Rep: Reputation: 45
booting read only - how do I load /dev files in ramdisk?


I'm trying to boot my system in ro, but for the system to boot correctly /var and /dev need to be loaded into a ramdisk. I was able to get /var loaded into the ramdisk by copying the directory to /lib/var then adding the following lines to the beginning of my rc.S
Code:
echo "Loading /var to ramdisk"
mke2fs -q -I 1024 /dev/ram1 4096
mount /dev/ram1 /var -o defaults,rw
cp -a /lib/var /
The system will boot (if you don't mind all the errors about not being able to write to /dev) and when I log in, /var is sucsessfully loaded into the ramdisk.

So then I try to do the same thing with /dev
Code:
echo "Loading /dev to ramdisk"
mke2fs -q -I 1024 /dev/ram2 1024
mount /dev/ram2 /dev -o defaults,rw
cp -a /lib/dev /
Now the system will no longer boot. It get's though all the kernel stuff, but when it starts trying to work with the devices, the system hangs and I have to hit "oops" button on my computer.

I'm not sure if I'm doing this right, I got the instructions from some old documentation on creating a live CD that I tried to apply to what I'm doing. The tutorial recommended using devfs to load /dev into a ramdisk but I guess this is now obsolete.

Any suggestions?

Thanks!
...drkstr

**edit**
I rebooted to my ro test partition to try and get some usefull kernel mesages. Forgive me for paraphrazing, I didn't want to write down the entire demesg verbatim.

Code:
Uncompressing Kernel... OK booting
<bunch of kernel crap>
Ramdisk driver initialized: 16 Ram disks of 7777K size 1024 block size
<more kernel crap>
loop loaded (max 8 devices)
Warning: unable to open initial console
<just a little more crap then...>
SCSI0: SCSI host adapter emulation for IDE ATAPI devices
<Kernel dies!>
**edit again**
I forgot to mention that I'm using 2.4.31 kernel for the ro boot.

Last edited by drkstr; 07-15-2006 at 12:21 AM.
 
Old 07-15-2006, 11:55 AM   #2
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
You might try manually creating the devices you need for your initrd image:

Code:
echo "    ** Device nodes..."
mknod initrd/dev/console c 5 1
mknod initrd/dev/null c 1 3
mknod initrd/dev/ram b 1 1
mknod initrd/dev/systty c 4 0
mknod initrd/dev/tty c 5 0

LOOP=63
while [ $LOOP -ge 0 ]; do
	mknod initrd/dev/tty$LOOP c 4 $LOOP
	let LOOP--
done

LOOP=255
while [ $LOOP -ge 0 ]; do
	mknod initrd/dev/loop$LOOP b 7 $LOOP
	let LOOP--
done
Also, I could be wrong, but using SCSI emulation for the CD-ROM drive isn't a bad thing -- and I think that is what the last kernel message you posted is about.
 
Old 07-18-2006, 03:09 PM   #3
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
You might try manually creating the devices you need for your initrd image:
Thanks for the suggestion. I tried thinking this through a little more and realized I was going about it the wrong way. I was trying to use a ramdisk to bring my devices up, but I need the devices in order to use the ramdisk. I was finally able to get it working using an initrd method and using the apropriate options in my lilo.conf.

Quote:
Also, I could be wrong, but using SCSI emulation for the CD-ROM drive isn't a bad thing -- and I think that is what the last kernel message you posted is about.
I agree, this was just the last message I got before the system stopped booting.

Thanks again!
...drksr
 
Old 07-19-2006, 01:45 AM   #4
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
Quote:
Originally Posted by drkstr
Thanks for the suggestion. I tried thinking this through a little more and realized I was going about it the wrong way. I was trying to use a ramdisk to bring my devices up, but I need the devices in order to use the ramdisk. I was finally able to get it working using an initrd method and using the apropriate options in my lilo.conf.
Hmmm, I think I was a little tired when I typed that. I neglected to say that it was part of my initrd creation script -- not the boot script

Hope everything is working!
 
Old 07-19-2006, 01:56 AM   #5
drkstr
Senior Member
 
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191

Original Poster
Rep: Reputation: 45
Quote:
Hmmm, I think I was a little tired when I typed that. I neglected to say that it was part of my initrd creation script -- not the boot script

Hope everything is working!
No problem, I was able to figure it out eventually. I copied the the basic devices you created in your script from /dev to /<initrd root>/dev before creating the initrd, and it seems to work OK. Your post got me thinking in the right direction at least.

best regards,
...drkstr
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting from a USB key (flash disk) without using Ramdisk idamlaj Linux - Software 2 11-29-2006 12:25 AM
the size limit of LILO to load a ramdisk golien Linux - General 0 03-31-2005 12:32 AM
Load Ramdisk at Startup mooreted Mandriva 4 02-06-2005 01:50 PM
Slow booting ramdisk (isolinux) Dark Carnival Linux - General 1 11-09-2004 04:07 PM
Mandrake 10 installation cant load program into ramdisk Pimptillo Mandriva 3 04-01-2004 10:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04: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