Installing a 2nd NVMe Device on Debian 12: Properly Installing GRUB
In this article, we will cover the process of installing a second NVMe device on a Dell laptop running Debian 12, specifically focusing on the proper installation of GRUB. This is a crucial step to ensure that your system can boot correctly from the new device.
Preparing the System
Before we begin, it is important to ensure that your system is up to date and that you have backed up any important data. To update your system, run the following command:
sudo apt update && sudo apt upgrade
Identifying the Devices
Next, we need to identify the devices that are currently installed in your system. To do this, run the following command:
lsblk
This will display a list of all the block devices currently connected to your system. Take note of the name and size of the current NVMe device and the new 4TB device that you will be installing.
Partitioning the New Device
Now, we need to partition the new 4TB device. To do this, run the following command:
sudo fdisk /dev/nvme1n1
This will open the fdisk utility for the new device. Follow the prompts to create a new partition table, a new partition, and to set the partition type to Linux filesystem. Once you have finished, you can write the changes to the disk and exit the utility.
Formatting the New Partition
Next, we need to format the new partition. To do this, run the following command:
sudo mkfs.ext4 /dev/nvme1n1p1
This will format the new partition as an ext4 filesystem.
Mounting the New Partition
Now, we need to mount the new partition. To do this, run the following commands:
sudo mkdir /mnt/newdisk
sudo mount /dev/nvme1n1p1 /mnt/newdisk
This will create a new directory for the new disk and mount the new partition to that directory.
Installing Debian 12 on the New Device
Next, we need to install Debian 12 on the new device. To do this, run the following command:
sudo debian-installer live --media-path /mnt/newdisk/ --bootloader-installation grub-efi --efi-directory /boot/efi
This will launch the Debian installer and install Debian 12 on the new device. Be sure to select the correct disk during the installation process.
Installing GRUB on the New Device
Finally, we need to install GRUB on the new device. To do this, run the following command:
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Debian --recheck /dev/nvme1n1
This will install GRUB on the new device and configure it to boot from the new disk.
- Update your system
- Identify the current and new devices
- Partition the new device
- Format the new partition
- Mount the new partition
- Install Debian 12 on the new device
- Install GRUB on the new device
References
- Debian Handbook: https://debian-handbook.info/get/
- GRUB Manual: https://www.gnu.org/software/grub/manual/grub/grub.html
- Debian Wiki: https://wiki.debian.org/
--endarticle--