Moving system from a storage device to another

I am planning to install an ssd on a computer and replacing the hdd. I plan on making a similar partition table, with manjaro installed on sda1 followed by a swap partition. I will therefore copy the entire contents of the partition from hdd to ssd. There is no separate partition for home and i will keep it that way. Hopefully, this should not cause problems anywhere where the OS accesses the drive by its name like sda or sda1, but there are multiple instances where it recognizes it with UUID, and I know i need to change that. Some places that i know include the fstab, udev rules, but what are other files where i should need to check for it. I was hoping that receiving input from multiple people would give me a exhaustive list, and save many hours of troubleshooting. Also if there are any other things to care about do tell (i know i have install grub and update it on the ssd).

Also while I am at it, should I change the file system from ext4 to btrfs for the ssd? And any changes I need to make if change the file system?

Assuming your hdd is gpt parted then, when you use Clonezilla to clone the partitions (not the whole disk!) you should be able to use the new ssd just from the start after replacing the old hdd.

To be 100% sure about it you need to share with us how the hdd is parted (msdos / gpt), sector size of old and new disk (e.g. 512 / 4096 B), total size of old and new disk and if you use BIOS or UEFI mode to boot.

here is the output of fdisk

Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: WDC WD5000AAKX-0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xee5c720b

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1       256432128 392867839 136435712  65.1G 83 Linux
/dev/sda2          206848 256432127 256225280 122.2G  7 HPFS/NTFS/exFAT
/dev/sda4       392867840 976773119 583905280 278.4G  f W95 Ext'd (LBA)
/dev/sda5       392869888 409593855  16723968     8G 82 Linux swap / Solaris
/dev/sda6       686084096 913856511 227772416 108.6G  7 HPFS/NTFS/exFAT
/dev/sda7       913858560 976771071  62912512    30G  7 HPFS/NTFS/exFAT
/dev/sda8       409595904 686082047 276486144 131.8G  7 HPFS/NTFS/exFAT

Partition table entries are not in disk order.

Disk /dev/loop0: 446.94 MiB, 468652032 bytes, 915336 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

so using clonezilla, i will not have to change anything manually?

Well, you have to change UUIDs on the new disk at /etc/fstab. To avoid that step, you could label the partition and mount it in fstab instead of UUID= with LABEL=root_manjaro before cloning.

No, when you read my post carefully:

That’s not the case:

I guess you are booting in BIOS mode. In this case I would rather clone the whole disk, but still for this decision you owe us some information:

but still for this decision you owe us some information:

Yes it is 512/4096 B . Disk size is 480GB.

512B for hdd (as we know already) and 4096 for new ssd? Logical or physical?

The more precise you answer the better you get helped. :wink:

Oh, I did not know about the format about writing it. Its 512 bytes logical sector with 4k alignment

This is something diiferent and linked to partitions not to the disk.

Anyway, if you have the same logical sector size, your new disk is larger than the old one then I would use Clonezilla to clone the whole disk. Afterwards you can use Gparted to resize it and get use of the unsued space on the new ssd. Cloning the disk (instead of partitions) is required to copy over the MBR and grub’s core.img.

This should work out of the box. Remember not to physically mount both disk after cloning, use only one disk at a time.

1 Like

Ok, So these are the steps i will have to take:

  1. Attach both disks.
  2. Boot into clonezilla from a flash drive
  3. Copy the entire hard drive to ssd
  4. Change values of UUID in fstab
  5. Use another flash drive with gparted to resize the partitions on ssd
  6. Format the hard drive
  7. Try booting from ssd

Thanks for help. Earlier i was just considering copying over all the files reinstalling grub on ssd. If i missed anything, please tell. I am considering saving an image with clonezilla too just in case

Instead of this, physically de-install the old disk. The UUID’s are copied, in this case no need to edit /etc/fstab.

Repartitioning you can do later-on, no urgent requirement.

Don’t format the old hdd before everything is working!!!

1 Like

Okay, thanks for help. That will make it easier. I was worried on how i would trace every file where UUID would need to change

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.