LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Won't boot: /etc/rc.d/init.d/rc: line 193: /var/log/boot.log: Read-only file system (http://www.linuxquestions.org/questions/linux-from-scratch-13/wont-boot-etc-rc-d-init-d-rc-line-193-var-log-boot-log-read-only-file-system-913016/)

liquidkaleidoscopes 11-11-2011 10:33 AM

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.

druuna 11-11-2011 10:50 AM

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.

liquidkaleidoscopes 11-11-2011 12:46 PM

Quote:

Originally Posted by druuna (Post 4521588)
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.

druuna 11-11-2011 01:27 PM

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.

liquidkaleidoscopes 11-11-2011 04:27 PM

Quote:

Originally Posted by druuna (Post 4521708)
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.

druuna 11-11-2011 04:54 PM

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 :)

liquidkaleidoscopes 11-11-2011 09:53 PM

Quote:

Originally Posted by druuna (Post 4521807)
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 :)


All times are GMT -5. The time now is 02:37 AM.