debian – Change boot drive interface?
If the system does not currently boot on its own, you will need to boot from external media, mount the filesystems of the old system and chroot into the old system.
If you boot from a Debian installation media in recovery mode, it will offer to do the chrooting automatically for you. If you boot from some other live Linux media, here is the procedure: (replace <old root filesystem>
with whatever device contains the root filesystem of the old installation)
mount <old root filesystem> /mnt
mount -t proc none /mnt/proc
mount --rbind /dev /mnt/dev
mount --rbind /sys /mnt/sys
chroot /mnt /bin/bash
mount -a
Then you’ll need to edit /etc/initramfs-tools/modules
to add the module(s) required to access your disk and root filesystem, and to remove modules that are no longer applicable. For a SATA disk, the required modules are most likely libata
, libahci
, ahci
and sd_mod
unless your hardware is very special; for NVMe, t10_pi
, nvme_core
and nvme
respectively… but an “old Debian system” from hardware old enough to use PCMCIA might not support NVMe.
(Specifying the modules explicitly ensures update-initramfs
will try and include them, even if the external media has a different kernel configuration. If you see “module not found” errors from update-initramfs
in the next step, the module might be built into the kernel; try omitting the modules that are not available.)
After that, run update-initramfs -u -k <kernel version>
. If you don’t know which kernel version is in use in the old system, run ls /boot/vmlinuz-*
and look at the version suffixes of the vmlinuz-*
files.
You should also verify that the bootloader configuration and the kernel boot options refer to the system disk and root partition by labels or UUIDs, and that the /etc/fstab
is correct for the configuration of your new MB.
Read more here: Source link