I bought new computer with Win 10 pre-installed. I installed Debian on a new partition (same disc) and everything went well. But now I added new disc and I would like to move Debian to this disk.
Is there an easy way to do it?
I tried to use dd to copy the Linux partition to the new disc, but I'm not sure how to update grub, because update-grub didn't add the new partition with Debian partition to its menu.
This is fdisk -l output:
Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 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: gpt
Disk identifier: 0F8FCBCA-F7B2-429C-B02B-4A420C815CB7
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 739327 737280 360M EFI System
/dev/nvme0n1p2 739328 1001471 262144 128M Microsoft reserved
---------Win 10 partition-----------
/dev/nvme0n1p3 1001472 405315583 404314112 192.8G Microsoft basic data
---------Old Debian partition-----------
/dev/nvme0n1p4 405315584 484538367 79222784 37.8G Linux filesystem
/dev/nvme0n1p5 484538368 500117503 15579136 7.4G Linux swap
Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 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: gpt
Disk identifier: 77489E99-4F1D-4E2A-A984-6BE441B8A849
Device Start End Sectors Size Type
/dev/sda1 2048 15626239 15624192 7.5G Linux swap
---------New Debian partition-----------
/dev/sda2 15626240 488397134 472770895 225.4G Linux filesystem
/dev/nvme0n1 is old disc with Win10 and Debian I'm using now
/dev/sda is new disc, where I would like to migrate my current Debian
For now, I can safely boot into old Debian. Any advice on how to migrate it on /dev/sda? I can format or change structure of the new disk if it is needed.