[SOLVED] dd command to clone a smaller nvme to a larger one.
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The command finished but the target drive wouldn't boot. I looked up some stuff about legacy BIOS booting issues vs UEFI but I am not sure that is the problem.
I successfully cloned two drives that were the same brand and model before. However now that one is larger I am having an issue, perhaps.
Did you remove the target or the source before the post-clone boot attempt? One or the other must have UUID and likely other adjustments in place before next attempt with both installed for both to function normally afterward, if at all. Each must be unique in labeling and UUIDs on the ESP and root filesystems at a minimum. The difference in size should not make a difference, unless possibly the larger was previously in service partitioned in GPT mode and not first before cloning wiped, in which case the end of disk and front of disk partition tables would now be inconsistent with each other.
It worked this time. The only thing I changed was to put the source drive into an external enclosure and the target drive in the laptop... before it was reversed. Well what ever happened it is Solved.
Could it not be? Lack of UEFI support in conjunction with support for NVME doesn't seem likely in practice, if not unconditionally. I've never attempted MBR partitioning on an NVME device.
If it's ext2/3/4 you could dd the whole drive and repartition and resize2fs to expand the partition. Otherwise rsync and some edits would be more effective IMO. The rsync route would avoid existing fragmentation of files. For usb sticks just an edit to the /etc/fstab to know it's new partitions UUID. And installing grub plus configuration, or use an existing grub to boot the new home. Lots of routes, even the one that worked for you. Could just be that your route put the new home in a different nvme slot. Or the fact that your UUID's were not "UNIQUE", since it's an exact copy with dd. And removing / reformatting the OLD drive fixed it.
I should note that even though I cloned the drive I wasn't able to take advantage of the drive's larger space. So I am now using the dd command to make an image of the drive. I will expand the image to a the larger drive using Clonezilla. So I will see if I can make use of the drive's space in its entirety.
Also I am not sure I can use the dd created image. I think I have to use a Clonezilla created image. I mean as far as using the full space on the drive.
Ultimately Clonezilla was the solution for me. Using Clonezilla I created an image from the first drive and then restored that image to a larger drive. The extra space showed up as a swap partition. I removed the swap partition, which created free space which I then formatted. I am now able to use that space. I got the larger drive without having to reinstall Debian from scratch, Goal achieved.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.