BTRFS savedisk fails consistently
A partition and disk imaging/cloning program
Brought to you by:
steven_shiau
Hello,
I am trying to save two NVME drives to disk. Each drive contains an EFI partition, BTRFS partition, and swap. The BTRFS partitions are in RAID1. The devices are /dev/nvme0n1 and /dev/nvme1n1.
Every time I try I get "read error: No such file or directory" (fails at exactly 99.99% Data Block Process and 50% Total Block Process) with all of the versions and option attempts below:
btrfsck on both BTRFS partitions (both are healthy)/usr/sbin/ocs-sr -q2 -c -j2 -gm -gs -z5p -i 4096 -sfsck -senc -p choose savedisk my_image1-img nvme0n1 nvme1n1/usr/sbin/ocs-sr -q2 -c -j2 -gm -gs -z1p -i 4096 -sfsck -senc -p choose savedisk my_image2-img nvme0n1 nvme1n1/usr/sbin/ocs-sr -q2 -c -j2 -z1p -i 4096 -sfsck -senc -p choose savedisk my_image3-img nvme0n1 nvme1n1Partclone v0.3.23 http://partclone.org
Starting to clone device (/dev/nvme0n1p2) to image (-)
Reading Super Block
btrfsclone.c: btrfs library version = Btrfs v6.0.1
block_size = 16384
usedblock = 2361562
device_size = 252945891328
totalblock = 15438592
btrfsclone.c: fs_close
memory needed: 22901348 bytes
bitmap 1929824 bytes, blocks 2*10485760 bytes, checksum 4 bytes
Calculating bitmap... Please wait...
btrfsclone.c: btrfs library version = Btrfs v6.0.1
done!
File system: BTRFS
Device size: 252.9 GB = 15438592 Blocks
Space in use: 38.7 GB = 2361562 Blocks
Free Space: 214.3 GB = 13077030 Blocks
Block size: 16384 Byte
Total block 15438592
read error: No such file or directory
What else can I try? Is there more verbose logging that I can look at?
Thanks!
Perry
Hmm, I wonder if it doesn't know how to handle RAID1? If this is a known issue then it should definitely be detected and warned properly.
These drives are each 128GB with a 117.8GB BTRFS partition. But the "Device size" field above seems to be treating it as a combination of both drives (like saving a RAID0 array to a single partition)?
OK, it worked fine in
q1mode, which I suppose is expected. Hopefully that confirms it is not a hardware issue. I was able to use-q1 -c -j2 -gm -gs -z5p -i 4096 -sfsck -senc -p chooseon clonezilla-live-3.0.3-22-amd64 and it seems fine.Maybe for now if it detects BTRFS RAID it should intentionally fallback to
ddjust to be safe?Here was my rough process for setting up BTRFS in RAID1 on Debian 11 (the installed OS that I am trying to savedisk):
/mountbtrfs device add /dev/nvme1n1p2 / && btrfs balance start -dconvert=raid1 -mconvert=raid1 /It's really just a basic BTRFS RAID1 but hopefully that is sufficient to reproduce the issue.
The file system engine of Clonezilla, i.e., Partclone, does not support BTRFS RAID. That's why.
It's complicated to implement this feature in Partclone because RAID is quite complicated, and it contains more than 1 partitions.
However, this can be a very good feature in the future.
Steven
Thanks for your fast response!
Honestly I'm not that surprised or disappointed that BTRFS RAID is not supported partclone since it is definitely a complicated thing to do. Though I think that in RAID0 and RAID1 applications a simple
ddcopy is probably what the user wants. I especially think that if it is known that Partclone doesn't support it then there should be some sort of warning or fallback.Do you think it would be possible to:
1. Cause
q2mode to fallback toddwhen BTRFS RAID is detected2. When BTRFS RAID is detected show a warning in the TUI to the user with the implications and say that BTRFS RAID will fallback to
ddmode inq2Perry
Thanks for these two suggestion. Will try to implement that in the future release of Clonezilla.
Steven
Why not use btrfs dump and restore functions inside Clonezilla?
IIRC, btrfs dump only dumps metadata, not the whole data on the file system.
Maybe I am wrong?
Steven