Emergency mode and bad tree block start after cloning drive with clonezilla

Hello,

System:
  Kernel: 6.1.5-arch2-1 arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux root=UUID=b6611412-3db3-4a22-9d8c-edc4a4424df6 rw
    rootflags=subvol=@ quiet quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    resume=UUID=ff91a649-2990-43d3-a552-a78edf138d2a loglevel=3 ibt=off
  Console: tty 1 Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: HP product: HP EliteBook 845 14 inch G9 Notebook PC v: N/A serial: <filter>
    Chassis: type: 10 serial: <filter>
  Mobo: HP model: 8990 v: KBC Version 09.48.00 serial: <filter> UEFI: HP v: U82 Ver. 01.03.01
    date: 10/19/2022
Battery:
  ID-1: BAT0 charge: 45.0 Wh (90.4%) condition: 49.8/51.3 Wh (97.1%) volts: 13.1 min: 11.6
    model: Hewlett-Packard Primary type: Li-ion serial: <filter> status: charging cycles: 6
CPU:
  Info: model: AMD Ryzen 7 6800U with Radeon Graphics socket: FP7 bits: 64 type: MT MCP
    arch: Zen 3+ gen: 4 level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25)
    model-id: 0x44 (68) stepping: 1 microcode: 0xA404102
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache: L1: 512 KiB
    desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 1668 high: 2700 min/max: 1600/4767 boost: enabled base/boost: 2700/4750
    scaling: driver: acpi-cpufreq governor: schedutil volts: 1.2 V ext-clock: 100 MHz cores: 1: 2700
    2: 1600 3: 1600 4: 1600 5: 1600 6: 1600 7: 1600 8: 1600 9: 1600 10: 1600 11: 1600 12: 1600
    13: 1600 14: 1600 15: 1600 16: 1600 bogomips: 86279
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: AMD Rembrandt [Radeon 680M] vendor: Hewlett-Packard driver: amdgpu v: kernel
    arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s
    lanes: 16 ports: active: eDP-1 empty: DP-1, DP-2, DP-3, DP-4, DP-5, DP-6, DP-7, HDMI-A-1
    bus-ID: e3:00.0 chip-ID: 1002:1681 class-ID: 0300 temp: 34.0 C
  Device-2: Chicony HP 5MP Camera type: USB driver: uvcvideo bus-ID: 5-1:2 chip-ID: 04f2:b738
    class-ID: fe01 serial: <filter>
  Display: server: X.org v: 1.21.1.6 with: Xwayland v: 22.1.7 driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi gpu: amdgpu tty: 192x60
  Monitor-1: eDP-1 model: AU Optronics 0xa49a built: 2021 res: 1920x1200 dpi: 162 gamma: 1.2
    size: 301x188mm (11.85x7.4") diag: 355mm (14") ratio: 16:10 modes: max: 1920x1200 min: 640x480
  API: OpenGL Message: GL data unavailable in console and glxinfo missing.
Audio:
  Device-1: AMD Rembrandt Radeon High Definition Audio driver: snd_hda_intel v: kernel pcie:
    gen: 4 speed: 16 GT/s lanes: 16 bus-ID: e3:00.1 chip-ID: 1002:1640 class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Hewlett-Packard driver: snd_pci_acp6x
    v: kernel
    alternate: snd_pci_acp3x,snd_rn_pci_acp3x,snd_pci_acp5x,snd_acp_pci,snd_rpl_pci_acp6x,snd_pci_ps,snd_sof_amd_renoir,snd_sof_amd_rembrandt
    pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: e3:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
    pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: e3:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Sound API: ALSA v: k6.1.5-arch2-1 running: yes
  Sound Server-1: PulseAudio v: 16.1 running: no
  Sound Server-2: PipeWire v: 0.3.64 running: no
Network:
  Device-1: Qualcomm QCNFA765 Wireless Network Adapter vendor: Foxconn driver: ath11k_pci
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 1 bus-ID: 01:00.0 chip-ID: 17cb:1103 class-ID: 0280
  IF: wlp1s0 state: down mac: <filter>
Bluetooth:
  Device-1: Foxconn / Hon Hai type: USB driver: btusb v: 0.8 bus-ID: 1-3:4 chip-ID: 0489:e0d6
    class-ID: e001
  Report: bt-adapter note: tool can't run ID: hci0 rfk-id: 2 state: down
    bt-service: enabled,stopped rfk-block: hardware: no software: no address: N/A
Drives:
  Local Storage: total: 1.82 TiB used: 113.58 GiB (6.1%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Crucial model: CT2000P5PSSD8 size: 1.82 TiB
    block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: P7CR403 temp: 27.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 type: USB vendor: HP model: v125w size: 3.73 GiB block-size:
    physical: 512 B logical: 512 B type: N/A serial: <filter> rev: 4096 scheme: MBR
Partition:
  ID-1: / raw-size: 442.9 GiB size: 442.9 GiB (100.00%) used: 113.16 GiB (25.6%) fs: btrfs
    block-size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 608 KiB (0.2%) fs: vfat
    block-size: 512 B dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 442.9 GiB size: 442.9 GiB (100.00%) used: 113.16 GiB (25.6%) fs: btrfs
    block-size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 442.9 GiB size: 442.9 GiB (100.00%) used: 113.16 GiB (25.6%)
    fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 442.9 GiB size: 442.9 GiB (100.00%) used: 113.16 GiB (25.6%)
    fs: btrfs block-size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 33.74 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p3 maj-min: 259:3
  ID-2: swap-2 type: zram size: 30.67 GiB used: 0 KiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 34.9 C mobo: N/A gpu: amdgpu temp: 35.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 302 Uptime: 12m wakeups: 512 Memory: 30.67 GiB used: 919.9 MiB (2.9%) Init: systemd
  v: 252 default: graphical tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6 Packages:
  pm: pacman pkgs: 1688 libs: 373 tools: pamac,paru Shell: Bash v: 5.1.16 running-in: tty 1
  inxi: 3.3.24
Garuda (2.6.14-1):
  System install date:     2023-01-01
  Last full system update: 2023-01-14
  Is partially upgraded:   No
  Relevant software:       snapper mkinitcpio
  Windows dual boot:       No/Undetected
  Failed units:            data.mount systemd-modules-load.service systemd-sysctl.service

I successfully installed Garuda Linux (GNOME) on my HP Elitebook 845 G9 a few weeks ago. It came with a small 500Gb NVME drive that I wanted to swap with larger 2Tb drive.

I cloned my 500Gb SSD using a newly downloaded Clonezilla, to a larger 2Tb SSD (attached via a USB adapter) (both NVME Gen 4). Everything appeared to go smoothly, and then I turned the system off, and swapped the smaller drive out for the larger one.

I tried to boot up my Linux system. But while it showed the GRUB menu, after showing the Garuda eagle and then a black screen, it put me quickly into emergency mode and asking for the root password.

When I looked at the logs using journalctl -xb | grep error, I see a bunch of references to "BTRFS error (device nvm0n1p2): bad tree block start, mirror 1 want XXXXXX have 0" where XXXX is a variety of large numbers.

I looked at /etc/fstab and checked the UUIDs of all the mounts/subvolumes and the SWAP (I have a swap partition) and it all looks correct.

Update: I was able to boot the system after commenting out a subvolume mount that I had created @data. But trying to list the subvolumes on my machine led to "Error: failed to lookup path for root 263: Input/output error" and trying BTRFS scrub shows 66 uncorrectable csum errors (yikes!!)

I suppose I could nuke the system and start from scratch (I have good backups of my files). But how could mere cloning a drive lead to BTRFS errors? Is this normal?

I cloned my 500Gb SSD using a newly downloaded Clonezilla, to a larger 2Tb SSD

I think you also have to grow the btrfs filesystem to fill the whole partition.

Try cloning again. If CloneZilla has a "verification" mode or something else to check if created image is valid and not damaged, enable that.

Not growing filesystem shouldn't result in boot failure, only loss of disk space.

Tried cloning again. Same result. There is no option to verify written image, only to fsck source.

The only two options were: keep partitions of the source, and grow partitions proportionally. I chose the first option, since I didn't want to grow my swap partition. And I knew I could use gparted afterwards to use the newly free space.

Are you using the stable version of clonezilla?
It may be worth trying the testing branch of clonezilla

1 Like

I was using the stable version of clonezilla. I just tried the testing branch (3.03-10) and got the same result: failed boot, and input/output error upon trying to list subvolumes at the emergency mode terminal.

Try cloning just the EFI partition, then use btrfs replace for the rest. Resize the partition and the filesystem afterward and do a balance.

1 Like

Interesting. How do I clone just the EFI partition? AFAIK Clonezilla clones entire disks, not individual partitions.

I have never used Clonezilla. I assume there is an option for cloning a partition, but the truth is I really don't know.

Honestly it is pretty trivial to just copy the files over from an EFI partition if you want. fat32 doesn't store ownership data or anything, so you can just copy your files from one EFI to another any way you like. Just set up a new EFI partition in Gparted or similar from a live environment. Create a new swap partition while you are in there if you want to keep that going.

btrfs replace is pretty great, I've even done it on a running system before. It feels a little bit like open-heart surgery, but it works! It is developed to be specifically useful for replacing a disk in a RAID array, but it works well for other stuff too.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.