Hi guys. I have ssd and nvme storages and need to copy system from ssd to nvme. Partition: efi (grub) (fat32) root (ext4) How can i do it easiest?
Start the system by using a live-CD/USB.
Now lets assume the ssd is /dev/sdx and the nvme is /dev/sdy…
as root use:
dd if=/dev/sdx of=/dev/sdy bs=4M status=progress conv=fsync
This will get you a 1:1 copy. After that you can use gparted to adjust the partitions on the target device to your needs.
Edit:
Make sure to double-check the device-names since all data on the target-device will be lost!
Edit 2:
simple best! Have a nice day!!!
Have problem with boot. Grub wont load it.
You will have to be a little more precise. At what stage did the boot fail? Are there any error messages? Did you remove the old boot-device? You should have two identical devices and booting either one or the other should make no difference. Using both at the same time will most likely fail.
Old partitions removed, have problem with dracut or switch root
Ok, so you get past the boot-menu and dracut fails when trying to find or mount the root device? This indicates either kernel modules missing in the initrd or a wrong UUID of the root-device. Without logs there will be no way to help you.
On the command line options for the kernel please check the UUID of the root-device, replace ‘rhgb quiet’ with ‘rd.shell rd.debug’ and please try to post a log along with the output of uname -r.
Since you can’t boot the cloned system, you need to chroot
into it. You can find a guide here: https://docs.fedoraproject.org/en-US/quick-docs/bootloading-with-grub2/#restoring-bootloader-using-live-disk
You need to adjust and rebuild your grub configuration to point to the cloned partitions. You can find useful information here
https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/ and here: https://fedoraproject.org/wiki/GRUB_2?rd=Grub2#Create_a_GRUB_2_configuration
Switch root sound a lot like the Dracut Emergency shell. After chroot into your system, also rebuild the initramfs using dracut -f
(see: https://fedoramagazine.org/initramfs-dracut-and-the-dracut-emergency-shell/)
You also have to adjust /etc/fstab/
to correctly mount your volumes/partitions.
Since all UUID’s and the bootloader match the source when using dd to clone, the problem most likely is a missing kernel module for the nvme - and rebuilding the initrd via chroot the way to go
Thank for help, guys!
Old drive read speed is 550Mb/s for ssd, new - 1.5GB/s for nvme. I tried to copy system to a new drive. Restored original system state, cause could not normally boot system from new storage. Have no time for experiments now. Maybe simplest way is make clean installation to new drive.
You’re welcome!
One thing you could try prior to a new installation is
- wipe the nvme
- add it to your current system and boot from the ssd
- if the system is up and running check that the nvme is accessible
- run dracut -f to rebuild the initrd with the needed kernel modules
- try to clone again
This time the initrd should match the nvme…
hmmm good idea, i did not do this after installation new drive. maybe it was cause of error during boot?
Thank you again, guys.
It’s amazing. I was make ‘dracute’ inside old system, than was boot LiveUSB Fedora 33 and make ‘dd copying’, old-drive-system was cloned and booted successfully from new storage without any magic actions ‘from-the-box’.
I think problem was in drivers after installing new device and was fixed by ‘dracute’.
In the F34 Test distribution, the components and disks were tested. As mentioned above, it works perfectly. Thanks for the good answers to the good questions.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.