Hello,
I want to clone/migrate my Linux partition to a new 1 TB M.2 from my old 120 GB SSD, but I ran into some difficulties. It’s just Manjaro, no dual boot!
I tried using dd, since it supports ext4. The cloning itself seems to work perfectly fine using:
sudo dd if=/dev/sda of=/dev/nvme0n1 bs=64K conv=noerror,sync
Using gparted I can see the same “amount” of data on my new M.2 as on my old SSD, as well as the same partitions.
What doesn’t work however, is changing the UUID of the new drive. Following this guide ( How to move Linux root partition to another drive quickly | by Dominik Gacek | Medium ) I tried the following:
sudo mdir /mnt/new
sudo mount /dev/nvme0n1 /mnt/new
which outputs an error message:
mount.nilfs2: Error while mounting /dev/nvme0n1 on /mnt/new: Invalid argument
so I tried skipping this part of the tutorial coming straight to the UUID:
-
generate new UUID:
uuidgen
-
rebrand M.2 UUID:
sudo tune2fs /dev/nvme0n1 -U 2f5d19a5-a1fd-4e5a-9858-081579002830
this however also outputs an error message (I did some translation on it):
tune2fs 1.46.4 (18-Aug-2021)
tune2fs: invalid magic number in the super block trying to open, /dev/nvme0n1
/dev/nvme0n1 contains data from „DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 1953525167 sectors, extended partition table (last)”
I did initialize the partition table of the M.2 as gpt.
Now I am stuck and don’t know how to proceed.
Is this even a valid attempt on migrating?
I know there are other tools to migrate (e.g. clonezilla). however these do not support the “ext4” type, which after some quick and shallow research should be superior to “ext3”.
Is there a way to do a new clean install and afterwards just copy the properties of my old partition?
In the beginning I thought: “just clone it, reboot and you’re done :^)”
Any help or alternative method is appreciated.