How to clone main bootable NVME (disk)

Hello,

I’m concerned that my main NVME may going to die soon or because of hardware issue or due to file system issue (BTRFS). I was playing Starcraft 2 and my system got frozen, I forced reboot and them my NVME was dead, bios tried to boot but the system was locked into GRUB prompt. inside my bios, the NVME was not showing in the list. Shutdown the PC, and some minutes later i tried to turn it on again and for my surprise it back to live :slight_smile:

Very often I got warnings and errors log. Time get a back-up for my main NVME.

I have one spare NVME and I could perform a fresh new install on it, but I’d like to learn HOW TO CLONE BOTABLE DISK with KDE Partition Manager or command line, and also how to perform BTRFS file check.

5 year ago, when I was still using windows, it was very simple and straight forward to clone disks using Acronis True Image.

System:
  Kernel: 6.10.6-10-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-6.10-x86_64
    root=UUID=84e0bfca-0d47-4324-b85a-614ea38dc5f9 rw rootflags=subvol=@ quiet
    splash udev.log_priority=3
  Desktop: KDE Plasma v: 6.0.5 tk: Qt v: N/A info: frameworks v: 6.5.0
    wm: kwin_wayland vt: 1 dm: SDDM Distro: Manjaro base: Arch Linux
Machine:
  Type: Desktop Mobo: MACHINIST model: E5-MR9A v: V1.0
    serial: <superuser required> uuid: <superuser required>
    UEFI: American Megatrends v: 5.11 date: 10/25/2022
Battery:
  Message: No system battery data found. Is one present?
Memory:
  System RAM: total: 32 GiB available: 31.19 GiB used: 2.55 GiB (8.2%)
  Message: For most reliable report, use superuser + dmidecode.
  Array-1: capacity: 256 GiB note: check slots: 4 modules: 4
    EC: Multi-bit ECC max-module-size: 64 GiB note: est.
  Device-1: DIMM_A1 type: DDR4 detail: synchronous size: 8 GiB
    speed: 2400 MT/s volts: curr: 1 min: 1.14 max: 1.26 width (bits): data: 72
    total: 72 manufacturer: Hynix Semiconductor part-no: HMA41GR7AFR4N-UH
    serial: <filter>
  Device-2: DIMM_B1 type: DDR4 detail: synchronous size: 8 GiB
    speed: 2400 MT/s volts: curr: 1 min: 1.14 max: 1.26 width (bits): data: 72
    total: 72 manufacturer: Hynix Semiconductor part-no: HMA41GR7AFR4N-UH
    serial: <filter>
  Device-3: DIMM_C1 type: DDR4 detail: synchronous size: 8 GiB
    speed: 2400 MT/s volts: curr: 1 min: 1.14 max: 1.26 width (bits): data: 72
    total: 72 manufacturer: Hynix Semiconductor part-no: HMA41GR7AFR4N-UH
    serial: <filter>
  Device-4: DIMM_D1 type: DDR4 detail: synchronous size: 8 GiB
    speed: 2400 MT/s volts: curr: 1 min: 1.14 max: 1.26 width (bits): data: 72
    total: 72 manufacturer: Hynix Semiconductor part-no: HMA41GR7AFR4N-UH
    serial: <filter>
CPU:
  Info: model: Intel Xeon E5-2667 v4 bits: 64 type: MT MCP arch: Broadwell
    level: v3 note: check built: 2015-18 process: Intel 14nm family: 6
    model-id: 0x4F (79) stepping: 1 microcode: 0xB000040
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 2 MiB desc: 8x256 KiB L3: 25 MiB
    desc: 1x25 MiB
  Speed (MHz): avg: 1431 high: 3600 min/max: 1200/3600 scaling:
    driver: intel_cpufreq governor: schedutil cores: 1: 3600 2: 1200 3: 1800
    4: 1200 5: 1200 6: 1200 7: 1200 8: 1200 9: 1200 10: 1482 11: 1200 12: 1200
    13: 1200 14: 1200 15: 1197 16: 1627 bogomips: 102216
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat arch_perfmon
    avx avx2 bmi1 bmi2 bts cat_l3 cdp_l3 clflush cmov constant_tsc cpuid
    cpuid_fault cqm cqm_llc cqm_mbm_local cqm_mbm_total cqm_occup_llc cx16 cx8
    dca de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est f16c flexpriority
    flush_l1d fma fpu fsgsbase fxsr hle ht ibpb ibrs ida intel_ppin intel_pt
    invpcid lahf_lm lm mca mce md_clear mmx monitor movbe msr mtrr nonstop_tsc
    nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt
    pse pse36 pti pts rdrand rdseed rdt_a rdtscp rep_good rtm sdbg sep smap
    smep smx ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp syscall tm tm2
    tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi vpid x2apic
    xsave xsaveopt xtopology xtpr
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
    vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: Retpolines; IBPB: conditional; IBRS_FW;
    STIBP: conditional; RSB filling; PBRSB-eIBRS: Not affected; BHI: Not
    affected
  Type: srbds status: Not affected
  Type: tsx_async_abort mitigation: Clear CPU buffers; SMT vulnerable
Graphics:
  Device-1: AMD Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT]
    vendor: Micro-Star MSI driver: amdgpu v: kernel arch: RDNA-1 code: Navi-1x
    process: TSMC n7 (7nm) built: 2019-20 pcie: gen: 4 speed: 16 GT/s lanes: 16
    ports: active: DP-2 empty: DP-1,DP-3,HDMI-A-1 bus-ID: 05:00.0
    chip-ID: 1002:731f class-ID: 0300
  Display: wayland server: X.org v: 1.21.1.13 with: Xwayland v: 24.1.2
    compositor: kwin_wayland driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu display-ID: 0
  Monitor-1: DP-2 res: 2560x1440 size: N/A modes: N/A
  API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
    device: 1 drv: swrast gbm: drv: kms_swrast surfaceless: drv: radeonsi
    wayland: drv: radeonsi x11: drv: radeonsi
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.1.6-arch1.1
    glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 5700 XT (radeonsi
    navi10 LLVM 18.1.8 DRM 3.57 6.10.6-10-MANJARO) device-ID: 1002:731f
    memory: 7.81 GiB unified: no display-ID: :1.0
  API: Vulkan v: 1.3.279 layers: 6 device: 0 type: discrete-gpu name: AMD
    Radeon RX 5700 XT (RADV NAVI10) driver: mesa radv v: 24.1.6-arch1.1
    device-ID: 1002:731f surfaces: xcb,xlib,wayland
Audio:
  Device-1: Intel 8 Series/C220 Series High Definition Audio
    driver: snd_hda_intel v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8c20
    class-ID: 0403
  Device-2: AMD Navi 10 HDMI Audio driver: snd_hda_intel v: kernel pcie:
    gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 05:00.1 chip-ID: 1002:ab38
    class-ID: 0403
  API: ALSA v: k6.10.6-10-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: JACK v: 1.9.22 status: off tools: N/A
  Server-3: PipeWire v: 1.2.3 status: off with: wireplumber status: active
    tools: pw-cli,wpctl
  Server-4: PulseAudio v: 17.0 status: active with: pulseaudio-alsa
    type: plugin tools: pacat,pactl
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: d000
    bus-ID: 08:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp8s0 state: up speed: 100 Mbps duplex: full mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: global
  IP v6: <filter> type: noprefixroute scope: link
  IF-ID-1: virbr0 state: down mac: <filter>
  IP v4: <filter> scope: global broadcast: <filter>
  Info: services: NetworkManager
  WAN IP: <filter>
Bluetooth:
  Message: No bluetooth data found.
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 2.73 TiB used: 1.73 TiB (63.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital
    model: WD Blue SN570 500GB size: 465.76 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
    fw-rev: 234100WD temp: 33.9 C scheme: GPT
  ID-2: /dev/nvme1n1 maj-min: 259:2 vendor: A-Data model: LEGEND 850 Lite
    size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: V0922A0 temp: 32.9 C
    scheme: GPT
  ID-3: /dev/sda maj-min: 8:0 vendor: Western Digital model: WD20PURZ-85GU6Y0
    size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    tech: HDD rpm: 5400 serial: <filter> fw-rev: 0A80 scheme: MBR
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 124.55 GiB (26.8%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:4
    label: N/A uuid: 84e0bfca-0d47-4324-b85a-614ea38dc5f9
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme1n1p1 maj-min: 259:3 label: N/A
    uuid: 21D8-DE05
  ID-3: /home raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 124.55 GiB (26.8%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:4
    label: N/A uuid: 84e0bfca-0d47-4324-b85a-614ea38dc5f9
  ID-4: /home/<filter>/Games raw-size: 465.76 GiB size: 457.38 GiB (98.20%)
    used: 141.78 GiB (31.0%) fs: ext4 dev: /dev/nvme0n1p1 maj-min: 259:1
    label: GAMES uuid: b5780269-0438-4193-9b38-7df4aaf9b229
  ID-5: /home/<filter>/HDD-2TB raw-size: 1.82 TiB size: 1.79 TiB (98.37%)
    used: 1.46 TiB (81.9%) fs: ext4 dev: /dev/sda1 maj-min: 8:1 label: 2TB-EXT4
    uuid: b9d4d0f9-d1ce-425d-8fe4-e2f830005289
  ID-6: /swap raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 124.55 GiB (26.8%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:4
    label: N/A uuid: 84e0bfca-0d47-4324-b85a-614ea38dc5f9
  ID-7: /var/cache raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 124.55 GiB (26.8%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:4
    label: N/A uuid: 84e0bfca-0d47-4324-b85a-614ea38dc5f9
  ID-8: /var/log raw-size: 465.46 GiB size: 465.46 GiB (100.00%)
    used: 124.55 GiB (26.8%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:4
    label: N/A uuid: 84e0bfca-0d47-4324-b85a-614ea38dc5f9
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default) zswap: yes
    compressor: zstd max-pool: 20%
  ID-1: swap-1 type: file size: 512 MiB used: 11.6 MiB (2.3%) priority: -2
    file: /swap/swapfile
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: full speed or root hub ports: 2 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-2: 1-1:2 info: Intel Integrated Rate Matching Hub ports: 6 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 8087:8008
    class-ID: 0900
  Hub-3: 2-0:1 info: full speed or root hub ports: 2 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Hub-4: 2-1:2 info: Intel Integrated Rate Matching Hub ports: 8 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 8087:8000
    class-ID: 0900
  Hub-5: 3-0:1 info: hi-speed hub with single TT ports: 15 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 3-1:2 info: SINO WEALTH Gaming KB type: keyboard,HID
    driver: hid-generic,usbhid interfaces: 2 rev: 1.1 speed: 12 Mb/s (1.4 MiB/s)
    lanes: 1 mode: 1.1 power: 500mA chip-ID: 258a:002a class-ID: 0300
  Device-2: 3-2:3 info: [Maxxter] USB GAMING MOUSE type: mouse,keyboard
    driver: hid-generic,usbhid interfaces: 2 rev: 1.1 speed: 1.5 Mb/s (183 KiB/s)
    lanes: 1 mode: 1.0 power: 100mA chip-ID: 18f8:0fc0 class-ID: 0301
  Hub-6: 4-0:1 info: super-speed hub ports: 6 rev: 3.0
    speed: 5 Gb/s (596.0 MiB/s) lanes: 1 mode: 3.2 gen-1x1 chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 28.0 C mobo: N/A gpu: amdgpu temp: 38.0 C
    mem: 40.0 C
  Fan Speeds (rpm): N/A gpu: amdgpu fan: 843
Info:
  Processes: 342 Power: uptime: 14m states: freeze,mem,disk suspend: deep
    avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 12.46 GiB services: org_kde_powerdevil,
    power-profiles-daemon, upowerd Init: systemd v: 256 default: graphical
    tool: systemctl
  Packages: 1538 pm: pacman pkgs: 1490 libs: 451 tools: pamac pm: flatpak
    pkgs: 48 Compilers: clang: 18.1.8 gcc: 14.2.1 Shell: Zsh v: 5.9 default: Bash
    v: 5.2.32 running-in: konsole inxi: 3.3.35

1 Like

There are a few options. Do you use any snapshotting software? (Timeshift, Snapper, etc.)

Since you are using btrfs, you can just send over one snapshot, or the current state. (Or everything, including snapshots, if you want.)

It’s usually faulty hardware. Btrfs catches stuff like bad CPU cache (common error among hardware failures), where other filesystems wouldn’t.

CloneZilla may be able to perform this task for you. While KDE Partition Manager can also be used to copy the partitions, you might have to deal with the UUIDs and reinstalling GRUB.

There’s also the possibility that the NVME device is overheating during intensive use, and the fact it “recovered” was due to it having sufficiently cooled down.

Yes, I’m using Timeshift.

For clone, i mean everything, so GRUB, all partitions including bootable one, files, etc.

If needed and can adjust the fstab UUID for the clone.

CloneZilla will allow you to clone the entire disk.

2 Likes

Thank you, will ready it.

1 Like

If you want to copy a live snapshot (even by clicking create when you want, and using that). But this does take a few steps on the command line. It’s really just 3 steps for the btrfs side.

CloneZilla is popular, but it can’t handle btrfs to the level it is meant for. Similarly, I have used dd for over 3 decades, slow but reliable exact copy of practically any OS. This way would also bring all your snapshots over (and CloneZilla should too). And both these methods would take a while, HDDs often take 14+ hrs for the whole thing.

Or you can just send over a snapshot. You don’t have to deal with UUIDs or anything, they all stay the same. But it is a few manual steps. I find it easy, but maybe not everyone.

e.g.

There’s a couple ways to copy our partition table over, or just recreate the partitions in the same order. EFI/btrfs/swap, or whatever you have. Sizes can be different if you want.

From here I’ll tell you the btrfs part of it. (You will need to do EFI and swap still.)

I’ll pretend the old drive (or even currently booted drive) is mounted in /mnt/src, and the new drive in /mnt/dst. (New drive just has mkfs.btrfs /dev/.. run on it.)

Repeat following commands, changing @ to @home, if you have /home as a separate volume.

# Set read/only (btrfs send only works with read-only snapshots)
btrfs prop set /mnt/src/timeshift-btrfs/snapshots/YYYY-MM-DD_HH-MM-SS/@ ro true

# Send whatever snapshot you want
btrfs send /mnt/src/timeshift-btrfs/snapshots/YYYY-MM-DD_HH-MM-SS/@ | btrfs receive /mnt/dst

Then you do the standard live image boot and do the manajaro-chroot/update-grub on the new drive.

I use mainly Foxclone. Been restoring the image 2-3 times. So I know it works. Happened when KDE 6 came out. My system got messed up. And I messed it up some more.

I do use Clonezilla as well but I prefer not to. Check out Foxclone if you want the easy way to do it. https://youtu.be/Sjw-4i3U-B0?feature=shared&t=419
It is like 2 clicks and waiting for it to be done.

One little tip: When you’ve booted Foxclone and started the Foxclone program, go to settings, the last tab. Increase the interface/font size. It is tiny otherwise. I can’t read a word. And you also have the option to pick partitions there. That is what I use. I don’t exactly have empty disks lying around.

1 Like

As told in another thread, be careful when cloning a btrfs drive. Two btrfs drives with the same UUID may lead to data loss:

CloneZilla will faithfully clone a disk irrespective of any file system(s) contained therein. To say “it can’t handle btrfs” is irrelevant in the context of byte for byte disk cloning.

Why do you prefer not to use CloneZilla? Is there something specific?; Do you find it too difficult to use?; Does it take too long?; or, some other reason?

Please share your experience with us.

Absolutely. Never boot into your OS with both the original and the newly cloned disk connected at the same time.

This is good advice no matter which filesystem is in use, but apparently BTRFS particularly finnicky.

2 Likes

Especially when it comes to filesystems, I like to understand all the tools at play. So I can use all the tools myself that CloneZilla uses. Here, it’s just like dd. Really any modern live boot image works for that.

I know it’s often not quicker, especially at first. But I enjoy learning. Even though I have had bad experiences with CloneZilla of old, hacky script tacked on to hacky script. But especially now, I’m sure it works over 99% of the time. Even more so for simple 1 to 1 transfers on the exact same medium. (I honestly just haven’t needed CloneZilla in ages.)

It bothers the geeky side of me as it’s doing it the same way as 50 years ago. When these newer modern filesystems like btrfs and ZFS have provided us tools to make things like this easier. It would be better if CloneZilla supported these, which I’m sure it will eventually. So you have the option to pick a snapshot, or volume(s), if you wanted. To CloneZilla as of now, btrfs may as well be an encrypted Windows 11 partition.

But that was my first question, want everything including past snapshots? Or you can do it a quicker (I/O-wise) btrfs way, if you don’t mind entering in the commands.

1 Like

Takes too long. Not that long but sometimes I just want “simple”. And I have to answer every stage of the questions correctly or I have to start over. So I usually end up doing that 5 times. Because I mess something up. Like what the target drive is. I am not familiar with their terminology so I have to “translate” it to make sense to me. And I forget things really fast.
But there are some things Foxclone can’t do. That is when I whip out Clonezilla.

Takes too long, or time well spent preserving your valuable data? Your choice! :wink:

Take care of what’s important, otherwise you may come to regret not doing so.

I could of course give instructions to do a disk clone using dd if i knew the needed specific details about your system, but that is probably extraneous here.

I confess, I haven’t used Foxclone, although I imagine it uses the same tools under the hood as CloneZilla (and others). I should take a look when I find the time.

I gave a link earlier to a brief guide to using CloneZilla for a simple disk to disk clone. Bookmark the link if you find it’s useful as a quick reference. Here it is again:

Cheers.

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