These are old notes from like 2022, but the process is probably still mostly the same. Let me know if there are any issues.
Our Linode image only contains the system partition, that is to say what is normally /dev/sda1
is instead the entire disk, /dev/sda
. We’ll need to copy the entire disk’s data to a partition on a new disk so that we can fit a partition layout and therefore a bootloader.
# Get root shell
sudo su
# Copy the data!
dd if=/dev/sda of=/dev/sdb1 status=progress
# Time to do some config editing...
mount /dev/sdb1 /mnt
# In fstab, comment out the line pointing to the swap partition.
nano /mnt/etc/fstab
# Remove the command line parameters from the GRUB config.
nano /mnt/etc/default/grub
# Install the GRUB bootloader
grub install --boot-directory=/mnt/boot /dev/sdb
# The output it provides is gonna be a bit screwed up for now.
# Edit the file below to replace all `root=/dev/sda` with `root=/dev/sda1`
nano /mnt/boot/grub/grub.cfg
poweroff
# Get root again...
sudo su
# Fix the bootloader for real this time
update-grub
# Fix your network interfaces (https://wiki.debian.org/NetworkConfiguration)
nano /etc/network/interfaces
# Fix your APT sources by replacing all instances of `mirrors.linode.com` with `deb.debian.org`
nano /etc/apt/sources.list
# Empty this file and fix your DNS nameservers. You should probably point it to your router if you don't know what you want to put here.
nano /etc/resolv.conf
# Off to the races!
apt update
apt upgrade
Comments are currently disabled.
By enabling comments, you agree to allow this website to connect to Cusdis and to the Cusdis Privacy Policy.