You are not logged in.

#1 2017-11-29 01:15:07

gugah
Member
Registered: 2013-01-02
Posts: 60

Clone HDD to a new SSD Nvme unit

Hi all,

I'm getting an SSD nvme drive in a few weeks and I'm planning to use it to replace the current HDD I have.
I've checked that my laptop supports nvme boot, I'm also going to clone the HDD using:

# dd if=/dev/sdX of=/dev/nvmeY

where sdX is the HDD and nvmeY is the SSD unit.
I also have to generate the fstab file again.
Is there any other thing I need to consider and I'm missing?

Thanks!

Last edited by gugah (2017-11-29 01:17:17)


"The problem with quotes on the Internet is that it is hard to verify their authenticity." ~ Abraham Lincoln

Offline

#2 2017-11-29 01:34:13

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Clone HDD to a new SSD Nvme unit

Are they exactly the same size?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#3 2017-11-29 03:41:41

gugah
Member
Registered: 2013-01-02
Posts: 60

Re: Clone HDD to a new SSD Nvme unit

ngoonee wrote:

Are they exactly the same size?

Forgot about that! They're both around 500 GB but most likely not exactly the same size. Here's some extra info of the HDD I've gotten from fdisk -l

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disklabel type: gpt

I haven't received the nvme yet. What should I do if it is smaller or larger in capacity?

Last edited by gugah (2017-11-29 03:42:47)


"The problem with quotes on the Internet is that it is hard to verify their authenticity." ~ Abraham Lincoln

Offline

#4 2017-11-29 04:54:57

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,592

Re: Clone HDD to a new SSD Nvme unit

I've done a similar migration from a HDD to a smaller SATA SSD. Just shrunk all partitions so that the last one ended in less sectors that were available on the new drive, cloned it with dd, then rewrote the partition table on the new drive to make it valid. Everything worked fine, and ended up with the same UUIDs and PARTUUIDs to make the migration simple.

Offline

#5 2017-11-29 13:47:11

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Clone HDD to a new SSD Nvme unit

gugah wrote:

I haven't received the nvme yet. What should I do if it is smaller or larger in capacity?

Use rsync to copy the old partition to the new one. I have done this several times when migrating an install to different hardware. Put a filesystem on the new partition, rsync, and update the fstab and your bootloader after the rsync.

https://wiki.archlinux.org/index.php/Rs … tem_backup

Last edited by 2ManyDogs (2017-11-29 13:50:08)

Offline

#6 2017-11-30 03:45:08

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Clone HDD to a new SSD Nvme unit

2ManyDogs wrote:
gugah wrote:

I haven't received the nvme yet. What should I do if it is smaller or larger in capacity?

Use rsync to copy the old partition to the new one. I have done this several times when migrating an install to different hardware. Put a filesystem on the new partition, rsync, and update the fstab and your bootloader after the rsync.

https://wiki.archlinux.org/index.php/Rs … tem_backup

How does rysnc handle /dev/proc and similar? Also better make sure your rsync flags are just right if doing this. And note that UUIDs will of course change.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#7 2017-11-30 07:01:06

NuSkool
Member
Registered: 2015-03-23
Posts: 141

Re: Clone HDD to a new SSD Nvme unit

2ManyDogs wrote:

Use rsync to copy the old partition to the new one.

  +1

Have my main box do a weekly automated, bootable, BU, from 2 partitions sda to 2 partitions sdb. Just edit your fstab and boot loader. I don't use uuid's.

Here's the important bits from my script for an example. The --delete option keeps the backup pacman DB straight, and keeps the BU clean. You can start with --dry-run option to check things out.

mount /dev/sdb6 /mnt/root
mount /dev/sdb8 /mnt/home

rsync -aAHXv --delete --exclude={/etc/fstab,/home/*,/dev/*,/proc/*,/sys/*,/tmp/*,/var/tmp/*,/run/*,/mnt/*,/media/*,/root/.cache/thumbnails/*,/lost+found} / /mnt/root
rsync -aAHXv --delete --exclude={pics/,dom/.thumbnails,dom/.cache/mozilla,dom/.cache/google-chrome,dom/.cache/thumbnails,dom/.local/share/Trash/,.Trash-0/} /home/ /mnt/home

umount /dev/sdb6
umount /dev/sdb8

Last edited by NuSkool (2017-11-30 07:11:56)

Offline

#8 2017-11-30 13:47:34

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: Clone HDD to a new SSD Nvme unit

ngoonee wrote:

How does rysnc handle /dev/proc and similar? Also better make sure your rsync flags are just right if doing this. And note that UUIDs will of course change.

I usually do this from a live USB so the system I am copying is not running, but the wiki page I linked includes flags for excluding "/dev/proc and similar". I also mentioned that the fstab and bootloader would need to be reconfigured (because the UUIDs change if you use them) but thanks for the reminder.

Last edited by 2ManyDogs (2017-11-30 13:51:38)

Offline

Board footer

Powered by FluxBB