Using the installer to flash the kernel again
Every once in a while someone asks how they can use the Debian installer to access their system on disk to run commands, for example to write the kernel and ramdisk to flash again. This is particularly useful on headless NAS devices. So here's how to do it:
- Start the Debian installer.
- Remove the SSH key from ~/.known_hosts because the installer will always generate a new key.
- Connect to the installer with SSH: ssh installer@...
- Follow the installer until you reach the partitioner, then choose "go back".
- Open a shell (look for Execute a shell towards the end of the menu).
- Run the commands below (the example assumes that /boot is /dev/sda1 and / is /dev/sda2.
mkdir -p /target mount /dev/sda2 /target mount /dev/sda1 /target/boot mount --bind /dev /target/dev mount -t proc none /target/proc mount -t sysfs none /target/sys chroot /target /bin/sh # the prompt will change # make modifications to the system and regenerate the initramfs update-initramfs -u exit # the prompt will change again as you're leaving the chroot umount /target/sys umount /target/proc umount /target/dev umount /target/boot umount /target reboot
Wed, 17 Mar 2010; 17:24 —
debian —
permanent link