Jump to content

How to recreate a wiped /boot filesystem in Ubuntu

From Costa's Wiki
Revision as of 13:28, 10 September 2025 by Costa (talk | contribs) (Created page with "If you have a working system, you can just skip part 1 to 5. Boot up a Ubuntu live-cd macthing the version you are using. Mount your normal system partition. X is the drive letter. Y is the partition number: sudo mount /dev/sdXY /mnt Only if you have a separate boot partition (where sdYY is the /boot partition designation): sudo mount /dev/sdYY /mnt/boot Mount the critical virtual filesystems. for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; don...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

If you have a working system, you can just skip part 1 to 5.

Boot up a Ubuntu live-cd macthing the version you are using.

Mount your normal system partition. X is the drive letter. Y is the partition number:

sudo mount /dev/sdXY /mnt

Only if you have a separate boot partition (where sdYY is the /boot partition designation):

sudo mount /dev/sdYY /mnt/boot

Mount the critical virtual filesystems.

for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done

Chroot into your normal system device:

sudo chroot /mnt

Reinstall GRUB 2 (substitute the correct device with sda, sdb, etc. Do not specify a partition number):

grub-install --recheck /dev/sdX

Install ubuntu kernel (Internet is required)

apt-get install --reinstall linux-image-$(uname -r)

Recreate the GRUB 2 menu file (grub.cfg)

update-grub

Exit chroot: CTRL-D on keyboard

sudo reboot