LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 11-11-2011, 09:33 AM   #1
liquidkaleidoscopes
LQ Newbie
 
Registered: Aug 2011
Posts: 27

Rep: Reputation: Disabled
Won't boot: /etc/rc.d/init.d/rc: line 193: /var/log/boot.log: Read-only file system


When I try to boot Linux from Scratch using an external U.S.B. hard drive, it encounters errors right as it is entering runlevel 3:

Code:
/etc/rc.d/init.d/rc: line 193: /var/log/boot.log: Read-only file system
/etc/rc.d/init.d/rc: line 194: /var/log/boot.log: Read-only file system

INIT: Entering runlevel: 3
Starting system log daemon.../lib/lsb/init-functions: line 636: /run/var/bootlog: No such file or directory
/lib/lsb/init-functions: line 569: /run/var/bootlog: No such file or directory
Starting kernel log daemon.../lib/lsb/init-functions: line 636: /run/var/bootlog: No such file or directory
Apparently, it is missing some directories, or can't make them in the first place. I think that my /etc/fstab looks ok; my computer has 8GB RAM, so I haven't bothered activating swap space yet:

Code:
# Begin /etc/fstab

# file system  mount-point  type   options         dump  fsck
#                                                        order

/dev/sdb3     /            ext4  defaults        1     1
#/dev/<yyy>     swap         swap   pri=1           0     0
proc           /proc        proc   defaults        0     0
sysfs          /sys         sysfs  defaults        0     0
devpts         /dev/pts     devpts gid=4,mode=620  0     0
tmpfs          /run         tmpfs  defaults        0     0
# End /etc/fstab
I am not sure what to do. My permissions for /run look ok (root has write access to it). I rechecked the section about configuring the boot scripts, but didn't see anything helpful there. I found reports of similar error messages on Google, but nothing in this context, and nothing that looked helpful.
 
Old 11-11-2011, 09:50 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

The main issue seems to be this:
Quote:
/etc/rc.d/init.d/rc: line 193: /var/log/boot.log: Read-only file system
/etc/rc.d/init.d/rc: line 194: /var/log/boot.log: Read-only file system
A read only filesystem. Have a look at the bottom of the rc script (D.1. /etc/rc.d/init.d/rc), the copy step doesn't work due to the read-only statud of /var.

The other errors are probably related to this.

Only thing I can come up with right now: Is the USB HD writeable (some have a hardware "switch" to make them read-only)?

Hope this helps.
 
Old 11-11-2011, 11:46 AM   #3
liquidkaleidoscopes
LQ Newbie
 
Registered: Aug 2011
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Hi,

The main issue seems to be this: A read only filesystem. Have a look at the bottom of the rc script (D.1. /etc/rc.d/init.d/rc), the copy step doesn't work due to the read-only statud of /var.

The other errors are probably related to this.

Only thing I can come up with right now: Is the USB HD writeable (some have a hardware "switch" to make them read-only)?

Hope this helps.
Thanks for your reply. The drive is definitely writeable; I've installed other distributions on it (such as Mandriva) without a problem. I did find that when I added 'rw' to the GRUB line, the boot process went slight further, though not much: I got an extra message about ksyslogd segfaulting. After I removed all the symlinks for ksyslogd from the rcx.d directories (and left 'rw' in the GRUB line), it actually brought me to a login prompt.

I logged in, and tried to check what was mounted. cat /etc/mtab and cat /proc/mounts returned nothing. That's weird... so I went into /proc and found that nothing was there. The same was true of /sys. So it's not mounting those, which is probably what's causing all these problems. I checked /etc/fstab, and I'm really not sure what (if anything) is wrong with it.
 
Old 11-11-2011, 12:27 PM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

You shouldn't have to add the rw option to grub. Normally the system is initially brought up in read only mode, to be re-mounted read-write at a later boot stage.

I do believe the error you posted is one of the symptoms of another problem that happened earlier in the boot process. Try booting to a prompt as you described and check the log files (might not be there due to the read-only problem ) and use the dmesg | more command to search for errors. We can only start guessing when there are no errors.

I'm assuming that you already checked for typo's and such in /boot/grub/grub.cfg and are reasonably sure you have a correct kernel configuration.

Hope this gets you going again.
 
Old 11-11-2011, 03:27 PM   #5
liquidkaleidoscopes
LQ Newbie
 
Registered: Aug 2011
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Hi,

You shouldn't have to add the rw option to grub. Normally the system is initially brought up in read only mode, to be re-mounted read-write at a later boot stage...
I think that the root of the problem, or at least a deeper layer of the problem, is that it's not mounting the filesystems in fstab. It knows to mount /dev/sdb3 as / because of GRUB, but since GRUB normally loads this as read-only (I think), and it doesn't mount per fstab, it doesn't know to remount it as read/write unless I specify to do so in GRUB.

Here is my dmesg: http://pastebin.com/N42ZaRYX . I didn't see any error messages that looked relevant here.

This is the GRUB entry (I didn't install GRUB 2 because I'm using my preinstalled GRUB. Also, loading the kernel 3.1 that I wrote specifically for L.F.S. from (hd1,0) (the external drive) makes no difference):

Code:
title Linux from Scratch
root (hd0,0)
kernel /boot/2639gentoor3b root=/dev/sdb3 rw rootdelay=3
I modified fstab a bit, but it still isn't working. Before, /dev/sdb3 was ext4. I thought that maybe there was a problem with it understanding some of the features that Gentoo was adding to the filesystem, so I compiled e2fsprogs in a temporary directory per 2.3 and ran './mke2fs -jv /dev/sdb3' to make it ext3 from that directory, but to no avail:

Code:
# <fs>			<mountpoint>	<type>		<opts>		<dump/pass>

/dev/sdb1		/boot		ext2		noauto,noatime	1 2
/dev/sdb2		none		swap		sw		0 0
/dev/sdb3		/		ext3		noatime		0 1
/dev/sr0		/mnt/cdrom	auto		noauto,ro,noexec,users	0 0
/dev/sr1		/mnt/cdrom1	auto		noauto,ro,noexec,users	0 0

proc			/proc		proc		defaults	0 0
sysfs			/sys		sysfs		defaults	0 0
devpts			/dev/pts	devpts		gif=4,mode=620	0 0
tmpfs			/run		tmpfs		defaults	0 0
Thanks for your help with sorting this out.

Major edit: I figured out the problem. /etc/inittab had an incorrect line in it. I changed line 5 to this:

Code:
si::sysinit:/etc/rc.d/init.d/rc S
Now it boots. I don't know how it ended up like that. Maybe I accidentally copied it from a different version of the LFS manual... I wonder what else could be wrong. I suppose that I'll find out.

Last edited by liquidkaleidoscopes; 11-11-2011 at 03:48 PM.
 
Old 11-11-2011, 03:54 PM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,
The output shown by dmesg points to a Gentoo kernel:
Quote:
Linux version 2.6.39-gentoo-r3 (root@x) (gcc version 4.6.1 (Gentoo 4.6.1-r1 p1.0, pie-0.4.5) )
That can't be correct....

I'm not sure what you are trying to do, but this:
Code:
title Linux from Scratch
root (hd0,0)
kernel /boot/2639gentoor3b root=/dev/sdb3 rw rootdelay=3
does not point to the LFS kernel you talked about:
Quote:
This is the GRUB entry (I didn't install GRUB 2 because I'm using my preinstalled GRUB. Also, loading the kernel 3.1 that I wrote specifically for L.F.S. from (hd1,0) (the external drive) makes no difference):
The LFS 3.1 kernel isn't used.

EDIT: You edited your post while I was replying....

Although I'm still not sure what it is you are doing, I'm glad to see you seem to have it fixed

Last edited by druuna; 11-11-2011 at 03:55 PM.
 
Old 11-11-2011, 08:53 PM   #7
liquidkaleidoscopes
LQ Newbie
 
Registered: Aug 2011
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Hi,The output shown by dmesg points to a Gentoo kernel: That can't be correct....
I'm sorry about the confusion. What I meant is that I've been using the kernel that I wrote for Gentoo, but that I also tried the kernel that I wrote per the L.F.S. guide, which is Linux 3.1, and that this didn't fix the problem, so I went back to the Gentoo kernel.

Thanks for your help
 
  


Reply

Tags
boot, grub, kernel, lfs



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
[SOLVED] /var/log/boot.log is empty in RHEL5.5. How to enable the boot log? rajivdp Linux - Newbie 1 08-12-2010 08:11 AM
/var/log/boot.log doesn't exist??? big_gie Fedora 5 05-17-2008 05:44 AM
Logging is not happening on my /var/log/boot.log Copain Linux - Security 2 09-28-2007 05:34 PM
/var/log/boot.log - fixing this, or what? jhwilliams Fedora 5 09-13-2007 05:15 PM
Does Linux write what happens at boot to a file ? I can't find anything in var/log . lostboy Linux - General 8 05-07-2003 02:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:29 PM.

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