LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS 7.2: Read-only file system error (http://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-7-2-read-only-file-system-error-4175440578/)

erkant 12-08-2012 08:18 AM

LFS 7.2: Read-only file system error
 
I have created LFS 7.2 using the book, and it successfully boots up, but when I try to create a new file or directory, I cannot, while it says that my file system is read-only. Although I can list the files and directories, change the directory or so. How can I overcome this? Below you can find the last few lines while my LFS system is booting up:

EXT3-fs (sda6): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) readonly on device 8:6.
Freeing unused kernel memory: 452k freed
Write protecting the kernel text: 7812k
Write protecting the read-only data: 2344k
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
bash-4.2#

And for example, if I try to create a new directory I get the following error message:

bash-4.2# mkdir test
mkdir: cannot create directory 'test': Read-only file system

For your knowledge, I have created my kernel using "make defconfig" command, and just did a few small changes to the default configuration. I'm using ext3 file system, mounted in /dev/sda6. Also in my /etc/fstab I have the following line:

/dev/sda6 /mnt/lfs ext3 defaults 1 1

If you could help me overcome the problem, I would be glad.

druuna 12-08-2012 08:25 AM

Quote:

Originally Posted by erkant (Post 4845154)
For your knowledge, I have created my kernel using "make defconfig" command, and just did a few small changes to the default configuration. I'm using ext3 file system, mounted in /dev/sda6. Also in my /etc/fstab I have the following line:

/dev/sda6 /mnt/lfs ext3 defaults 1 1

That doesn't look correct. There is no /mnt/lfs when you boot into lfs.

It should be:
Code:

/dev/sda6    /    ext3    defaults    1    1
(mentioned here)

erkant 12-08-2012 08:51 AM

That's the /etc/fstab of my host machine. In my LFS system's /etc/fstab file it is exactly as you have provided. I will try to delete that line from my host machine's /etc/fstab, and try to boot like that, but I don't know whether whether it will boot, whether it will be able to find my kernel. Because if my mount my /mnt/lfs just using the mount command from my host machine, it won't be there when I restart my PC, so I don't know whether it will find the kernel.

druuna 12-08-2012 09:04 AM

No need to tinker with your host at this point. The problem is lfs related.

I personally think you are missing some kernel options based on this: [SOLVED] LFS: Error during Linux-3.5.2 kernel compilation and this:
Quote:

I have created my kernel using "make defconfig" command, and just did a few small changes to the default configuration.
We might be able to point you in the right direction if you post more of the boot messages (as much as possible up to the read-only prompt).

BTW: Have you seen this post: [SOLVED] Booting stops after kernel starts. Related and also mentions a kernel option.

EDIT: Are you 100% sure that this kernel option is set: Maintain a devtmpfs filesystem to mount at /dev (mentioned in the LFS book and not set by make defconfig)

erkant 12-08-2012 11:19 AM

I checked that Booting stops after kernel starts thread, but I couldn't find something useful for me. I'm sure that devtmpfs filesystem is mainted. Can the fact that I have in my host /etc/fstab used my /mnt/lfs as a mount point cause the problem?

druuna 12-08-2012 11:24 AM

Quote:

Originally Posted by erkant (Post 4845242)
Can the fact that I have in my host /etc/fstab used my /mnt/lfs as a mount point cause the problem?

Not if you are talking about your hosts fstab file. As stated before: No need to tinker with your host at this point. The problem is lfs related.

erkant 12-08-2012 11:35 AM

This is my host /etc/fstab:

Quote:

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda4 during installation
UUID=a7e0dedf-5ffb-4851-a76f-2cd10b83bf81 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=9777ecf8-8991-4fc4-9798-5451a1d9b8c3 none swap sw 0 0
/dev/sda6 /mnt/lfs ext3 defaults 1 1
And this is my LFS /etc/fstab

Quote:

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

/dev/sda6 / ext3 defaults 1 1
/dev/sda5 swap swap pri=1 0 0
proc /proc proc nosuid,noexec,nodev 0 0
sysfs /sys sysfs nosuid,noexec,nodev 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /run tmpfs defaults 0 0
devtmpfs /dev devtmpfs mode=0755,nosuid 0 0
(of course both with spacing, I don't know why I cannot get the spacings here)
I don't know what it can be LFS related, maybe something in the kernel, but I don't know how can I show you the full kernel booting log.

druuna 12-08-2012 11:35 AM

This question is still unanswered:
Quote:

Originally Posted by druuna
We might be able to point you in the right direction if you post more of the boot messages (as much as possible up to the read-only prompt).

Can you also post the output of the following commands (from your host, lfs mounted under /mnt/lfs):
Code:

ls -l /mnt/lfs/dev/{console,null}

grep CONFIG_DEVTMPFS /mnt/lfs/boot/config-3.5.2

cat /mnt/lfs/etc/fstab posted while replying


erkant 12-08-2012 11:41 AM

Output of "ls -l /mnt/lfs/dev/{console,null} :

Quote:

crw------- 1 root root 5, 1 Dec 1 18:49 /mnt/lfs/dev/console
crw-rw-rw- 1 root root 1, 3 Dec 1 18:49 /mnt/lfs/dev/null
Output of "grep CONFIG_DEVTMPFS /mnt/lfs/boot/config-3.5.2 :

Quote:

CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set

druuna 12-08-2012 11:48 AM

Quote:

Originally Posted by erkant (Post 4845259)
Output of "grep CONFIG_DEVTMPFS /mnt/lfs/boot/config-3.5.2 :
Code:

CONFIG_DEVTMPFS=y
# CONFIG_DEVTMPFS_MOUNT is not set


Quote:

Originally Posted by erkant
I'm sure that devtmpfs filesystem is mainted.

You are wrong. Maintain a devtmpfs filesystem to mount at /dev is _not_ set.

erkant 12-08-2012 11:50 AM

As long as I remember, when I made "make defconfig", I then did "make menuconfig", loaded the default config, and checked that options, but I will try to do it again, and tell you the result.

druuna 12-08-2012 12:07 PM

Quote:

Originally Posted by erkant (Post 4845266)
As long as I remember, when I made "make defconfig", I then did "make menuconfig", loaded the default config, and checked that options, but I will try to do it again, and tell you the result.

I might have jumped the gun......

CONFIG_DEVTMPFS=y --> Maintain a devtmpfs filesystem to mount at /dev is set (sorry about that!!)
CONFIG_DEVTMPFS_MOUNT --> is not set.

Try setting the CONFIG_DEVTMPFS_MOUNT

Also: what does your /mnt/lfs/etc/inittab look like?

erkant 12-08-2012 12:26 PM

Now the output of "grep CONFIG_DEVTMPFS /mnt/lfs/boot/config-3.5.2" looks like:

Quote:

CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
And /mnt/lfs/etc/inittab looks like this:

Quote:

# Begin /etc/inittab

id:5:initdefault:

si::sysinit:/etc/rc.d/init.d/rc S

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin

1:2345:respawn:/sbin/agetty --noclear tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600

# End /etc/inittab
kd:5:respawn:/opt/kde/bin/kdm

druuna 12-08-2012 12:34 PM

The inittab file looks OK.

Guess you are ready to reboot again (you did compile/place the kernel and not just set the option using make menuconfig as described in 8.3.1??)

erkant 12-08-2012 12:37 PM

I edited the kernel config file to make CONFIG_DEVTMPFS_MOUNT=y and then recompiled and placed everything where they belong. But again I cannot create file or directory. Still seeing the error message, regarding read-only file system. :/


All times are GMT -5. The time now is 04:11 AM.