Migrate Debian 10 Installation to a New 500GB SSD
This article will guide you through the process of migrating your existing Debian 10 installation from a 120GB SSD to a new 500GB SSD. We will cover key concepts, such as partitioning, cloning, and system configuration. By the end of this article, you will have a smoothly running Debian system on your new SSD.
Why Migrate to a New SSD?
A new SSD offers more storage capacity, faster read/write speeds, and greater longevity compared to older SSDs. Migrating your Debian installation is an excellent way to take advantage of these benefits.
Partitioning the New SSD
Before migrating your system, you will need to partition the new 500GB SSD. In this section, we will walk through the process of creating three partitions:
- A 512MB EFI system partition
- A 4GB swap partition
- A root partition, consuming the remaining space.
Begin by connecting the new SSD to your computer, then follow these steps to partition the drive:
sudo fdisk /dev/nvme0n1
- Create a new EFI System partition:
- Create a new swap partition:
- Create a new root partition:
- Write the partition table:
g
n
< 512M
ef00
a
1
n
< 4G
8200
a
2
n
< remaining space
8300
a
3
w
After partitioning the drive, format each partition using the appropriate file system:
sudo mkfs.fat -F32 /dev/nvme0n1p1
sudo mkswap /dev/nvme0n1p2
sudo mkfs.ext4 /dev/nvme0n1p3
Cloning the Debian Installation
Now that the new SSD is partitioned, you can clone your existing Debian installation to the new drive:
sudo dd if=/dev/nvme0n1p3 of=/dev/nvme0n1p3 bs=4M status=progress oflag=sync
Updating the EFI System Partition
After cloning, update the EFI system partition to ensure your new SSD boots correctly:
sudo mount /dev/nvme0n1p1 /mnt
sudo mount /dev/nvme0n1p3 /mnt/boot
sudo cp -r /boot/efi/* /mnt/
Configuring GRUB and System Settings
Configure GRUB and system settings to finalize the migration:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install /dev/nvme0n1
update-grub
- Partition the new SSD
- Clone the Debian installation
- Update the EFI system partition
- Configure GRUB and system settings