Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

btrfs partition in LUKS device mapper not recognized / multiple errors #862

Closed
4L3XK opened this issue Feb 1, 2022 · 1 comment
Closed

Comments

@4L3XK
Copy link

4L3XK commented Feb 1, 2022

I have been trying half the day to set up timeshift with btrfs in LUKS.

The choice of the btrfs partition does not show up in the devices/partition listing of the timeshift assistant.

My rough guess would be that there is some problem with recognizing the LUKS_crypt or btrfs partition correctly.
Using the same system setup but without the LUKS device mapper (btrfs partition is it's own unencrypted partition) everything works fine.

Using snapper with this BTRFS-in-LUKS-setup seems to work fine so far and is unproblematic.

Any hints on how to get this done right, what am I missing here? Is it a timeshift bug? What else can I bring up for debugging?
Also, I'm new to btrfs, so please excuse me if I'm missing something obvious here.

Below you will find the errors I encountered and below that the system's configs.

The system is the current and up-to-date MX Linux 21 based on Debian GNU/Linux 11 (bullseye).
The timeshift version is: v21.09.1


Errors

Here are the variety of errors:

$ sudo timeshift --check
E: System disk not found!

same with --debug flag:

$ sudo timeshift --check --verbose --debug
D: Main()
D: 
D: Running Timeshift v21.09.1
D: 
D: Session log file: /var/log/timeshift/2022-02-01_22-36-58_backup.log
D: Distribution: MX 21 (Wildflower)
D: DIST_ID: MX
D: Main: check_dependencies()
D: Main: add_default_exclude_entries()
D: Main: add_default_exclude_entries(): exit
D: update_partitions()
D: df -T -B1
D: Device: get_disk_space_using_df(): 2
D: Device: get_mounted_filesystems_using_mtab(): 2
D: Device: get_filesystems(): 7
D: partition list updated
D: detect_system_devices()
D: /home is mapped to device: /dev/dm-0, UUID=
D: /boot is mapped to device: /dev/sdb1, UUID=eb29dd52-efda-4ba6-9dcd-d68c21e0d4e7
D: Searching subvolume for system at path: /
D: Found subvolume: @, on device: 
D: Found subvolume: @home, on device: 
D: Users: root username
D: Encrypted home users: 
D: Encrypted home dirs:

D: Encrypted private dirs:

D: Main: load_app_config()
App config loaded: /etc/timeshift/timeshift.json
D: IconManager: init()
D: bin_path: /usr/bin/timeshift
D: found images directory: /usr/share/timeshift/images
D: Main(): ok
D: AppConsole: parse_arguments()
D: Main: initialize_repo()
D: backup_uuid=
D: backup_parent_uuid=
E: System disk not found!
D: exit_app()
D: unmount_target_device()
D: clean_logs()
D: rm -rf '/tmp/q70Toe5x'

I wonder why D: /home is mapped to device: /dev/dm-0, UUID= does not list the UUID, which would be:

/dev/dm-0: LABEL="root" UUID="eaaa5e72-01c2-47fc-8962-215b8b2cd9db" UUID_SUB="a85c5b16-990f-45ca-82c4-8b638f0f9d4a" BLOCK_SIZE="4096" TYPE="btrfs"

Byside question: Which would be the "backup_parent_uuid" in a "normal" setup?


The assistant in the timeshift GUI lists the hard drives after proceeding with the initial choice "btrfs".
The btrfs partition is not listed and I can not proceed. Trying to proceed with the choice of the harddrive regardless (like suggested in other threads/issues) brings up an error:
"Select BTRFS system disk with root subvolume (@)"(ENG)
"Bitte BTRFS-Systemlaufwerk mit Wurzelunterlaufwerk (@) auswählen" (DE)
tserror1


I tried setting the UUID of the LUKS device itself manually in the timeshift config and get this error launching timeshift-launcher in the console:

E: Failed to mount device '/dev/disk/by-uuid/' at mount point '/run/timeshift/backup'
E: mount: /run/timeshift/backup: /dev/disk/by-uuid is not a block device.

When setting the UUID of the LUKS device mapper instead I don't get that error above.
Same with the UUID_SUB of the LUKS device mapper.
The UUID of the @ btrfs subvolume also does not help.


CONFIG


Here is the system's lsblk:

sdb               8:16   0 931,5G  0 disk  
├─sdb1            8:17   0     1G  0 part  /boot
├─sdb2            8:18   0 914,5G  0 part  
│ └─1FORMAT.fsm 254:0    0 914,5G  0 crypt /home
└─sdb3            8:19   0    16G  0 part 

It shows /home as mountpoint for some reason …


Here is the blkid output:

/dev/sdb1: LABEL="boot" UUID="eb29dd52-efda-4ba6-9dcd-d68c21e0d4e7" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="f2eedc88-01"
/dev/sdb2: UUID="325cb3eb-3c66-46d2-a6af-5877da14cc74" TYPE="crypto_LUKS" PARTUUID="f2eedc88-02"
/dev/sdb3: UUID="504f803d-02cc-4e60-96db-e88ec4cb1c81" TYPE="crypto_LUKS" PARTUUID="f2eedc88-03"
/dev/mapper/1FORMAT.fsm: LABEL="root" UUID="eaaa5e72-01c2-47fc-8962-215b8b2cd9db" UUID_SUB="a85c5b16-990f-45ca-82c4-8b638f0f9d4a" BLOCK_SIZE="4096" TYPE="btrfs"

fstab:

UUID=eb29dd52-efda-4ba6-9dcd-d68c21e0d4e7 /boot ext4 noatime 1 1
UUID=eaaa5e72-01c2-47fc-8962-215b8b2cd9db / btrfs subvol=@,noatime 1 1
UUID=eaaa5e72-01c2-47fc-8962-215b8b2cd9db /home btrfs subvol=@home,noatime 1 2
/dev/mapper/swap swap swap defaults 0 0

crypttab:

1FORMAT.fsm /dev/disk/by-uuid/325cb3eb-3c66-46d2-a6af-5877da14cc74 none luks
swap /dev/disk/by-uuid/504f803d-02cc-4e60-96db-e88ec4cb1c81 /root/keyfile luks

parted print all:

(parted) print all                                                        
Model: ATA SanDisk SDSSDH3 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1075MB  1074MB  primary  ext4         boot
 2      1075MB  983GB   982GB   primary
 3      983GB   1000GB  17,2GB  primary

Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/1FORMAT.fsm: 982GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0,00B  982GB  982GB  btrfs

The output of sudo btrfs subvolume list /

ID 256 gen 5386 top level 5 path @
ID 257 gen 5387 top level 5 path @home

Output of sudo btrfs subvolume get-default /
ID 5 (FS_TREE)


and of $ sudo btrfs subvolume get-default /home
ID 5 (FS_TREE)


The output of sudo btrfs subvolume show /

@
	Name: 			@
	UUID: 			ad606f0f-7d9d-b241-ae95-7e65de732ad3
	Parent UUID: 		-
	Received UUID: 		-
	Creation time: 		2022-02-01 11:38:07 +0200
	Subvolume ID: 		256
	Generation: 		5389
	Gen at creation: 	6
	Parent ID: 		5
	Top level ID: 		5
	Flags: 			-
	Snapshot(s):

and analogous of sudo btrfs subvolume show /home

@home
	Name: 			@home
	UUID: 			ccf1dbea-2497-4d48-8f71-bfe7e120f914
	Parent UUID: 		-
	Received UUID: 		-
	Creation time: 		2022-02-01 11:38:07 +0200
	Subvolume ID: 		257
	Generation: 		5390
	Gen at creation: 	7
	Parent ID: 		5
	Top level ID: 		5
	Flags: 			-
	Snapshot(s):
@4L3XK
Copy link
Author

4L3XK commented Feb 2, 2022

It seems timeshift need systemd to properly recognize and process a btrfs volume in a LUKS partition.
Booting the system with systemd as init made the btrfs partition available and now snapshotting is working nicely.
The system in use in this issue is MX Linux which uses sysvinit as standard init, hence the problem.

+1 to make timeshift work without systemd dependencies.

@4L3XK 4L3XK closed this as completed Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant