LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 03-26-2020, 03:25 PM   #1
onojk123
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Rep: Reputation: 0
dd command to clone a smaller nvme to a larger one.


Was wondering the best way to make use of the dd command for cloning a smaller nvme ssd to a larger one.

as root I entered, the following dd command.

Code:
dd if=/dev/nvme0n1 of=/dev/nvme1n1 status=progress
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.

I am doing this booting to a Live Debian USB.
 
Old 03-26-2020, 03:38 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,638

Rep: Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052
Some folks use sync command in that. Might have to use gparted to see if the drive is OK or even expand it.

dd command is sometimes too literal. Naming conventions get lost in loaders and other name issue. dd is good for exact.

Guess you could easily try clonezilla for this.

Is it uefi ?
 
Old 03-26-2020, 03:39 PM   #3
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 2,306

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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.
 
Old 03-26-2020, 03:44 PM   #4
onojk123
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Solved

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.
 
Old 03-26-2020, 03:44 PM   #5
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 2,306

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
Quote:
Originally Posted by jefro View Post
Is it uefi ?
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.
 
Old 03-26-2020, 06:14 PM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,030
Blog Entries: 1

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
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.
 
Old 03-26-2020, 07:44 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 19,638

Rep: Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052
"Could it not be" My systems need to have uefi enabled to access that media but I can't say all do.
 
Old 03-27-2020, 12:16 AM   #8
onojk123
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
Old 03-27-2020, 12:50 AM   #9
onojk123
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
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.

Last edited by onojk123; 03-27-2020 at 01:24 AM.
 
Old 03-27-2020, 01:50 AM   #10
onojk123
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Data in a Flash, Part II: Using NVMe Drives and Creating an NVMe over Fabrics Network LXer Syndicated Linux News 0 05-20-2019 11:41 PM
Migrate Linux/win10 dual boot from MBR nvme drive to a new GPT nvme drive bluemoo Linux - Software 7 09-25-2018 06:42 PM
use option -c to clone larger drives to smaller drives lmrmpc Linux - Newbie 1 11-09-2011 02:51 PM
Need more details on how to clone a larger disk to smaller with cp Mountain Linux - General 27 07-13-2010 11:04 PM
Compose two smaller images into one larger image diN0bot Linux - Software 4 03-14-2009 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration