Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-user] ext4 root-partition mounted read-only as "type none"

129 views
Skip to first unread message

Holger Wünsche

unread,
Sep 14, 2016, 12:20:03 PM9/14/16
to
I installed gentoo bun ran into some problems:
- the root-partition is read-only but shown as read-write when directly booting into gentoo,
- the type of the root-partition is "none",
- when only mounting the root-partition using a gentoo live-cd all other partitions are shown as mounted too and
- neither /dev, /proc, sys, run nor /tmp are mounted.

The setup is the following:
sda3 / ext4
sda2 /boot vfat
sdc1 /home ext4
sdc2 /var ext4

The system is booted via UEFI without bootloader. The kernel has a build-in initramfs and following arguments:
root=/dev/sda3 rootfstype=ext4

The root-partition can not be remounted (I don't get an error, but the output of mount doesn't change).





Holger Wünsche

J. Roeleveld

unread,
Sep 14, 2016, 1:10:02 PM9/14/16
to
Does the output of
# cat /proc/mtab
Change after remounting rw?

Also, how did you build the initramfs?
If using a tool, provide full commandline.

If done manually, please provide your method.

--
Joost
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Holger Wünsche

unread,
Sep 14, 2016, 2:20:03 PM9/14/16
to
On 14 September 2016 19:04:23 CEST, "J. Roeleveld" <jo...@antarean.org> wrote:
>On September 14, 2016 6:18:52 PM GMT+02:00, "Holger Wünsche"
><diegolde...@gmail.com> wrote:
>>I installed gentoo bun ran into some problems:
>>[…]
>
>Does the output of
># cat /proc/mtab
>Change after remounting rw?

Since I can not find /proc/mtab I assume you mean /etc/mtab.
# cat /etc/mtab
/dev/sdc1 /home ext4 rw 0 0
/dev/sdc2 /var ext4 rw 0 0
/dev/sda3 / none rw 0 0
/dev/sda2 /boot vfat rw 0 0

(output formatted for readability)


>
>Also, how did you build the initramfs?
>If using a tool, provide full commandline.
>
>If done manually, please provide your method.
>

For generating the initramfs I loosely followed the "Configuring the Linux kernel" chapter of the handbook, as well as the "EFI stub kernel" Wiki-page:
# genkernel --no-compress-initramfs --install initramfs

The initramfs gets compiled into the kernel via CONFIG_BLK_DEV_INITRD (CONFIG_INITRAMFS_SOURCE).



Since the root-partition is mounted read-only I can't provide any log files. Also despite not shown /dev, /proc and /sys seem to be populated, but emerge doesn't seem to be happy with it:
# emerge
Failed to validate a sane '/dev'
bash process sibstitution doesn't work; this may be an indication of a broken '/dev/fd'




Holger Wünsche

J. Roeleveld

unread,
Sep 14, 2016, 3:30:04 PM9/14/16
to
On September 14, 2016 8:10:03 PM GMT+02:00, "Holger Wünsche" <diegolde...@gmail.com> wrote:
>On 14 September 2016 19:04:23 CEST, "J. Roeleveld" <jo...@antarean.org>
>wrote:
>>On September 14, 2016 6:18:52 PM GMT+02:00, "Holger Wünsche"
>><diegolde...@gmail.com> wrote:
>>>I installed gentoo bun ran into some problems:
>>>[…]
>>
>>Does the output of
>># cat /proc/mtab
>>Change after remounting rw?
>
>Since I can not find /proc/mtab I assume you mean /etc/mtab.
># cat /etc/mtab
>/dev/sdc1 /home ext4 rw 0 0
>/dev/sdc2 /var ext4 rw 0 0
>/dev/sda3 / none rw 0 0
>/dev/sda2 /boot vfat rw 0 0
>
>(output formatted for readability)

Sorry, might be /proc/mounts.
Am typing this on my phone, so can't double check.

What does your /etc/fstab look like?

>>Also, how did you build the initramfs?
>>If using a tool, provide full commandline.
>>
>>If done manually, please provide your method.
>>
>
>For generating the initramfs I loosely followed the "Configuring the
>Linux kernel" chapter of the handbook, as well as the "EFI stub kernel"
>Wiki-page:
># genkernel --no-compress-initramfs --install initramfs
>
>The initramfs gets compiled into the kernel via CONFIG_BLK_DEV_INITRD
>(CONFIG_INITRAMFS_SOURCE).
>
>
>
>Since the root-partition is mounted read-only I can't provide any log
>files. Also despite not shown /dev, /proc and /sys seem to be
>populated, but emerge doesn't seem to be happy with it:
># emerge
>Failed to validate a sane '/dev'
>bash process sibstitution doesn't work; this may be an indication of a
>broken '/dev/fd'

Silly question, but just to be sure.
You have followed the handbook from A to Z and haven't skipped anything?

Holger Wünsche

unread,
Sep 14, 2016, 4:40:03 PM9/14/16
to
>Sorry, might be /proc/mounts.

# cat /proc/mounts
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
udev /dev devtmpfs rw,nosuid,nodev,noexec,relatime 0 0
devpts /dev/pts devpts rw,nosuid,relatime,gid=5,mode=620 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
/dev/sda3 / ext4 ro,relatime,data=ordered 0 0
selinuxfs /sys/fs/ selinux selinuxfs rw,relatime 0 0
tmpfs /run tmpfs rw,nodev,relatime,size=3277012k,mode=755 0 0
# mount -t ext4 -o remount,rw /dev/sda3
# cat /proc/mounts
[…]
/dev/sda3 / ext4 rw,relatime,data=ordered 0 0
[…]

So /proc/mounts is the file giving the correct information. As we can see /dev, /proc, /sys, /run are existing and mounted as planned (but maybe not fully populated?). But we can also see no other partitions are mounted. Strange is the output of mount ans lsblk both before and after remounting of /dev/sda3:
# mount
/dev/sdc1 on /home type ext4 (rw)
/dev/sdc2 on /var type ext4 (rw)
/dev/sda3 on / type none (rw)
/dev/sda2 on /boot type vfat (rw)
# lsblk (shortened)
sda2 /boot
sda3 /
sdc1 /home
sdc2 /var

Clearly this is not the case, since all directories exist without beeing mounted.Therefore some (important files are missing).



>Am typing this on my phone, so can't double check.

You got the right file :)



>What does your /etc/fstab look like?

condensed output of
# cat /etc/fstab
/dev/sda2 /boot vfat defaults,ro 1 2
/dev/sda3 / ext4 defaults 0 1
/dev/sdb2 none swap sw 0 0
/dev/sdc1 /home ext4 defaults 0 0
/dev/sdc2 /var ext4 defaults 0 0

/etc/fstab isn't beautiful, because I have done some trial and error here (not the best idea I know).



>Silly question, but just to be sure.
>You have followed the handbook from A to Z and haven't skipped
>anything?

To be honest: I did not read everything this time, because I installed a somewhat working version yesterday. That time I read it all, but I copied to much from an older install (since this is a reinstall after a software upgrade), so the previous attempt did not work to well (quite some permission problems and some other small copy&paste errors). So this time O did it all again without copy&paste. The result is I skipped formating, because I just wiped the partitions from the live-cd. But I do not think I forgot something (*but* it could have happened).



P.S.: I think I will learn a lot here, but if it takes too much of your time or you don't have an idea, it would not be the a huge problem for me to make yet an other install and hope it will work.




Holger Wünsche

Rich Freeman

unread,
Sep 14, 2016, 4:50:03 PM9/14/16
to
On Wed, Sep 14, 2016 at 12:18 PM, Holger Wünsche
<diegolde...@gmail.com> wrote:
> I installed gentoo bun ran into some problems:
> - the root-partition is read-only but shown as read-write when directly booting into gentoo,
> - the type of the root-partition is "none",
> - when only mounting the root-partition using a gentoo live-cd all other partitions are shown as mounted too and
> - neither /dev, /proc, sys, run nor /tmp are mounted.
>

How many of these problems are replaced simply by replacing /etc/mtab
with a symlink to /proc/self/mounts?

ie
rm /etc/mtab
ln -s /proc/self/mount /etc/mtab

--
Rich

Mike Gilbert

unread,
Sep 14, 2016, 4:50:04 PM9/14/16
to
On Wed, Sep 14, 2016 at 4:31 PM, Holger Wünsche
<diegolde...@gmail.com> wrote:
> So /proc/mounts is the file giving the correct information.

Your issue is that /etc/mtab is stale. Recent versions of OpenRC
recommend that you replace it with a symlink to /proc/self/mounts.

Holger Wünsche

unread,
Sep 14, 2016, 5:10:03 PM9/14/16
to
On 14 September 2016 22:42:06 CEST, Rich Freeman <ri...@gentoo.org> wrote:
>On Wed, Sep 14, 2016 at 12:18 PM, Holger Wünsche
><diegolde...@gmail.com> wrote:
>> I installed gentoo bun ran into some problems:
>> - the root-partition is read-only but shown as read-write when
>directly booting into gentoo,
>> - the type of the root-partition is "none",
>> - when only mounting the root-partition using a gentoo live-cd all
>other partitions are shown as mounted too and
>> - neither /dev, /proc, sys, run nor /tmp are mounted.
>>
>
>How many of these problems are replaced simply by replacing /etc/mtab
>with a symlink to /proc/self/mounts?

While it does not solve the problem as such (it still does not mount any partition but the root-partition in read-only) it explains, why I got these strange outputs.

I think the problem might be fstab or the point, where the initramfs gives controll to the kernel. Since if I am not mistaken (I just say what I recall reading while searching for a solution) the initramfs just gets the system running and then the kernel should remount the root-partition.





Holger Wünsche

Rich Freeman

unread,
Sep 14, 2016, 7:10:03 PM9/14/16
to
On Wed, Sep 14, 2016 at 5:03 PM, Holger Wünsche
<diegolde...@gmail.com> wrote:
>
> I think the problem might be fstab or the point, where the initramfs gives controll to the kernel.

The initramfs doesn't ever really give control to the kernel (well, at
least not any more than any process does anytime it invokes a system
call). The last thing the initramfs does is exec init, which then
assumes control.

> Since if I am not mistaken (I just say what I recall reading while searching for a solution) the initramfs just gets the system running and then the kernel should remount the root-partition.

If you're using an initramfs the kernel will not mount anything at any
time unless some process with sufficient capabilities asks it to. The
initramfs typically mounts the root partition, and then execs init.
Anything beyond that is done by init or whatever processes it spawns,
such as openrc. Offhand I don't remember if modern initramfs
solutions mount root as read-write; openrc will probably check for
this in any case and remount if it is read-only (I could be wrong on
that).

If something other than root isn't mounted correctly, the fault
probably lies in your fstab or openrc, or you're missing a necessary
driver/etc.

--
Rich

Holger Wünsche

unread,
Sep 15, 2016, 3:50:04 AM9/15/16
to
On 15 September 2016 01:01:02 CEST, Rich Freeman <ri...@gentoo.org> wrote:
>If you're using an initramfs the kernel will not mount anything at any
>time unless some process with sufficient capabilities asks it to. The
>initramfs typically mounts the root partition, and then execs init.
>Anything beyond that is done by init or whatever processes it spawns,
>such as openrc. Offhand I don't remember if modern initramfs
>solutions mount root as read-write; openrc will probably check for
>this in any case and remount if it is read-only (I could be wrong on
>that).
>
>If something other than root isn't mounted correctly, the fault
>probably lies in your fstab or openrc, or you're missing a necessary
>driver/etc.

Thanks for correcting me, i mixed it up a bit. But after looking in into the init-system I found the problem (or at least I fixed it).

Since the init did not work I tried:
# openrc sysinit

and got some errors I can not fully recall. So I took a look at dmesg (needed to use the command, since the file did not get created) I saw: the problem was a segfault in libselinux. I switched to the live-cd mounted all partitions chrooted in it, then I reemerged the whole system (emerge -ae world), because I wanted to be sure to go safe. After this I double checked the kernel configuration again and rebuild it as well (the same with the initramfs). This solved the problem, at least for me (finally I have the right keyboardlayout loaded on boot ;-).

Thanks for all your help pointing me in the right direction (especially with /proc/mounts which cleared the way). I learned quite a lot and got my system running the I want.





Holger Wünsche
0 new messages