“/etc/os-release missing” when installing with btrfs

1,788 views
Skip to first unread message

johnny....@hotmail.de

unread,
Feb 2, 2016, 2:22:07 PM2/2/16
to qubes-users
Just to let you know:

I've tried a lot of different configurations but every time I used btrfs as partition scheme I couldn't start Qubes OS 3.1-rc2 after installation.

[ ]: Starting Switch Root...
[ ]: Not switching root: /sysroot does not seem to be an OS tree. /etc/os-release is missing.
....
[ ]: Failed to start Switch Root.
[ ]: Startup finished in 211ms (kernel) + 0 (initrd) + 45ms (userspace) = 256ms.
[ ]: Unit initrd-switch-root.service entered failed state.
[ ]: Triggering OnFailure= dependencies of initrd-switch-root.service.
[ ]: Starting Emergency Shell...

ls shows all folders including /etc and there's the os-release file. (cat /etc/os-release shows the identification data of qubes)

So I cannot explain why this error keeps occurring.

Maybe someone want to dive deeper in this.
I'm now using a successful installation after I chose LVM instead of btrfs.

Marek Marczykowski-Górecki

unread,
Feb 2, 2016, 3:50:55 PM2/2/16
to johnny....@hotmail.de, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Tue, Feb 02, 2016 at 11:22:07AM -0800, johnny....@hotmail.de wrote:
> Just to let you know:
>
> I've tried a lot of different configurations but every time I used btrfs as partition scheme I couldn't start Qubes OS 3.1-rc2 after installation.
>
> [ ]: Starting Switch Root...
> [ ]: Not switching root: /sysroot does not seem to be an OS tree. /etc/os-release is missing.
> ....
> [ ]: Failed to start Switch Root.
> [ ]: Startup finished in 211ms (kernel) + 0 (initrd) + 45ms (userspace) = 256ms.
> [ ]: Unit initrd-switch-root.service entered failed state.
> [ ]: Triggering OnFailure= dependencies of initrd-switch-root.service.
> [ ]: Starting Emergency Shell...
>
> ls shows all folders including /etc and there's the os-release file. (cat /etc/os-release shows the identification data of qubes)

Did you checked that in /sysroot?

> So I cannot explain why this error keeps occurring.
>
> Maybe someone want to dive deeper in this.
> I'm now using a successful installation after I chose LVM instead of btrfs.

- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWsRalAAoJENuP0xzK19csGIQIAJOqJVQHGK1LPTt3qydC0feR
+OPnjEMwF9dOJ9cr5Zt6HK6Q/U0RT7sXxdpLreBGdui5hUtJF1dUmCcV4Aqiwct6
HtFENMAsXTFBdH2UTkEsMZshIhkDOH5vDv6yKQ8uO21+aKaVKjWz7W7DQKxyqrTU
CLiiR+XawO40U/i6J3p7RECDX75nLS/+rCtiStJA4bTUuYpUH17aYM0hqoLDu9mc
RbJVWTTU03WLktY1lbOoA+nZ65ijN/OYzNl84PiQipricQPvXk0OJgsEjZ7eTvrP
dyeAEFK+z4qvZW47rFjGhmiGwmdeTZimoLrKy+2CR2GJvbIUfarHZ7rlOjVJOMU=
=yE7U
-----END PGP SIGNATURE-----

Johnny

unread,
Feb 2, 2016, 4:39:49 PM2/2/16
to qubes-users
I also checked sysroot: cat /sysroot/root/etc/os-release shows
NAME: qubes
VERSION: 3.1
[...]

It's definitely there but the error message keeps saying that it's missing. I did not get any error while installing. In fact the installation process was identical to the one with LVM except that the LVM install just boots as expected.

Marek Marczykowski-Górecki

unread,
Feb 2, 2016, 4:43:55 PM2/2/16
to Johnny, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Tue, Feb 02, 2016 at 01:39:49PM -0800, Johnny wrote:
> Am Dienstag, 2. Februar 2016 21:50:55 UTC+1 schrieb Marek Marczykowski-Górecki:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > On Tue, Feb 02, 2016 at 11:22:07AM -0800, johnny....@hotmail.de wrote:
> > > Just to let you know:
> > >
> > > I've tried a lot of different configurations but every time I used btrfs as partition scheme I couldn't start Qubes OS 3.1-rc2 after installation.
> > >
> > > [ ]: Starting Switch Root...
> > > [ ]: Not switching root: /sysroot does not seem to be an OS tree. /etc/os-release is missing.
> > > ....
> > > [ ]: Failed to start Switch Root.
> > > [ ]: Startup finished in 211ms (kernel) + 0 (initrd) + 45ms (userspace) = 256ms.
> > > [ ]: Unit initrd-switch-root.service entered failed state.
> > > [ ]: Triggering OnFailure= dependencies of initrd-switch-root.service.
> > > [ ]: Starting Emergency Shell...
> > >
> > > ls shows all folders including /etc and there's the os-release file. (cat /etc/os-release shows the identification data of qubes)
> >
> > Did you checked that in /sysroot?
> >
> > > So I cannot explain why this error keeps occurring.
> > >
> > > Maybe someone want to dive deeper in this.
> > > I'm now using a successful installation after I chose LVM instead of btrfs.
>
> I also checked sysroot: cat /sysroot/root/etc/os-release shows

Are you sure about the path? It should be /sysroot/etc/os-release, not
/sysroot/root/etc/os-release. If it really was the latter, that was the
issue.

> NAME: qubes
> VERSION: 3.1
> [...]
>
> It's definitely there but the error message keeps saying that it's missing. I did not get any error while installing. In fact the installation process was identical to the one with LVM except that the LVM install just boots as expected.



- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWsSMRAAoJENuP0xzK19csbkgH/Ai9rhJPBj5R6s7rhGi+gpp0
V7E7kXy51Ev5UmW+Uky2rSVPIsvulQAUBeiTizVajS4qClEhtCQTJp7FeJYF7ODU
Nl2BP4Sbff11OZ4xmPKgOERFd1Z5htOCh14jPesbv29EoJtTa8El3JlECImdLTfF
sT3aJNjFC3LoayTSWe+laeDgGphnJFSfkei8wneQ4vpP6f/DKY403oZ8G5DM/4pp
JleNq5EHiqsatwgneJhAW/v1hucNAPZBgtpAc2FUWd5HVmULOMBehW55scISHGGH
/Fasq6oWA9WHDV755IvFhGWNtgZxWlnBQ8+CFAOIPFBxRvTWShuRLA2c1bBotKQ=
=gyYj
-----END PGP SIGNATURE-----

johnny....@hotmail.de

unread,
Feb 2, 2016, 4:58:02 PM2/2/16
to qubes-users
That might be the root of the problem:

'ls /sysroot' gives only the 'root' directory. '/etc' and the other well-known directories are inside '/sysroot/root'. Don't know why the installer does that - it doesn't seem to have much to do with the partition scheme.

li...@mullvad.net

unread,
Mar 21, 2016, 4:38:04 PM3/21/16
to qubes-users, johnny....@hotmail.de

I got the same error when I installed Qubes 3.1 on LUKS + Btrfs.
I solved it by executing:

$ mv /sysroot/root/* /sysroot/

in the emergency console and rebooting.

johnny....@hotmail.de

unread,
Mar 22, 2016, 2:01:52 PM3/22/16
to qubes-users
> 'ls /sysroot' gives only the 'root' directory. '/etc' and the other well-known directories are inside '/sysroot/root'. Don't know why the installer does that - it doesn't seem to have much to do with the partition scheme.
>
> I got the same error when I installed Qubes 3.1 on LUKS + Btrfs.
> I solved it by executing:
>
> $ mv /sysroot/root/* /sysroot/
>
> in the emergency console and rebooting.

I did the same thing to make it work, but I was hoping for an actual fix.

li...@mullvad.net

unread,
Mar 23, 2016, 4:20:52 AM3/23/16
to qubes-users, johnny....@hotmail.de

Me too, and I think I found two solutions, read on for both of them.

The problem is that:
1) Qubes installs itself to a btrfs subvolume named 'root' (This is according to good design)
2) Qubes adds the option 'subvol=root' to /etc/fstab so that the correct subvolume should be mounted at /
3) At boot Qubes mounts the top level btrfs subvolume, not 'root'. I guess it simply uses the "root=UUID=...." option to the kernel and not /etc/fstab (since that is not available).

At first I changed the default subvolume to the 'root' one from the emergency console so that this subvolume is the one that will be mounted by default. Later I discovered that it's possible to give the "subvol=root" argument directly to the kernel. I will present both solutions here.

Change default subvolume
I did this yesterday and I'm writing the commands from memory only, so there might be errors. When you are dropped to the emergency console on first boot do this:

# Make our btrfs system writable
mount -o remount,rw /sysroot

# List all subvolumes. Write down the ID for the 'root' subvolume. For me it was 257
btrfs subvolume list /sysroot

# Change default subvolume to 'root'. Change 257 to whatever you got from the previous command
btrfs subvolume set-default 257 /sysroot

# Make sure the change was applied
btrfs subvolume get-default /sysroot

# Unmount and reboot into a working system
umount /sysroot
reboot

Adding the subvol argument to the kernel
This is probably the nicest solution as it doesn't change the filesystem at all, just how it's mounted.

In your kernel parameters you have one argument specifying the root, looking something like this:
root=UUID=....

Just add this argument to the kernel al well:
rootflags=subvol=root


I hope this will making using Btrfs easier for people. I didn't notice this problem before. Is it a bug in R3.1 or is it because I changed computer?

/Linus

Marek Marczykowski-Górecki

unread,
Mar 23, 2016, 7:15:04 PM3/23/16
to li...@mullvad.net, qubes-users, johnny....@hotmail.de
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Thanks for detailed info! I've copied it here:
https://github.com/QubesOS/qubes-issues/issues/1871


- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJW8yNvAAoJENuP0xzK19csxVwH/iDnao8Fr1bHMEGZQnhG8gM3
kh3gvGApJkwn22jVHxbVgot0Nr1LSPShc/Egjw8TxRXrRNUxMr0ZCVrpd+erdr1B
pFG8DiaELkJvr+1YBFxcNFEX9uSQHAlBMTlS9x8CkIikImA+fP2iEJDKV+Gnz1wB
SFl3pbirr3020llJHuWdBOsRXqLvtMb17JMJJhYnI+9CAToGuU8VB9SZujZs0Wil
6g+121xTqSLtXCiWUFRAIx84zwGDID/bN4YrqgGv91ujp9f4rec+ovLbApG8n9sc
yMoHXCQ//IaQ0uNSIW5FEZtYfRFWxuRzlNY1PIefuJD3OefkVTd6IecnGktHfPo=
=ivxr
-----END PGP SIGNATURE-----

li...@mullvad.net

unread,
Mar 24, 2016, 12:17:32 PM3/24/16
to qubes-users, li...@mullvad.net, johnny....@hotmail.de

Great!

I was going to post an issue about it, I just wanted to wait a few days and see if anyone had any feedback or comments on my solution.

/Linus

Manuel Amador (Rudd-O)

unread,
Mar 25, 2016, 2:38:19 PM3/25/16
to qubes...@googlegroups.com
On 02/02/2016 09:39 PM, Johnny wrote:
> I also checked sysroot: cat /sysroot/root/etc/os-release shows > NAME: qubes > VERSION: 3.1 > [...]
The path is wrong. It should be /sysroot/etc/os-release. There is a
bug somewhere in the code that sets up the mount of the / file system,
and this bug only triggers when btrfs is the format of the root file
system. This is something that needs to be fixed upstream and, chances
are, it already is... but only in later Fedora versions, not F20 which
is the basis of Dom0 for Qubes.

--
Rudd-O
http://rudd-o.com/

Reply all
Reply to author
Forward
0 new messages