I have Ubuntu 18.04.3 on a mechanical 500 GB drive. I have added an SSD. I installed Ubuntu 18.04.3 on the SSD. The SSD is sda and the mechanical disk is sdb. Both disks have the same number of sectors.
I have more than a year of changes to the system installed on the mechanical disk.
I want to duplicate sdb
on to sda
. Is this possible?
If I boot sdb
, will sudo dd if=/dev/sdb of=/dev/sda bs=2G
work?
Is there a simpler way to duplicate the installation? I mostly want the apt and python packages to be the same.
sudo fdisk -l /dev/sd[ab]
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x87f0c3fe
Device Boot Start End Sectors Size Id Type
/dev/sda1 409600 2506751 2097152 1G 83 Linux
/dev/sda2 * 2506752 212221951 209715200 100G 83 Linux
/dev/sda3 212221952 279330815 67108864 32G 82 Linux swap / Solaris
/dev/sda4 279330816 976773119 697442304 332.6G 83 Linux
Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: dos
Disk identifier: 0x49598911
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 976656 974609 475.9M b W95 FAT32
/dev/sdb2 * 976896 352538623 351561728 167.7G 83 Linux
/dev/sdb3 352538624 391600127 39061504 18.6G 82 Linux swap / Solaris
/dev/sdb4 391600128 976771071 585170944 279G 83 Linux