I have a laptop with Xubuntu installed.
At install I chose the full disk encryption option.
But yesterday i accidentally dd-ed a DSL image to sda1 (/boot partition) instead to sdb1 (pendrive).
How can i repair my /boot ?
bootencryptionluksxubuntu
I have a laptop with Xubuntu installed.
At install I chose the full disk encryption option.
But yesterday i accidentally dd-ed a DSL image to sda1 (/boot partition) instead to sdb1 (pendrive).
How can i repair my /boot ?
Best Answer
Hello I tested the following commands in my laptop - yeah I deleted everything in
/dev/sda1
and I got it working again - so here it is:- First lets get a clean(this was due to "dd-ed a DSL image to sda1" in OP post)/dev/sda1
- open GParted; reformat/dev/sda1
with ext2 and don't forget to confirm the changes and then set the "boot" flag (right click on the partition --> select "Manage Flags" --> check the box next to "boot" [this automatically causes the "esp" flag to be set to] --> click the "Close" button).Now we will prepare everything to
chroot
into the installed system and then we will switch into it (viachroot
):Okay let's
delete andreinstall GRUB:grub-install /dev/sda
apt purge grub-common
(have your terminal in fullscreen-mode due to ncurses), this might ask you if it shall delete everything - select yes; now lets reinstall it withapt install grub-pc
here select/dev/sda
when asked.Lastly we need to reinstall a kernel to get the needed initrd.img-* and vmlinuz-* images into "/boot/". We get currently-installed kernels with
apt list --installed linux-image-*
and now we reinstall this kernel withapt install linux-image-[version-numbers]-generic --reinstall
- don't forget to exchange the brackets with an actual version number.Almost done; exit chroot with Ctrl + d, or just type
exit
, and then reboot (via GUI menus or withsudo reboot
)!Used resources: