How to detect and fix file corruption in /boot, /boot/efi ,and /?

jacklhoward

New Member
Joined
Apr 10, 2023
Messages
7
Reaction score
3
Credits
104
In windows it's very likely to corrupt system data in the ntfs partition so I am very worried about the same in linux. Normally on windows the repair process is basically doing dism and sfc, rebuild efi partition from a live usb. I understand linux are separated into different mountable partitions. I know /boot can be repaired by verifying all packages using package managers. /root can be repaired if there is a system backup, but i wonder is there another way to fix it like from an online mirror, from a command run in the os or from a live usb? as for /boot/efi, i have no idea how to check for file corruption as everything i found online is about repairing grub bootloader, and it seems as long as the boot loader works fine you shouldnt worry.
 


jacklhoward wrote:
I understand linux are separated into different mountable partitions.
Excepting the efi partition the user can choose the number of additional partitions from a single one for the whole installation, or more.
/boot can be repaired by verifying all packages using package managers.
It depends on what the problem is. /boot holds the kernels, initramfs files, grub and the efi partition and each can be repaired by different means with robust and reliable linux tools.
/root can be repaired if there is a system backup, but i wonder is there another way to fix it like from an online mirror, from a command run in the os or from a live usb?
"/root" is actually the home directory for the root user, but I guess you mean the root partition. In addition to the previous answer, there are command line tools in a linux installation to carry out repairs, and GUIs for some of them, and there are live distros which can be written to cd, dvd or usb that can be used to make repairs, and also specialised rescue disks which may have additional advanced tools. As for mirrors, they are usually for downloading packages, but may also hold iso images which can be downloaded and written to disks or usbs that can be used for repairs.
as for /boot/efi, i have no idea how to check for file corruption as everything i found online is about repairing grub bootloader, and it seems as long as the boot loader works fine you shouldn't worry.
There is a program to manage the efi partition (efibootmgr) and the grub bootloader has means of repair and rescue that are also robust and reliable. There are also alternative boot loaders for linux.

It's not difficult to agree with your last expression: "you shouldn't worry". No, you shouldn't.

It's worth making the point that the linux operating system is not MS. It's its own "thing" with a derivation from UNIX that long predates MS and a history deeply rooted in that derivation. Thus, it has its own learning curve, its own culture, its own fascination and phenomenal power, among many other benefits and advantages, not the least of which is the freedom to construct things in an infinite number of ways to satisfy your needs and wishes on your computer.
 
Last edited:
Welcome to the Forum.
m0135.gif


In 8 years of running Linux Mint I've never had corrupt system files why? because Linux isn't windowz...when you switch to Linux forget everything you did in windowz and start living the dream.
m1213.gif


You don't need to repair anything because Linux doesn't break unless you break something which some do and then they blame Linux. :oops:
 
Welcome to the forums
Because Linux is built from packages and dependencies, there are many different ways for the user to repair the system, unlike the monolith of MS where you are limited as to how much you can do.
Linux is not Windows, you will incur a learning curve, how steep is up to you.
 
G'day Jack, Welcome to linux.org

I can understand your concerns....having come from windows myself (around 9 years ago, approx)...I now can tell you that you can throw at least some of those concerns out the window (yeah, that was a pun!!)

Tell us which Linux you have installed....or plan to install. It is a reaasonable idea to first install Linux Mint 21.1.......but tell us what specs your pc has and we can advise further

The simplest way to repair all those things, is to take Timeshift snapshots and store them on an external drive

I take snapshots each day (automatic), and I keep just 3. Timeshift gets rid of the older ones each time it make s a new one.

So....if your /grub etc etc or similar goes south, or you happen to do something to screw up your install.....you can do one of two things
1. Access Timehsift on your pc and go back a day or more and simply hit Restore
2. If you cannot get into the opperating system becasue the screw up is thta bad....boot a a usb stick with your operating system on it....open Timehsift on there and open Timeshift there also .....locate where you have your snapshots stored, and hit Restore.

Thats about it.

Nothing to break into a sweat about.

Settle back and enjoy Linux....without all the drama
 
jacklhoward wrote:

Excepting the efi partition the user can choose the number of additional partitions from a single one for the whole installation, or more.

It depends on what the problem is. /boot holds the kernels, initramfs files, grub and the efi partition and each can be repaired by different means with robust and reliable linux tools.

"/root" is actually the home directory for the root user, but I guess you mean the root partition. In addition to the previous answer, there are command line tools in a linux installation to carry out repairs, and GUIs for some of them, and there are live distros which can be written to cd, dvd or usb that can be used to make repairs, and also specialised rescue disks which may have additional advanced tools. As for mirrors, they are usually for downloading packages, but may also hold iso images which can be downloaded and written to disks or usbs that can be used for repairs.

There is a program to manage the efi partition (efibootmgr) and the grub bootloader has means of repair and rescue that are also robust and reliable. There are also alternative boot loaders for linux.

It's not difficult to agree with your last expression: "you shouldn't worry". No, you shouldn't.

It's worth making the point that the linux operating system is not MS. It's its own "thing" with a derivation from UNIX that long predates MS and a history deeply rooted in that derivation. Thus, it has its own learning curve, its own culture, its own fascination and phenomenal power, among many other benefits and advantages, not the least of which is the freedom to construct things in an infinite number of ways to satisfy your needs and wishes on your computer.
Can you introduce some tools and commands to me for /boot and / repair? Some says on arch you can make a hook to pacman and make a tar ball of /boot, and i guess that means to make a tar ball backup using a function in the package manager? I use nobara 37 / modified fedora 37 and the default package manager is dnf. Is it possible to backup /boot and / using dnf? I tried searching for them for some time but all i get is how to repair grub bootloader.
G'day Jack, Welcome to linux.org

I can understand your concerns....having come from windows myself (around 9 years ago, approx)...I now can tell you that you can throw at least some of those concerns out the window (yeah, that was a pun!!)

Tell us which Linux you have installed....or plan to install. It is a reaasonable idea to first install Linux Mint 21.1.......but tell us what specs your pc has and we can advise further

The simplest way to repair all those things, is to take Timeshift snapshots and store them on an external drive

I take snapshots each day (automatic), and I keep just 3. Timeshift gets rid of the older ones each time it make s a new one.

So....if your /grub etc etc or similar goes south, or you happen to do something to screw up your install.....you can do one of two things
1. Access Timehsift on your pc and go back a day or more and simply hit Restore
2. If you cannot get into the opperating system becasue the screw up is thta bad....boot a a usb stick with your operating system on it....open Timehsift on there and open Timeshift there also .....locate where you have your snapshots stored, and hit Restore.

Thats about it.

Nothing to break into a sweat about.

Settle back and enjoy Linux....without all the drama
Greetings.
I have nuc x15, https://www.intel.cn/content/www/cn...nuc/laptop-kits/nuc-x15-laptop-kit-brief.html
i run nobara 37 / modified fedora 37 because I had some glitches like freezes in mint and fedora workstation 37. Since laptops often have compatibility issues with some distros due to hardware (nvidia) so I decide to choose a version that has been patched up for compatibility as i dont have the ability to troubleshoot problems and install patches.

I use btrfs snapshots but it cannot backup /boot and /boot/efi. Maybe i wil consider using rsync. Can you switch from btrfs to rsync without deleting all btrfs backups? I tried switching from btrfs backups to rsync once when i was testing things and i cannot delete btrfs backups anymore due to error during deletion. I suppose it messed up btrfs snapshots when it switches to rsync, or maybe there was something else i did wrong?

Welcome to the forums
Because Linux is built from packages and dependencies, there are many different ways for the user to repair the system, unlike the monolith of MS where you are limited as to how much you can do.
Linux is not Windows, you will incur a learning curve, how steep is up to you.
Hi, is there some sites, manuals or books to read up on to learn linux? I am still heavily relying on GUI and I want to learn simple commands and have an understanding of linux architecture. Is linuxfromscratch or archwiki a good place to start?
 
Hi, is there some sites, manuals or books to read up on to learn linux?
Unlike a few years ago when I started using Linux, there is now a lot of information out there from books like "Linux for dummies" for the outright beginner to educational text, there is also a lot online. This one is a good basic start, https://phoenixnap.com/kb/linux-commands-cheat-sheet. There is also our own forum of tutorials https://www.linux.org/forums/linux-beginner-tutorials.123/, and some good basic short tutorials on https://linux-tips.us/
 
Basically, one needs to appreciate that there is no lack of tools in linux to make it recover from problems.
Amen to that.
 
Unlike a few years ago when I started using Linux, there is now a lot of information out there from books like "Linux for dummies" for the outright beginner to educational text, there is also a lot online. This one is a good basic start, https://phoenixnap.com/kb/linux-commands-cheat-sheet. There is also our own forum of tutorials https://www.linux.org/forums/linux-beginner-tutorials.123/, and some good basic short tutorials on https://linux-tips.us/
Hi. thanks for your reply.
Could you kindly point me to commands or tools used to repair /boot and /? I found tools for repairing grub and other bootloaders but I cannot find out how to repair /boot and / without timeshift backups. I am using BTRFS backups and my /boot is in ext4 format so I cannot backup it. Also i want to be safe when my btrfs backups got messed up somehow.
Does fsck fix corrupted /boot and / partitions? But i suppose they are for fixing the file system not the file themselves?
Does redownloading all packages fix / partition?
In the worst case, should you just overwrite your linux installation with a clean one and keep the /home partition?
 
Linux is NOT Windoze, You really don't need to worry about corruption, Linux just works.

--glenn
 
Simple answer.

Run and use Timeshift

So if something does happen to just screw up mysteriously (highly unlikely without intervention from behind the keyboard)....then all you need do is Restore a Timeshift snapshot.

I keep 3 Snapshots (Daily) on an external drive.
 

Staff online

Members online


Latest posts

Top