Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repair is broken on encrypted drive (with btrfs root) #182

Open
ser opened this issue Oct 7, 2019 · 5 comments
Open

repair is broken on encrypted drive (with btrfs root) #182

ser opened this issue Oct 7, 2019 · 5 comments

Comments

@ser
Copy link

ser commented Oct 7, 2019

Describe the bug
cryptsetup luksOpen /dev/drive drive
mount /dev/mapper/drive /mnt
swupd repair --picky --root=/mnt

gives

Calling post-update helper scripts
[ERROR] cbm (../src/lib/files.c:L165): Invalid block device: /mnt
[ERROR] cbm (../src/lib/system_stub.c:L31): Invalid block device: 0:58
Out of memory
[FATAL] cbm (../src/bootman/sysconfig.c:L275): sysconfig insane: Missing root device
[FATAL] cbm (../src/bootman/update.c:L127): Cannot install kernel /mnt//usr/lib/kernel/org.clearlinux.native.5.3.2-844

Repair successful

To Reproduce
Install clear linux with encryption, btrfs-convert /dev/drive from installer media, system does not boot, try to fix with the above command

Expected behavior
fixing boot by checking that filesystem ID has changed during btrfs convertion

Environment (please complete the following information):
swupd-client 3.22.3
Installed version: 31140

@otaviobp
Copy link

otaviobp commented Oct 7, 2019

This looks like a problem related to CBM. I'll transfer the issue

@otaviobp otaviobp transferred this issue from clearlinux/swupd-client Oct 7, 2019
@seanvk
Copy link

seanvk commented Oct 16, 2019

CBM doesn't support btrfs to my knowledge. Which is kind of unfortunate but CBM has other boot/security roles beyond just supporting systemd-boot. So although on other distributions you can freely use btrfs with systemd-boot, CBM cannot.

@ahkok
Copy link
Contributor

ahkok commented Oct 16, 2019

CBM doesn't support btrfs to my knowledge

That would IMHO be a bug. One that needs fixing.

@ahkok
Copy link
Contributor

ahkok commented Oct 16, 2019

Note that btrfs-convert isn't the same as making a new btrfs filesystem. I would NOT recommend btrfs-convert. It's method includes rollback support to ext4, and is likely therefore confusing programs that look at the block content. We first want to assure that filesystems created with mkfs.btrfs work anyway.

@ser
Copy link
Author

ser commented Oct 16, 2019

It would be perfect if installer supports btrfs, but it does not.

I have successfully converted and run clear on btrfs again, but had to manually update a boot text file with a new filesystem ID as it changes after the conversion process

silkeh added a commit to silkeh/clr-boot-manager that referenced this issue Jul 4, 2020
Calling stat() on some filesystems, like Btrfs,
results in a dev_t with no relation to the backing device(s),
and subsequent failure to detect the root fs.

Add support such filesystems by retrieving the block device from
`/proc/self/mounts` and working on from there.

Resolves clearlinux#61, clearlinux#182 and clearlinux#193.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants