Kernel Sees Partitions Where There Aren't Any
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I presume this should be reported against the kernel, but linux-image-generic doesn't work
:~$ # /dev/sdb is a 2T SSD
:~$ # This device has no partitions, just a luks2 header
:~$ sudo cryptsetup isLuks /dev/sdb && echo "true"
true
:~$ # Nevertheless, the kernel sees partitions:
:~$ lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 1.1T 0 part
└─sdb2 8:18 0 197.3G 0 part
:~$ # This is not the case with my other 2T disks
:~$ sudo cryptsetup isLuks /dev/sda && echo "true"
true
:~$ lsblk /dev/sda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 1.8T 0 disk
:~$ sudo cryptsetup isLuks /dev/sdc && echo "true"
true
:~$ lsblk /dev/sdc
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdc 8:32 0 1.8T 0 disk
:~$ # Now if I open /dev/sdb, the encrypted disk is available, but the partitions remain:
:~$ sudo cryptsetup open /dev/sdb luks.root.internal
Enter passphrase for /dev/sdb:
:~$ lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdb 8:16 0 1.8T 0 disk
├─sdb1 8:17 0 1.1T 0 part
├─sdb2 8:18 0 197.3G 0 part
└─luks.
:~$ # I tried wiping the LUKS header on /dev/sdb and recreating it, with no effect.
:~$ # The kernel I'm running is vmlinuz-
:~$ # I was able to check this right from the 24.04 installer.
:~$ # This is a longstanding problem, perhaps as long as 10 years.
:~$ # I've seen it on many disks, but never reported the issue.
In case it might be useful, running parted on /dev/sdb, I see:
(parted) print
Error: /dev/sdb: unrecognized disk label
Model: ATA Dogfish SSD 2TB (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
description: | updated |
description: | updated |
tags: | added: noble |
affects: | ubuntu → linux (Ubuntu) |
I did a luksConvertKey on all 3 drives, sda, sdb, sdc:
:~$ cryptsetup luksConvertKey --key-slot 0 -h sha512 --pbkdf pbkdf2 -y /dev/sda
Now, sda and sdb show no extra partitions, but sdc does:
:~$ lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdc 8:32 0 1.8T 0 disk
└─sdc2 8:34 0 1014.7G 0 part