# Root filesystem could not be mounted read/write

## bob doe

Hey guys, I make my own LiveCD and have been for a year and a half now, and Im having a problem on the latest version.  It wont boot.  Various ebuild updates were made to this version including a new kernel (from 2.6.30-r6 to 2.6.31-r6) and ebuilds of note being going from sys-fs/device-mapper to sys-fs/udev

I've tried going back to the previous kernel but no dice.  My only thinking might be the move from device-mapper to udev but Im not sure.  Sometime last year I had a similar problem going for any kernels above 2.6.27, I finally "solved" that by removing 'cdroot' from Grub's menu.lst kernel parameters.  Even tweaking things in Grub didnt help.

Im stuck and I'd appreciate any help.  What follows is the boot process for the LiveCD, and the boot options for Grub.

You can see the kernel config http://linuxfly.net/knowledge/configs/kernel_config and Grub's menu.lst http://linuxfly.net/knowledge/configs/menu.lst.  Also, the init script that is part of the initramfs (before the actual booting takes place) is http://linuxfly.net/knowledge/scripts/init

```

* Mounting proc at /proc ...

* Mounting sysfs at /sys ...

* Mounting /dev

* Starting udevd ...

* Populating /dev with existing devices through uevents ...

* Waiting for uevents to be processed ...

* Mounting devpts at /dev/pts ...

* Skipping root filesystem check (fstab's passno == 0) ...

* Remounting root filesystem read/write ...

* Root filesystem could not be mounted read/write :(

Give root password for maintenance

(or type Control-D to continue):
```

```
kernel /boot/vmlinuz root=/dev/ram0 rw quiet

initrd /boot/initramfs.igz
```

Any help greatly appreciated  :Smile: 

Cheers,

----------

## cach0rr0

I don't know if this would be of any significance to you 

```

[ebuild     U ] sys-fs/lvm2-2.02.56-r1 [2.02.36] USE="lvm1 readline static (-clvm) (-cman) (-selinux)" 804 kB

[blocks B     ] sys-fs/device-mapper ("sys-fs/device-mapper" is blocking sys-fs/lvm2-2.02.56-r1)

Total: 2 packages (2 upgrades, 2 uninstalls), Size of downloads: 4,243 kB

Conflict: 3 blocks (1 unsatisfied)

 * Error: The above package list contains packages which cannot be

 * installed at the same time on the same system.

  ('ebuild', '/', 'sys-fs/lvm2-2.02.56-r1', 'merge') pulled in by

    lvm2

For more information about Blocked Packages, please refer to the following

section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked

```

AFAIK the device-mapper stuff is handled internally within the lvm2 package - not sure if what you're encountering is related.

----------

## bob doe

The block I was getting wasnt related to lvm, however lvm is installed with the same USE flags as you.

The block I had (when updating the LiveCD from 0.7.0 to the 0.7.1 update Im trying to release) was this:

```
[blocks B     ] sys-fs/device-mapper ("sys-fs/device-mapper" is blocking sys-fs/udev-146-r1)

Total: 172 packages (150 upgrades, 14 new, 1 in new slot, 7 reinstalls), Size of downloads: 180,373 kB

Conflict: 7 blocks (1 unsatisfied)

 * Error: The above package list contains packages which cannot be

 * installed at the same time on the same system.

  ('ebuild', '/', 'sys-fs/udev-146-r1', 'merge') pulled in by

    >=sys-fs/udev-096 required by ('installed', '/', 'net-wireless/acx-firmware-20060207', 'nomerge')

    sys-fs/udev required by ('installed', '/', 'sys-block/gparted-0.4.5', 'nomerge')

    >=sys-fs/udev-096 required by ('installed', '/', 'net-wireless/ipw2200-firmware-3.0', 'nomerge')

    (and 2 more)

  ('installed', '/', 'sys-fs/device-mapper-1.02.24-r1', 'nomerge') pulled in by

    sys-fs/device-mapper required by ('installed', '/', 'app-crypt/truecrypt-6.2a', 'nomerge')
```

----------

## bob doe

*bump*

I'd appreciate some help guys!

Merry Christmas

----------

## bob doe

*bump*

Now that the SquashFS issue has been resolved (although Im not sure what caused the change, udev perhaps?), Im back to the original problem.  Im willing to bet this too is udev's fault..

See here for the SquashFS problem: https://forums.gentoo.org/viewtopic-p-6135676.html#6135676

Any help on this greatly appreciated, as until this is solved, I cant continue working on my LiveCD!!

----------

## cach0rr0

so wait, did you get udev upgraded or not? 

that part is key - if you need device-mapper for something like truecrypt or cryptsetup, it is now provided by the lvm2 ebuild, so you would unmerge device-mapper, emerge lvm2 and udev

----------

## bob doe

During a Portage sync and subsequent world update, device-mapper was listed as a 'B' block to udev, as per my previous posting:

```
[blocks B     ] sys-fs/device-mapper ("sys-fs/device-mapper" is blocking sys-fs/udev-146-r1) 

Total: 172 packages (150 upgrades, 14 new, 1 in new slot, 7 reinstalls), Size of downloads: 180,373 kB 

Conflict: 7 blocks (1 unsatisfied) 

 * Error: The above package list contains packages which cannot be 

 * installed at the same time on the same system. 

  ('ebuild', '/', 'sys-fs/udev-146-r1', 'merge') pulled in by 

    >=sys-fs/udev-096 required by ('installed', '/', 'net-wireless/acx-firmware-20060207', 'nomerge') 

    sys-fs/udev required by ('installed', '/', 'sys-block/gparted-0.4.5', 'nomerge') 

    >=sys-fs/udev-096 required by ('installed', '/', 'net-wireless/ipw2200-firmware-3.0', 'nomerge') 

    (and 2 more) 

  ('installed', '/', 'sys-fs/device-mapper-1.02.24-r1', 'nomerge') pulled in by 

    sys-fs/device-mapper required by ('installed', '/', 'app-crypt/truecrypt-6.2a', 'nomerge')
```

The previous version of my LiveCD had the following (amongst other packages):

 *Quote:*   

> [I] sys-fs/device-mapper (1.02.24-r1
> 
> [I] sys-fs/udev (141

 

The current version (which Im having problems with) has these:

 *Quote:*   

> [I] sys-fs/lvm2 (2.02.56-r2
> 
> [I] sys-fs/udev (146-r1

 

sys-fs/device-mapper was listed as a 'B' block to sys-fs/udev-146-r1 and thus wasnt included.  Im not sure at all if that is even the reason why my LiveCD fails to boot, but its the only lead I have.

----------

## cach0rr0

if you're on 2.0.2.56-r2 of lvm2, then no, you should not be missing any of the device-mapper stuff.  

With that said, I honestly wouldn't have any ideas - I am assuming you are hitting the *exact* same error, to the letter, when booting your system. 

I've not tried making my own livecd, so I'm no help there. I will say normally with an initramfs setup as you have, grub should have a root=/dev/ram0 AND a real_root=/dev/blah

But again, not having made a livecd myself, no idea if this is relevant in your case.

----------

## bob doe

My system has been running for 478 days, Im not sure what to expect if ever I had to reboot it.  Previous versions of the LiveCD booted "fine".  The very first versions booted fine, then during a kernel upgrade from 2.6.25 to higher (2.6.27 at the time) the LiveCD would refuse to boot as per http://www.criticalsecurity.net/index.php/topic/31538-big-release-in-terms-of-how-fly-is-made/page__hl__cdroot__fromsearch__1

Removing the 'cdroot' option from the Grub boot line solved that, and although the LiveCD kept booting, it would give warning during boot that the kernel modules werent read-write, but the remaining boot was fine.

Now, going from 2.6.30 to 2.6.31 and as well as this lvm2 and udev stuff, it fails to boot entirely.

I did try the Grub options as per http://en.gentoo-wiki.com/wiki/Build_Your_Own_LiveCD_or_LiveDVD#Installing_and_configuring_the_CD_bootloader as well as a combination, but that never did anything.

If you wish to try, the current test version is 0.7.0 available here http://www.linuxfly.net/data/current/ and I uploaded the broken version as 0.7.1f available http://www.linuxfly.net/FLY-0.7.1f.iso

----------

## bob doe

Making some progress on this.  After a bunch of Googling I found that the script responsible for this is /etc/init.d/checkroot  After talking on #gentoo with 'Skunky' he suggested removing checkroot and checkfs from the 'boot' runlevel, where the symlinks are.  So I did, and this didnt change anything (strangely enough).  He then suggested removing the scripts themselves from /etc/init.d/  So I tried that and the error disapeared but was replaced by several other warnings that checkroot couldnt be found.  Overall, the LiveCD booted, though improperly.  For instance, I didnt have the proper hostname, and SLiM xdm would send me to xorg instead of Fluxbox.

After poking around I found that /sbin/rc listed checkroot as a 'critical_service' in a variable on line 169.  I removed it from there and tried again, this time keeping checkroot and checkfs in /etc/init.d/ but removing the symlinks for the 'boot' runlevel.  It appeared to boot fine but gave the same error "root filesystem could not be mounted read/write" later in the boot sequence.

Im at a loss as to where to look next.  I have a feeling if I really start to rip apart the scripts that I can solve this, but Im sure it wont be a proper fix at all.

The root cannot be mounted read/write, as it's a SquashFS image.  Always has been this way, and Im still not sure why its only now starting to cause issues.

Still looking for help please!

----------

## bob doe

*bump* still looking for help guys!  Thanks

----------

## bob doe

Ok I think Im zeroing in on the cause of the problem, but not the problem itself yet  :Sad: 

During bootup, the /etc/init.d/checkroot script is being called.  Countless times it seems.  checkroot tries to remount root as read/write which in the case of a LiveCD is impossible as root is a SquashFS image mounted on /dev/loop0

Im not sure why, but previously there was never an issue, now there is.  Checkroot cant remount root to read/write and so fails and gives the "login as root or press Control-D to continue".  Although I know the proper solution isnt to remove checkroot from the boot process, given that this is a LiveCD I see no need to have it there anyways.  So I've been trying to remove it.

Removing /etc/init.d/checkroot itself simply causes a whole lot of boot errors complaining that checkroot doesnt exist so its not that easy.  I've already removed checkroot from the boot runlevel startups with 'rc-update del checkroot boot' but that didnt change anything.  I found several references to checkroot in /sbin/rc at lines 169, 441 and 455.  I removed the references there but checkroot still gets run, which causes it to still try and mount root read/write which it cant, and thus fails the boot.

So, how can I once and for all get rid of checkroot??

----------

## zoltak

Bump!

Same issue here booting off a ramfs!

It just pauses when trying to remount the rootfs read only!

----------

