LUKS / BTRFS device missing

Du kommst mit der Installation nicht voran oder willst noch was nachfragen? Schau auch in den "Tipps und Tricks"-Bereich.
Antworten
mgzh
Beiträge: 71
Registriert: 24.08.2005 23:49:51
Wohnort: Singapore

LUKS / BTRFS device missing

Beitrag von mgzh » 15.02.2025 04:02:01

Hi

Benötige Eure Hilfe. Ich kann mein BTRFS volume nicht mehr mounten.
Das problematische single BTRFS filesystem (kein RAID) liegt in einem LUKS verschlüsselten container.
LUKS entschlüsseln funktioniert gut, der BTRFS mount schlägt dann aber neuerdings fehl mit 'device missing'.

OS: Bookworm 12.9 / stable
BTRFS version: v6.2.

Code: Alles auswählen

root@host$ cryptsetup luksOpen /dev/sde1 bkpreplica
Enter passphrase for /dev/sde1: *************

root@host$ cryptsetup -v status bkpreplica
/dev/mapper/bkpreplica is active.
  type:    LUKS2
  cipher:  aes-xts-plain64
  keysize: 512 bits
  key location: keyring
  device:  /dev/sde1
  sector size:  512
  offset:  32768 sectors
  size:    23437735903 sectors
  mode:    read/write
Command successful.

root@host$ mount -t btrfs /dev/mapper/bkpreplica /mnt/bkpreplica
mount: /mnt/bkpreplica: wrong fs type, bad option, bad superblock on /dev/mapper/bkpreplica, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

root@host$ dmesg
[20703.907090] BTRFS info (device dm-0): first mount of filesystem ed28d0fd-6a02-40fb-a379-905bdffaabe2
[20703.907103] BTRFS info (device dm-0): using crc32c (crc32c-intel) checksum algorithm
[20703.907109] BTRFS info (device dm-0): using free space tree
[20703.907515] BTRFS error (device dm-0): devid 1 uuid 249a0977-2bb1-4ca9-80ee-508a6cfe288c is missing
[20703.907550] BTRFS error (device dm-0): failed to read the system array: -2
[20703.909966] BTRFS error (device dm-0): open_ctree failed

root@host$ btrfs fi sh -d
warning, device 1 is missing
Label: none  uuid: ed28d0fd-6a02-40fb-a379-905bdffaabe2
	Total devices 2 FS bytes used 144.00KiB
	devid    2 size 10.91TiB used 2.01GiB path /dev/mapper/bkpreplica
	*** Some devices missing

root@host$ lsblk 
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sde              8:64   0  10.9T  0 disk  
└─sde1           8:65   0  10.9T  0 part  
  └─bkpreplica 254:0    0  10.9T  0 crypt

root@host$ blkid | grep UUID
/dev/sde1: UUID="fac7cf7a-6d9d-4710-9a15-2802bf9072a4" TYPE="crypto_LUKS" PARTUUID="c5331016-d5ca-0149-a95e-ba5ed3f0ec0f"

root@host$ btrfs device scan
Scanning for Btrfs filesystems
registered: /dev/mapper/bkpreplica

root@host$ btrfs check /dev/dm-0
Opening filesystem to check...
warning, device 1 is missing
Checking filesystem on /dev/dm-0
UUID: ed28d0fd-6a02-40fb-a379-905bdffaabe2
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 147456 bytes used, no error found
total csum bytes: 0
total tree bytes: 147456
total fs tree bytes: 32768
total extent tree bytes: 16384
btree space waste bytes: 140204
file data blocks allocated: 0
 referenced 0
 
BTRFS checks zeigen keine Errors, einzig devid 1 uuid 249a0977-2bb1-4ca9-80ee-508a6cfe288c is missing. Was mir nicht einleuchtet ist weshalb zwei "devices" existieren und ein device missing sein soll. Es handelt sich gar nicht um ein RAID array sondern eine single disk. Es war auch nie ein RAID volume.

Ideen?

mgzh
Beiträge: 71
Registriert: 24.08.2005 23:49:51
Wohnort: Singapore

Re: LUKS / BTRFS device missing

Beitrag von mgzh » 15.02.2025 11:39:38

Nach dem 'degraded' mounten der disk konnte ich diese missing device 1 unterdessen ordentlich entfernen und damit auch die dmesg Fehlermeldungen eliminieren.

Code: Alles auswählen

root@lugano$ mount -o degraded UUID=ed28d0fd-6a02-40fb-a379-905bdffaabe2 /mnt/bkpreplica/

root@lugano$ btrfs filesystem show /mnt/bkpreplica/
Label: none  uuid: ed28d0fd-6a02-40fb-a379-905bdffaabe2
	Total devices 2 FS bytes used 144.00KiB
	devid    1 size 0 used 0 path  MISSING
	devid    2 size 10.91TiB used 2.01GiB path /dev/mapper/bkpreplica

root@lugano$ btrfs device remove missing /mnt/bkpreplica/

root@lugano$ btrfs filesystem show /mnt/bkpreplica/      
Label: none  uuid: ed28d0fd-6a02-40fb-a379-905bdffaabe2
	Total devices 1 FS bytes used 144.00KiB
	devid    2 size 10.91TiB used 3.03GiB path /dev/mapper/bkpreplica
Das ordentliche mounten funktionierte nachher einwandfrei aber die Daten werden NICHT angezeigt (leeres listing).
Was zur Hölle geht hier vor? Ich bin mit meinem BTRFS Latein am Ende. Ideen?

Antworten