Menu

#405 BTRFS savedisk fails consistently

testing_clonezilla
open
nobody
btrfs (5)
5
2023-03-25
2023-03-20
DaAwesomeP
No

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:

  • clonezilla-live-3.0.3-22-amd64
  • clonezilla-live-3.0.2-21-amd64
  • clonezilla-live-3.0.1-8-amd64
  • clonezilla-live-20230212-kinetic-amd64
  • Save to USB HDD (exfat)
  • Save to SMB share (share from Windows 10 NTFS)
  • Tried running 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 nvme1n1
Partclone 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

Discussion

  • DaAwesomeP

    DaAwesomeP - 2023-03-20

    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)?

     
  • DaAwesomeP

    DaAwesomeP - 2023-03-20

    OK, it worked fine in q1 mode, 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 choose on clonezilla-live-3.0.3-22-amd64 and it seems fine.

    Maybe for now if it detects BTRFS RAID it should intentionally fallback to dd just 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):

    1. Install Debian 11 to first disk with single BTRFS partition for / mount
    2. First drive BTRFS partition is /dev/nvme0n1p2 and seconds drive is /dev/nvme1n1p2.
    3. Create empty GPT on second disk, create code 8300 partition /dev/nvme1n1p2 for BTRFS using exact sector count size as /dev/nvme0n1p2 on the first drive
    4. btrfs device add /dev/nvme1n1p2 / && btrfs balance start -dconvert=raid1 -mconvert=raid1 /
    5. You would also need to modify fstab, add a second EFI partition, add another swap, etc. but that isn't relevant here.

    It's really just a basic BTRFS RAID1 but hopefully that is sufficient to reproduce the issue.

     
  • Steven Shiau

    Steven Shiau - 2023-03-21

    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

     
  • DaAwesomeP

    DaAwesomeP - 2023-03-21

    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 dd copy 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 q2 mode to fallback to dd when BTRFS RAID is detected
    2. 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 dd mode in q2

    Perry

     
  • Steven Shiau

    Steven Shiau - 2023-03-21

    Thanks for these two suggestion. Will try to implement that in the future release of Clonezilla.

    Steven

     
    👍
    1
  • Igor Velkov

    Igor Velkov - 2023-03-24

    Why not use btrfs dump and restore functions inside Clonezilla?

     
  • Steven Shiau

    Steven Shiau - 2023-03-25

    IIRC, btrfs dump only dumps metadata, not the whole data on the file system.
    Maybe I am wrong?

    Steven

     

Log in to post a comment.

MongoDB Logo MongoDB