Unable to mount btrfs partition on my cloned disk

Hello friends.

2 days ago I bought a 500GB SSD Sata and try to clone to him my old 500GB HDD with Manjaro installation.

First I clone my old disk to another HDD using clonezilla but when I try to restore it to my new SSD, after 8 hours of working (96% done) it gives me some error. I don’t remember what was that error because I was so angry that I turn off my PC and go sleep.

Next day I decide to use Rescuezilla whit option clone. Everything go fast and was done but there was shown a message:

Cytat

Successfully restored image partition /dev/sdb1 to /dev/sda1
Resizing partition /dev/sda1 (btrfs) failed: Failed to run command: mount -t btrfs /dev/sda1 /mnt/…
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.
Successfully restored image partition /dev/sdb2 to /dev/sda2

I run Manjaro Live and try to mount my SSD but there is the same error:

    ~  sudo mount -t btrfs /dev/sda1 /mnt                                                                                                                                                                   ✔ 
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.

I was looking for some solution but nothing match to my issue.

Pls help

    ~  lsblk -f                                                                                                                                                                                         INT ✘ 
NAME       FSTYPE   FSVER            LABEL            UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0      squashfs 4.0                                                                          0   100% /run/miso/sfs/livefs
loop1      squashfs 4.0                                                                          0   100% /run/miso/sfs/mhwdfs
loop2      squashfs 4.0                                                                          0   100% /run/miso/sfs/desktopfs
loop3      squashfs 4.0                                                                          0   100% /run/miso/sfs/rootfs
sda                                                                                                       
├─sda1     btrfs                                      619a3ee2-88a2-48cf-bd87-d34c3ce88064                
└─sda2     swap     1                swap             6da3b062-f33a-45f5-8ace-ac17fccc6974                
sdb                                                                                                       
├─sdb1     btrfs                                      619a3ee2-88a2-48cf-bd87-d34c3ce88064                
└─sdb2     swap     1                swap             6da3b062-f33a-45f5-8ace-ac17fccc6974                
sdc                                                                                                       
└─sdc1     btrfs                     Backup           b25d1d8e-31be-4d80-82d2-f853013428c4                
sdd                                                                                                       
├─sdd1     exfat    1.0              Ventoy           4E21-0000                                           
│ └─ventoy iso9660  Joliet Extension MANJARO_KDE_2125 2022-03-14-10-19-45-00                     0   100% /run/miso/bootmnt
└─sdd2     vfat     FAT16            VTOYEFI          B336-78FD                                           
sr0                                                                               
      ~  sudo fdisk -l                                                                                                                                                                                        ✔ 
Disk /dev/sda: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SSDPR-CX400-512-
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe1244e6d

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 958313125 958311078  457G 83 Linux
/dev/sda2       958313126 976768064  18454939  8.8G 82 Linux swap / Solaris


Disk /dev/sdb: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST500DM002-1BD14
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xe1244e6d

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1  *         2048 958313125 958311078  457G 83 Linux
/dev/sdb2       958313126 976768064  18454939  8.8G 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.


Disk /dev/sdc: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: HGST HTS725050A7
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xbf8187ea

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc1        2048 976766975 976764928 465.8G 83 Linux


Disk /dev/loop0: 18.94 MiB, 19861504 bytes, 38792 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 834.63 MiB, 875171840 bytes, 1709320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 2.01 GiB, 2159173632 bytes, 4217136 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 642.82 MiB, 674045952 bytes, 1316496 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdd: 7.28 GiB, 7811891200 bytes, 15257600 sectors
Disk model: Flash Disk      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8f5137b8

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sdd1  *        2048 15192063 15190016  7.2G  7 HPFS/NTFS/exFAT
/dev/sdd2       15192064 15257599    65536   32M ef EFI (FAT-12/16/32)


Disk /dev/mapper/ventoy: 3.54 GiB, 3805800448 bytes, 7433204 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device                   Boot   Start     End Sectors  Size Id Type
/dev/mapper/ventoy-part1 *         64 7425011 7424948  3.5G  0 Empty
/dev/mapper/ventoy-part2      7425012 7433203    8192    4M ef EFI (FAT-12/16/32)
                                                                      

Common problem is the space-cache, because 2 versions…

 sudo mount -t btrfs -o space_cache=v1 /dev/sda1 /mnt
 sudo mount -t btrfs -o space_cache=v2 /dev/sda1 /mnt

Maybe clear the cache:

sudo btrfs check --clear-space-cache v1 /dev/sda1
sudo btrfs check --clear-space-cache v2 /dev/sda1  

You cannot mix it and I guess v2 is default in mount now.

    ~  sudo btrfs check --clear-space-cache v1 /dev/sda1                                                                                                                                                INT ✘ 
Opening filesystem to check...
bad tree block 22036480, fsid mismatch, want=619a3ee2-88a2-48cf-bd87-d34c3ce88064, have=b9af6c01-6c90-46c2-bbcf-b23543364da2
ERROR: cannot read chunk root
ERROR: cannot open file system
    ~  sudo btrfs check --clear-space-cache v2 /dev/sda1                                                                                                                                                  1 ✘ 
Opening filesystem to check...
bad tree block 22036480, fsid mismatch, want=619a3ee2-88a2-48cf-bd87-d34c3ce88064, have=b9af6c01-6c90-46c2-bbcf-b23543364da2
ERROR: cannot read chunk root
ERROR: cannot open file system
    ~  sudo mount -t btrfs -o space_cache=v2 /dev/sda1 /mnt                                                                                                                                               1 ✘ 
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.

Puh… the chunk-tree is damaged… repairing this will take a lot of time… something really bad happened here…

Better avoid clonezilla and btrfs… use the normal linux tools with the manjaro iso…

dd if=/dev/sXY of=/dev/sdXY bs=64K conv=noerror,sync status=progress

Keep sure, that the btrfs filesystem on the hdd is clean.

sudo btrfs check --check-data-csum /dev/sdXY

I suspect that this new SSD is probably damaged.
Check sudo smartctl -A /dev/sda

Ok I will do what you suggest, but maybe it is problem with my source hdd, bcs I try clonezilla, than rescuezilla clne option, and even rescuezilla backup/restore option and it always failed.

Maybe the best way is to install fresh Manjaro on my new SSD and copy data from my old HDD?

I try to clone becouse configuration fresh OS take me usualy couple days but now I’m fighting 3 days with cloning and I stuck :smiling_face_with_tear:

What You think?

No, because when I delete partitions and create new one, it works fine, the problem appear when I clone my old HDD to SSD

Yes, if you think that new installation and copy old data are faster than using Clonezilla:

I have never tried Clonezilla.

That was my first time :wink:

Better use btrfs features for cloning… example with @ (root) subvolume:

sudo su

(Create the exact same partition table on the ssd like on the hdd)
Mount the filesystems:

mount -m -t btrfs /dev/sdXY /mnt/hdd
mount -m -t btrfs /dev/sdXY /mnt/ssd

Create a snapshot on the source HDD:

btrfs subvolume snapshot -r /mnt/hdd/@ /mnt/hdd/@_snapshot

Now to send it to another disk. This will create a readonly subvolume on the new drive called @_snapshot:

btrfs send /mnt/hdd/@_snapshot | btrfs receive /mnt/ssd

Create a writeable snapshot to complete the move:

btrfs subvolume snapshot /mnt/ssd/@_snapshot /mnt/ssd/@

Clean up your old, temporary snapshots

btrfs subvolume delete /mnt/hdd/@_snapshot
btrfs subvolume delete /mnt/ssd/@_snapshot

Now you have cloned the subvolume @, the root filesystem. Repeat it with every subvolume.

To complete the task and having the same UUID, set it manually:

blkid -s UUID -o value /dev/sdXY
sudo btrfstune -U  <UUID> /dev/sdXY

Keep in mind that it is a bad idea when 2 connected partitions have same UUID. Otherwise you can edit /etc/fstab correct it with new UUID and reinstall grub in a chroot.

I think that BTRFS filesystem with its old options (as hardcode) for HDD, that means it is well compatible with your old HDD technology.
But the old options of BTRFS filesystem are not compatible with your SSD. That is why you can not clone the old options of BTRFS into your SSD. You should reinstall the filesystem that BTRFS will automatically define certain correct options for SSD technology. That is my guess

Ok, I decide to install fresh Manjaro OS on my SSD.

Now I have question, what tools you recommend to create image of my good-manjaro-instalation, to backup installed programs (with configurations) and to backup my data when I’m using btrfs filesystem?

If it should be really an image, then use btrfs tools:

sudo mount -m /dev/sdXY /mnt/root
sudo btrfs subvolume snapshot -r /mnt/root/@ /mnt/root/@_snapshot
sudo btrfs send /mnt/root/@_snapshot -f /path/to/root_subvol.img
sudo btrfs subvolume delete /mnt/root/@_snapshot

Restore:

sudo mount -m /dev/sdXY /mnt/root
sudo btrfs receive /mnt/root/ -f /path/to/root_subvol.img
btrfs subvolume snapshot /mnt/root/@_snapshot /mnt/root/@
btrfs subvolume delete /mnt/root/@_snapshot

But note: This image file is a stream and not browse-able, but exactly a cloned subvolume.