this post was submitted on 08 Aug 2024
28 points (100.0% liked)

Linux

10145 readers
59 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

Hi all,

I'm having a bad day and did something colossally stupid, deleting everything from /boot/.

The system is still running. What do you think my best course of action is?

My current idea is to create a timeshift backup, reinstall debian from USB, then restore from backup in timeshift

If this won't work or you have a better idea I would really appreciate your advice.

Thanks in advance

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 28 points 8 months ago (14 children)

Your system would continue to work as long as you don't turn it off. So no matter what you do, keep it on until you restored your /boot

Recovering it should be straightforward, assuming you didn't put custom files directly to /boot.

Just reinstall the linux kernels using apt. Then manually run grub-install with appropriate parameters. Finally, run update-grub or grub-mkconfig to recreate the grub config.

If the system is turned off, you can use live USB and chroot to it to properly install the kernel packages.

[–] [email protected] 1 points 8 months ago* (last edited 8 months ago) (6 children)

I've only ever used grub with bios/mbr or a BIOS/gpt (with grub bios partition).

No clue about efi/uefi.

This is the simplest method I can think of.

The arch wiki, however, is, as always, a great source of info:

https://wiki.archlinux.org/title/GRUB

**Linux is amazing in it's ability to keep working even when you accidentally all the things.

I once sudo apt removed mint-x-icons or something which, for whatever reason, also needed to remove cinnamon. As in cinnamon the entire DE.

I realised what I had done as I watched the terminal.
#%&@! panic.
...
reinstalled.
joy.

[–] [email protected] 5 points 8 months ago* (last edited 8 months ago) (5 children)

Linux is amazing in it's ability to keep working even when you accidentally all the things.

Annoyingly so. I once made a backup. Then to confirm it would restore the system, I deleted everything on root path. as in /

It did as told.

OK let's reboot and verify system.

Sudo reboot

Command not found

sudo shutdown

Command not found

But it sat there with a blinking cursor on the terminal

[–] [email protected] 1 points 8 months ago

Not to victim blame but you did put in --no-preserve-root. You had to read those instructions.😄

load more comments (4 replies)
load more comments (4 replies)
load more comments (11 replies)