[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: os-prober and LUKS



Thanks for your reply, Rolf!

On Sat, Dec 27, 2025 at 10:37:06PM +0100, Rolf Reintjes wrote:
> Am 27.12.2025 um 09:28 schrieb Josef Wolf:
> > I am not sure where to discuss these things, since I can't find the original
> > repository of os-prober.

Unfortunately, my original report was 18 months ago against the only repo I
could find at that time. Seems to be some bogus, outdated repo:
https://github.com/MaddieM4/os-prober/issues/10

This is why I asked where would be the correct place to discuss this problem.

> I think the original code is correct.
> If the path is not found in the mounted ones it means: The boot-files are
> direct on the main partition or the separat boot partition is yet not being
> detected/mounted.

Actually, the partition to be checked _IS_ mounted at $mtpt. But the test
checks for $mtpt/boot, which happens to be /old/boot/boot in the case of the
old boot partition and /old/boot for the old root partition. Thus I suspect
the problem occures while checking old root partition.

The problem occured during install, and removing the negation fixed the
problem at that time. I'll have to do a fresh install to investigate the
situation in more detail.

Here's some additional context:

I've set up a system with full disk encryption (including boot partitions) and
two installs, like this:

   $ lsblk | tail -19
   nvme0n1       259:0    0   1,8T  0 disk  
   ├─nvme0n1p1   259:1    0     1M  0 part  
   ├─nvme0n1p2   259:2    0   128M  0 part  /boot/efi
   ├─nvme0n1p3   259:3    0     1G  0 part  
   │ └─cr-boot-1 252:2    0  1022M  0 crypt /old/boot
   ├─nvme0n1p4   259:4    0     1G  0 part  
   │ └─cr-boot-2 252:3    0  1022M  0 crypt /boot
   ├─nvme0n1p5   259:5    0    80G  0 part  
   │ └─cr-root-1 252:5    0    80G  0 crypt /old
   ├─nvme0n1p6   259:6    0    80G  0 part  
   │ └─cr-root-2 252:0    0    80G  0 crypt /
   ├─nvme0n1p7   259:7    0    32G  0 part  
   │ └─cr-swap   252:1    0    32G  0 crypt [SWAP]
   └─nvme0n1p8   259:8    0   1,6T  0 part  
     └─cr-m      252:4    0   1,6T  0 crypt /var/tmp
                                            /var/spool/mail
                                            /usr/local
                                            /home
                                            /m

Any comments on the second one?

> > Second is a missing feature. OS on LUKS volumes wont be checked at all, even
> > if the partition is currently unlocked. Please check/comment on this patch:
> > 
> > 
> > --- /usr/bin/os-prober-orig	2021-07-11 04:43:50.000000000 +0200
> > +++ /usr/bin/os-prober	2024-06-21 22:13:54.286221887 +0200
> > @@ -74,6 +74,15 @@
> >   		echo "$(LVM_SUPPRESS_FD_WARNINGS=1 log_output lvs --noheadings --separator : -o vg_name,lv_name |
> >   			sed "s|-|--|g;s|^[[:space:]]*\(.*\):\(.*\)$|/dev/mapper/\1-\2|")"
> >   	fi
> > +
> > +	# Also detect OSes on LUKS encrypted volumes that are currently unlocked
> > +	if type cryptsetup >/dev/null 2>&1; then
> > +		for device in $(ls /dev/mapper); do
> > +			if [ "$(cryptsetup status /dev/mapper/$device | grep LUKS)" != "" ]; then
> > +				echo "/dev/mapper/$device"
> > +			fi
> > +		done
> > +	fi
> >   }
> >   parse_proc_swaps () {

-- 
Josef Wolf
jw@raven.inka.de


Reply to: