Has anyone ever cloned a disk with the GPT partition scheme?
So, I'm trying to clone an SSD to an NVME drive and I'm bumping into this "dev-disk-by" error when I boot from the NVME (the SSD is unplugged).
I can't find anyone talking about this in this context. It seems like what I've done here should be fine and should work, but there's clearly something I and the arch wiki are missing.
probably the disk UUID has changed because of the path to the NVMe vs SSD. If you use partition UUID, they will be exactly the same, but the UUID of the physical disk is not cloned, as it is a identifier of the physical device and not it's content.
Definitely second this. If you're using LVM, it uses the physical UUID for the pv. You have to update that on the new drive so it knows where the vg and lvs are being mounted to.
So I fixed this by using clonezilla (which seemed to fix things up automatically), but for my edification, how do you get the UUID of the device itself? The only UUIDs I was seeing seemingly were the partition UUIDs.
I know it’s not what you meant, but I just imagined someone typing in “pretend you are a disk cloning utility and output the code needed to clone /dev/disk0 to /dev/disk1 in as efficient a manner as possible.”
Seems to me that using rdisk would be significantly faster than disk, as disk pipes all the data through a superfluous serial channel?
You need to make sure both /etc/fstab and the boot cfg are pointing to the new partitions. Since they are using uuid, if the uuid changes due to the method used to clone, it won't find the disk partition.
I'm confused. You say that you're booting off that drive that it can't find. Like, this is your root drive?
But I believe that the kernel finding the root drive should happen much earlier than this. Like, you've got systemd stuff there on the screen. For that to happen, I'd think that you'd need to have your root drive already up and mounted. Grub hands that off to the kernel, believe that it's specified in /etc/default/grub on my Debian system, then gets written out when you run sudo update-grub.
If I'm not misunderstanding that you are saying that the drive in question is your root drive, are you sure that this isn't happening because there's a reference to the drive -- maybe another partition or something -- in /etc/fstab is failing to find something?
Or maybe I'm just misunderstanding what you're saying.
EDIT: if you just want to get it working, unless you've got some kind of exotic setup, I expect that you can probably boot into a very raw mode by, from grub, passing init=/bin/sh on the kernel command line. A lot of stuff won't be functional if you do that, since you'll just be running a shell and the kernel, but as long as you have a root filesystem, it'll probably come up. Then I'd mount -o remount,rw / so that you can modify your root drive, and then fiddle your /etc/fstab into shape. Probably a live distro is more comfortable to work in, but if all you need is to get the regular system up, I'd think that fiddling with /etc/fstab is likely all you need to do that.
EDIT2: and then I'd probably compare the output of blkid to your fstab, from within the boot in your regular system, if that isn't what you already did.
I did this recently, and encountered exactly the same issue. I can't say whether it's the same root cause, but it might be.
The device ID for the efi or boot partition may change, and in this case you have to make certain you hunt down every reference to it and update it. IIRC in my case it was in a config file for dracut, and I cottoned on when I upgraded the kernel and got back in the hung mode.
If you know the old blkid, do a deep search in both your efi partition as well as /etc and make sure you've changed to the new device UUIDs.
Very interesting. I wasn't finding anywhere what the device ID was. Everything was looking like it was copied over from where I was (at least noticing).
Clonezilla seems to have taken care of the necessary updates so if you do this again I'd recommend just using that. I hate that it's yet another special ISO tool to keep around on a USB thumb drive, but if I'd used that from the start several hours of my life would've been saved 😅
In my case, it was just too many technology changes from what I was used to, and simply wasn't familiar enough with. It doesn't help that every distro seems to do everything slightly differently, rather than just agreeing on a standard. The egotistical NIH may be the most frustrating thing about distro builders.
EFI and dracut are both novel to me; efi I'm starting to become more comfortable with, but dracut is new and I'm not entirely sure how it works and where it puts all of its config stuff. It's still better than systemd-boot, which was mostly a catastrophe for me; it worked fine until you wanted to draw outside of the lines a little and then you discover a mountain of spaghetti. I probably should have just stayed with grub, but I wanted snapshot booting, and grub is beginning to struggle with some of these new modalities.
Anyway, I don't want to have to rely on a custom specialized distro, and I figured out my problem in a couple of days; I only have to screw it up two or three more times and then I'll be comfortable with it :-)