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. |
Quote:
It should be: Code:
/dev/sda6 / ext3 defaults 1 1 |
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.
|
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:
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) |
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?
|
Quote:
|
This is my host /etc/fstab:
Quote:
Quote:
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. |
This question is still unanswered:
Quote:
Code:
ls -l /mnt/lfs/dev/{console,null} |
Output of "ls -l /mnt/lfs/dev/{console,null} :
Quote:
Quote:
|
Quote:
Quote:
|
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.
|
Quote:
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? |
Now the output of "grep CONFIG_DEVTMPFS /mnt/lfs/boot/config-3.5.2" looks like:
Quote:
Quote:
|
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??) |
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. :/
|
Is the following the exact message that appears after booting?
Quote:
- Are you able to recall what was printed before the EXT3-fs (sda6): mounted filesystem with writeback data mode line? When you are logged in, are you able to execute the following command Code:
/bin/dmesg |
I just booted it again, and here are the lines that I am able to see while booting, before getting to bash-4.2#:
Quote:
|
Quote:
Code:
/bin/dmesg | /bin/more Although it is probably unrelated to your issue I do see one thing that can probably be disabled in the kernel: Quote:
|
I tried "/bin/dmesg | /bin/more", and there are awful lot of messages, I cannot write all of them here. As long as I understand there isn't anything interesting, the only difference from later is that now I have a message saying: "devtmpfs: initialized" and another saying that devtmpfs is mounted. If you could tell me what to look for, maybe can I search for it and tell you what I see.
|
You need to look for errors, warnings and messages that look out of place. I would start by focusing on disk related entries, which seem to be read-only.
You do have a minimal shell after the boot which might give you access to some commands. The following might give you an indication of what is going on: - error/warning related: Code:
dmesg | egrep -A2 -B2 -i "error|warn" Code:
dmesg | egrep -A2 -B2 -i "sd[a-z]|ext[234]|mount" Code:
df -h |
I did used the commands that you said, and here are some of the outputs:
For dmesg | egrep -A2 -B2 -i "error|warn", I got some of those and some others too, without any error or warning in the messages: Quote:
Quote:
Quote:
Quote:
|
Stepping through the boot sequence I just noticed this:
Quote:
|
I finished LFS before a week or so, and have already started with BLFS, I have already installed X Windows System and KDE. The point is that I was getting this read-only error before I had started with BLFS, meaning just when I finished with LFS, but didn't bother to solve it. Then continued with BLFS, and I'm still getting this error. So I already have started with BLFS. But I cannot start my graphical interface, while when I type "startx", I get the error regarding my read-only file system, it cannot write some files.
|
Quote:
Quote:
I assume you use the chrooted environment to build BLFS, which is wrong! You should build BLFS on top of LFS and not on top of your host (chrooted env uses the kernel and dev entries from your host and _not_ from LFS). Quote:
First finish building LFS! |
I already followed the book about LFS, when I finished it I managed to boot without any kernel panic, some of the commands like ls, cat were working, but I was still getting the problem regarding read-only file system, when I tried to create a file or directory. I don't know what you mean with finish LFS. I already booted. I can start from all over again, and I will get the same problem when I will finish LFS. The point is that I don't know how to solve this read-only file system problem.
|
So if you change this id:5:initdefault: to this id:3:initdefault: you still have the same issue?
Quote:
EDIT: Also remove this from your inittab: kd:5:respawn:/opt/kde/bin/kdm |
Yes, I get the same problem. And to be sure again, I changed it to 3, and deleted the line regarding kde. Restarted, it again boots, other commands are working but still cannot create a directory or file. Still getting the problem regarding read-only file system.
|
Quote:
I've re-read the posts in this thread an have a few questions: 1) You mention the following (p#1): Quote:
2) Besides the changes in the inittab file, did you make any other changes regarding boot scripts? I'm asking because the boot seems to execute /etc/rc.d/init.d/mountvirtfs (the VFS: Mounted root (ext3.... line) and shortly after that you're given the minimal shell, without an error/warning. modules, udev and swap don't seem to be executed (and all that follows). You might want to revisit chapters 7.6, 7.7 and 7.12 Quote:
|
1) The small changes that I mean are, that I added support for udev as the book says, and enabled some graphic and input hardware support, regarding my laptop.
2) As long as I recall I didn't make any changes regarding boot scripts. I installed bootscripts in 7.6 as it says, then in section 7.7, I created the inittab exactly as it is written there, you can also see it in the earlier posts. And in section 7.12, I didn't do any changes to my rc.site file, because I think it was the same as the one already created during my LFS installation. I don't also recall any error messages during my LFS build, even the test results were similar like existing LFS test logs. I build it twice, and got the same problem. I don't know where I make mistake(s). But this is driving me crazy. One off-topic question: When I start building LFS and when I have to mount my ext3 filesystem to /mnt/lfs, should I just use mount command for it? Or I should also add it to my host /etc/fstab file? While as long as I know if I don't mount it using my host /etc/fstab file, my partition will be unmounted from /mnt/lfs whenever I restart my computer. |
Quote:
Quote:
Once you reach chapter 6 you also need to remount certain stuff if you stop/start (reboot) (chapters 6.2.2 and 6.2.3) and use the correct chroot command (this one: 6.4. Entering the Chroot Environment or for chapter 7 and on: 6.65. Cleaning Up) BTW: You never answered this question: error: no file found |
Sorry for my last post, I wrote udev but I meant devtmpfs, which is said in section 8.3. Thanks for answering my off-topic questions, because I always mount my LFS entry to my host /etc/fstab. On the other hand about the question that I had posted a few months before. I had forgotten to mount my LFS system at the beginning (what a shame! :().
Edit: One thing that came to my mind now, one thing that I didn't do while going through LFS 7.2 book is in section 8.4, using GRUB to set up the boot process. I have dual-booted my laptop with Windows 7 and Linux Ubuntu, and I already have Grub 2.0 on my system. So I thought that because I already have Grub 2.0, I don't need to reinstall it, and that's why in section 8.4, where it says to use "grub-install /dev/sda", I skipped that part, and didn't execute that command, meaning I didn't installed grub. Can it be a problem? |
Hi
As you have added you lfs to ubuntu grub. Would it be an idea to boot lfs from grub prompt, Any thoughts Druuna sorry to but in. |
Quote:
You've choosen for the one that came with your host so you do not do the grub parts in the LFS book (use your host to add an entry for LFS, which you did). Just to make sure, can you post the LFS related grub.cfg entry? Quote:
|
This is the part regarding LFS in my host machines grub.cfg:
Quote:
|
Quote:
Why is the init=/bin/bash part there? It shouldn't be. This explains the lack of errors, the read-only FS and the minimal shell. Is my assumption correct that you added this entry by hand? If so, let ubuntu do the work with the update-grub command (must be root). |
Yes, I added that command by hand. Should I delete it and try booting my LFS, or should I just do update-grub without making any chance to my host grub.cfg, and then try booting my LFS?
|
Quote:
|
Thank you very much druuna. I really appreciate it. You saved my day!
After doing update-grub, my host machines grub.cfg changed to: Quote:
|
You can (re)set password for a user as root with the following command:
Code:
passwd username - above the first post -> Please Mark this thread as solved if you feel a solution has been provided. - -or- - - first post -> Thread Tools -> Mark this thread as solved |
All times are GMT -5. The time now is 05:29 AM. |