xubuntu - How to repair /boot on LUKS encrypted harddrive? - Ask Ubuntu
i have laptop xubuntu installed.
at install chose full disk encryption option.
but yesterday accidentally dd-ed dsl image sda1 (/boot partition) instead sdb1 (pendrive).
how can repair /boot ?
hello tested following commands in laptop - yeah deleted in /dev/sda1 , got working again - here is:
get live-image , boot it.
first lets clean /dev/sda1 - open gparted; reformat /dev/sda1 ext2 , don't forget set "boot"-flag (right click on partition , select appropriate option) , confirm changes.
now prepare
chroot
installed system , switch it:sudo cryptsetup luksopen /dev/sda5 sda5_crypt sudo vgscan --mknodes sudo vgchange -ay sudo mount /dev/mapper/ubuntu--vg-root /mnt sudo mount /dev/sda1 /mnt/boot in /dev /dev/pts /proc /sys /run; sudo mount -b $i /mnt$i; done sudo chroot /mnt
okay let's delete , reinstall grub:
apt purge grub-common
(have terminal in fullscreen-mode due ncurses), might ask if shall delete - select yes; lets reinstallapt install grub-pc
here select/dev/sda
when asked.lastly need reinstall kernel needed initrd*- , vmlinuz*-images /boot/ . installed kernels
apt list --installed linux-image-*
, reinstall kernelapt install linux-image-[version-numbers]-generic --reinstall
- don't forget exchange brackets actual version number.almost done; exit chroot
ctrl-d
, reboot!
used resources:
Comments
Post a Comment