Repair Your Linux Filesystem With a Live USB or DVD

It’s possible for your filesystem to become so corrupted that you can’t repair it easily. In that case, you can repair your Linux filesystem with a live USB or DVD.

Your filesystem may become corrupted for any number of reasons. One of the most common reasons is an improper shutdown, where your filesystem doesn’t have time to properly write everything to disk because it wasn’t shut down properly. You might see that sort of thing when you suffer from a power outage. 

There are any number of reasons why your filesystem will have become corrupted and, in most instances, your system will automatically repair your Linux filesystem when you boot your computer.

It’s also possible that a simple boot won’t repair your Linux filesystem. In that case, your OS probably has some sort of recovery mode and you can use that mode to repair your filesystem. 

Once in a while, your filesystem may have become so corrupted that you can’t fix it in recovery mode because you can’t get to recovery mode to fix it. Not to worry. This is something you can easily do with a live USB or DVD.

This article assumes you already have a USB or DVD with an OS that runs live. I’ll use Ubuntu as the example OS, as it’s really common. Adjust for your distro and you’ll be okay.

Here’s a link if you need to know how to access your temporary boot menu

NOTE: If you’re using Btrfs, you shouldn’t need to run fsck, it should heal itself. If not, here are Btrfs-specific commands that you should learn.

Repair Your Linux Filesystem:

The first thing you’re going to do is boot to the USB or DVD. You’ll need to be patient as the live instance loads into RAM. Once the OS has loaded to a GUI, you’ll want to select “Try Ubuntu”. (Remember to adjust that for your own distro, should you not be using Ubuntu.)

Again, this will take a minute – especially on older hardware. Eventually, the GUI will load and you’ll have a functional live instance running. If you needed to use nomodeset, acpi=off, or anything similar, you’ll probably also need to use those things to get the live instance of Linux running.

The tool we’re going to use is known as ‘fsck‘, which is a tool in and of itself and a front end for other tools. fsck interacts with more specific tools for your specific filesystem, but that’s not important right now. 

If you’re curious, fsck stands for ‘file system consistency check‘ and the man page helpfully describes it as:

fsck – check and repair a Linux filesystem

Now that you have a functional live desktop, it’s time to repair your Linux filesystem. The first step is, as is often the case, opening up your terminal. You can use your keyboard to do this, just press CTRL + ALT + T and a terminal should pop right up.

At this point, you’ll want to identify the correct disk. To do that, you run:

You’ll want to identify the disk where you installed Linux. That’s the disk that has the corrupted filesystem that is preventing you from booting. It’s often something like ‘/dev/sda1’ or maybe even ‘/dev/nvme0n1p1’.

Once you have the disk identified, it’s time to repair your Linux filesystem. Enter this:

NOTE: Change the /dev/sda* to match the data from the fdisk command you ran earlier.

That ‘fsck’ command should find and fix any errors automatically. If you really know what you’re doing, you can run ‘fsck’ manually and maybe do a better job than the automatic method. Then again, if you know that much then I’d suspect you don’t actually need this article.

This shouldn’t take very long to run, unless there were a whole lot of errors. Next, all you need to do is reboot and you should find that you were able to successfully repair your Linux filesystem. To do that from the terminal, you can just type:

When prompted, remove the disk from the drive and press the ENTER button.

Closure:

There you have it, another way to run fsck and to repair your Linux filesystem when it is broken. This method works even when the recovery mode will have worked.

Thanks for reading! If you want to help, you can buy some cheap hosting, unblock ads, donate, sign up for the newsletter (below), write an article, leave a comment, register to help, or just vote for the article below and leave a comment!

When Did I Install Linux? (Expanded Edition!)

In the other site’s version of this article, I only had information for Ubuntu. This time, I’ll expand it to cover the major distros. It seems like a good a time as any to fix this. (I’d link to the original article, but that page will now direct here.)

I’m not sure why you’d want to know when you installed Linux. I suspect that reason mostly curiosity that people ask, “When did I install Linux?” The question pops up with some regularity.

It’s really not vital information, and as such, it’s not a generic command that you can run to retrieve the information. There isn’t a whole lot I can do with the answer, except maybe jar a few memories loose. “Oh, yeah… That’s when I installed, so I must have bought the computer around that time!”

Really, this isn’t all that important. Still, it’s a fairly often asked question. If you have found a real use for this information, please feel free to leave a comment and to let us know why you need this information.

Let’s get on with it, shall we!

When Did I Install Linux?

Like many exercises, this one starts with opening up your default terminal. You can use your keyboard, by just pressing CTRL + ALT + TOnce you have the terminal open, you can use the following commands to see when you installed Linux.

Ubuntu/Debian/Derivatives:

If that doesn’t work, you can also use:

NOTE: Change /sda1 to the disk where you installed Linux.

Fedora/RedHat/Derivatives:

Arch/Manjaro/Derivatives:

And, there you have it. You now know how to check to see when you installed Linux. If you use some obscure distro (or have other ways to get this information) please feel free to leave a comment.

This article was revamped due to a comment from Wiz at Linux.org. They mentioned that they’d used the previous article and that they wanted the information for other distros. So, that feedback does work – even if it may take months to happen. Seriously, leave feedback and I’ll do what I can.

Finally, and as always, thanks for reading. You may have not noticed, but the site is now running ads from Google. It’d be great if you whitelisted this domain, but it’s okay if you don’t. Don’t forget the newsletter, that you can donate, contribute an article, and that you can share this article with your friends. 

Graphically Examine Hardware Info With HardInfo

Sometimes old tools are the best, or at least adequate. In this case, we’re talking about HardInfo – a tool that hasn’t been updated in about 7 years, but still does a great job.

This is Linux. There are a ton of great applications to detect and list your hardware. Most of them are CLI. HardInfo is one application that lets you graphically detect and show your computer’s hardware. It’s rather out of date, but that doesn’t seem to hinder it any.

Welcome to HardInfo!

HardInfo used to be installed by default with Lubuntu. As near as I can tell, the last time it was included by default was in Bionic (18.04) and it has now been left aside as an old relic and with nothing replacing it.

You may remember it, but you may remember it with a different name. In your menu, it showed up as “System Profiler and Benchmark” and may well have been overlooked by many. Not me, I use it every time I get a new computer and want to check out the performance.

Allow me to explain…

See, it doesn’t just list the hardware that it finds, it also (as the menu entry implies) lets you run a bunch of pretty neat benchmarks. If your computer is fairly modern, then it will likely exceed all the default benchmarks listed in the program. It has been a long time since it has been updated, after all. Still, it’s great to see what your computer is capable of.

The great thing about it is that it’s simple and self-explanatory. I don’t really have to tell you how to use it. You can figure it out easily enough on your own. I only need to make you aware of it!

Installing it is easy enough. If you’re using a Debian/Ubuntu distro, or a derivative, you can install it right from your default repositories. This is true for most other distros, I suspect. I confess, I made absolutely no effort to look this up! Still, to install it in Ubuntu, you’d  start by opening your terminal. Use your keyboard to open your default terminal by pressing CTRL + ALT + T.

Then, just run the following command:

Then, just open it from your menu – somewhere under system tools and by the name mentioned above. It should look a little like this:

hardinfo in action
See? This is nice and easy. Anyone can figure it out!

Scroll down and you can run a bunch of different benchmarks! Once again, this is entirely self-explanatory. If you use a more modern device, you’ll shatter the records listed for other computers – which is a nice boost of endorphins – like so!

HardInfo doing a quick benchmark.
See? Even my older computers slaughter the competition!

And, there you have it. HardInfo is still a pretty wonderful tool. I like it for all the benchmarks it offers. They’re a great way to get a rough estimate of performance. It’d be great if that section was updated with more modern devices, but I am not a very good programmer. Maybe one of you will download the source, fork it, update it, and maintain it? It’d be a great asset to the community!

Bonus: CPU-X

If you want something more modern, that gives the same information but has fewer benchmark choices, then you can always take a look at CPU-X. CPU-X is from the folks at X0rg (not to be confused with X.org) and has been updated much more recently. It’s a great GUI way to check your hardware. Once again, you can install it from your default repositories. Once again, that looks like this for Debian/Ubuntu/apt using distros:

It too is fairly self-explanatory. If you need help using it, perhaps Linux is not the best choice for you! Ha! I kid… If you need help using it, just go ahead and ask. I’ll do my best to get you sorted.

If you want a more modern version, you can download it. It’s a little complex, but not very. First stop, visit the CPU-X GitHub page and click on the latest release – on the right.

Once you’re there, you can download the AppImage, which is probably easiest. If you want, you can grab the package for your OS, it’ll be in tar.gz format. Open it with your archive manager.

Inside that archive, you’ll find some .deb files. You know what to do with those. First, extract the CPU-X .deb and then extract the ‘libcpuid’ file – not the one with dev in the title.

Once you have them both extracted, you need to install the appropriate library file before you install the CPU-X .deb. The library is a required dependency and the one in the default repositories is not new enough to work with the newer CPU-X.

You’ll also possibly get a warning that says you have an older version available in the repositories and that you should install that version instead of the newest version. You can skip that warning and install the newer version just fine. It shouldn’t break anything!

When you start CPU-X, it will ask you to run as root. To get all the information, you will need to run it as root. So, go ahead and either select “Run as Root” in the menu or go ahead and choose to run it as root when prompted. It will, of course, ask you for your password. If you’ve done it correctly, it will look a little like this:

cpu-x up and running
See? It works and it too is easy to understand. Sweet!

If you use the right arrow near the top, you’ll see there are benchmarks available. They’re two simple benchmarks where your computer generates prime numbers. You can select the duration and the number of threads. Other than that, it’s not really all that complicated or informative. It’s there if you want to.

Anyhow, there you have it. You have a couple of ways to graphically check your hardware information. If you don’t want to use something like inxi, this is the next best thing. Thanks for reading and be sure to sign up for the newsletter. 

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.