One Way To See CPU Information

Today, we’re going to explore one way to see CPU information. On the original site, I had a couple of articles about this sort of stuff but we didn’t cover this method. It’s a short and sweet process, though I’ll show you a couple of ways to process the output.

The date that this will be published is July 4th. That’s a holiday in the United States. Not only do I live here, the vast majority of my readers live here (according to the stats I have). So, this will be a nice and easy article. For those of you who reside elsewhere, you’re welcome. You won’t have to work too hard today to understand what’s going on.

Anyhow, we’re not going to use any special tools. We’re not going to use any applications that you don’t already have installed. While we likely could, there really isn’t any need to. This being Linux, the information we’re after is already in a file. All we need to do is read that file.

So, let’s get to it…

How To See CPU Information:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s go ahead and read the file we need if we want to see the CPU information:

That’ll output a ton of text. You can read it as it is, or you can actually get it in a more readable form using the ‘less’ command. To do that, you just change out the ‘cat’ command, like so:

Now, just use the arrows on your keyboard to scroll down (or back up) through the text. When you want to close the output and return to the terminal, just press Q and it will close.

Closure:

That’s it. That’s all there is to this article that tells you how to see CPU information. It’s not a very tough article, and it’s quick. So, I met those goals! Yay me! Enjoy your holiday, even if the holiday is just a nice quick article that doesn’t require much thinking. Me? I’ll drink some beer and char some dead animal flesh.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Change The UUID For Your Disk Partitions

Today, in an article of little use to anyone, we’re going to learn how to change the UUID for your disk partitions. It’s not something you’ll want to do often, or even at all. There really isn’t much motivation to do so. In fact, this might just be one of the more useless articles (that isn’t a meta article) on the entire site! (I should mark it as ‘important’ for my own amusement.)

Why then is this an article? Well, it’s kinda neat, a little informative, and it was in my notes! As to why it is in my notes, I think I documented the process for a person on one of the various forums. I have no idea why they wanted to do this, but it is something you can do. I did check to ensure that it should still work.

A ‘UUID’ is a Universally Unique Identification. Your partitions have one. It’s a 128-bit alpha-numeric identification used internally seldom by you the user. At 128 bits, odds are very good that your ID is truly unique – but there’s no actual verification or anything. Your system generates ’em more or less pseudo-randomly and that’s the end of it.

If you want, run this command in your terminal (open a terminal, per my usual remarks):

That should show you your partitions and their UUID. It’ll also spit out a bunch of information that will help you identify it – such as the label field. That’s good, as you’ll want to pick one that you just don’t like and we’ll work on changing that one UUID to something new.

Change The UUID For Your Disk Partitions:

Up above, you should have opened a terminal and loaded up some information about your various partitions. Lemme see if I can get you a good example output – I’ll plug in an external drive with a bunch of partitions:

So, there… You can see some data and see the UUID. Should you want to actually change the UUID, now’s the time to pick it.

Now, we’re going to generate a new UUID. Yup, you can do that. Try one of the following two commands – though both should probably do the trick:

Or:

One, or both, of those will surely work on any modern Linux distro – unless it’s stripped down. If you don’t like the first one, you can keep generating them until you’re happy with the results. (You’re very, very unlikely to have a duplicate – as I’ll explain later, in the closure section.)

Now that you have your new UUID in hand, you’ll need to unmount the partition you’re going to change. If you don’t know how to do that, it’s just:

For example, that might be /dev/sdb2 or /dev/sdb4 that you’ll use to unmount the partition.

With that unmounted, let’s go ahead and finally change the UUID! You do that with:

Be sure to change the obvious for the obvious. Copy and paste from your terminal, perhaps even using two terminals, to ensure you get all the information correct.

When you’re done, the effects should be immediate. though you may need to mount the partition first. Run the following command to check:

If you’re satisfied with the results, great! If you need to first mount the partition, you can try this:

All should be wrapped up nicely in a bow, with your UUID happily changed to something else. Again, I don’t really have any good reasons for doing this – but you can do so if you want. I did mention that this was pretty useless… You were warned!

Closure:

Well, there you have it – another article? Hmm… Let’s really wrap it up. You know how it says it’s a “Universally Unique Identification”? Let’s look into that with some math.

Well, it’s 128 bits. That’s 2128 (less if a signed integer) which is equal to ~3.4 x 1038. I decided to look that up and find someone who did the work for me. This is that number represented in English:

three hundred forty undecillion, two hundred eighty-two decillion, three hundred sixty-six nonillion, nine hundred twenty octillion, nine hundred thirty-eight septillion, four hundred sixty-three sextillion, four hundred sixty-three quintillion, three hundred seventy-four quadrillion, six hundred seven trillion, four hundred thirty-one billion, seven hundred sixty-eight million, two hundred eleven thousand, four hundred fifty-five

Source: Quora

So, is the UUID you have truly unique? If you change the UUID, is it truly unique among all others? Perhaps, but you have better odds of winning the lottery multiple times in a row than you have of finding a matching UUID anywhere on the planet. 128 bits is a lot, an amount your human brain isn’t able to understand, which is also kinda why we will likely be a while longer before we move there from 64 bit. 64 bit is still pretty darned huge and there’s no real need for 128 bits at this time.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Check Your (Write) Disk Speed In The Terminal

Today we’re going to discuss one way for you to check your write disk speed in the terminal. That is, we’re going to learn how long it takes you to write data to your disk drives. It’s a very simple set of commands and easy enough for anyone to try. There are other methods, this is just one of them.

After all, I recently did an article that let you check your (read) disk speed in the terminal. I might as well do an article that lets you check your write disk speed in the terminal. The former article was about how fast you can read data from your disk drives. The current article is about how fast you can write data to your disk drives.

There’s not really all that much real world work that this is going to benefit. You’re able to read and write data as fast as you’re able to read and write data. If you want to change that, invest in different hardware. Knowing the read and write rates really doesn’t do you much good – it’s just an interesting bit of information and maybe a reason for you to brag to your friends.

Today we’ll be using the ‘dd’ command. Be sure to be careful with this command because once you set it loose it does exactly what you told it to do. It can and will cause you to reach for your backups… If you don’t know, ‘dd’ defines itself as a tool to convert and copy files. You should read the man page sometime. It’s a rather robust, and potentially complicated, application.

Anyhow…

Check Your (Write) Disk Speed In The Terminal:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

The first thing we’re going to do is make a new directory and move to it.

Now, let’s start testing. I’m going to assume you have at least 10 GB worth of space (we’ll be using ~5.5 GB, or 5 GiB). If you do not have enough space, don’t run this command until you do have that much free disk space. The command to run the test is:

Here’s a test result on a slower, in use SSD, about what I expect most users to have:

It will show you the progress, as we’ve enabled that in the dd command. It won’t take all that long for the test to complete. Unless your drive was otherwise heavily occupied, there’s little to gain from running the test multiple times.

Anyhow,  how about we cleanup after ourselves? As the file was made with ‘sudo’ so too shall it be removed with ‘sudo’. It will probably even ask you for confirmation.

And delete the directory:

That should have cleaned up our mess, all nice and fancy like. There’s no real reason to keep a 5.4 GB test file hanging around and you already have the test results.

Closure:

There you have it! You now have another article and this one will show you how to check your write disk speeds for your drives. If you want to test other drives, just write the file to those drives by navigating there first in the terminal. ‘Snot all that difficult.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Check Disk Speed In The Terminal

In today’s article, we’re going to learn how to check the disk speed in the terminal. When I say ‘disk’ I also mean drives, like SSDs. I could use ‘storage drive’, or perhaps just ‘drive’, but the word ‘disk’ is what I’m going with. So, if you have any questions about other devices – the answer is that it should work just fine if you want to speed test them. 

I should point out that we’ll only be checking disk read speeds. We won’t do any write tests today. We’re just going to see how fast we can read data from the disks we have installed.

There’s a number of ways to check the speed of your disks. You can do so with tools like Gnome Disks or HardInfo, for example. If you’d rather, you can do a full-blown benchmark of your Linux system with GeekBench. This article will explain how to check disk speed in the terminal, because why not? The GUI tools may provide more data, but you don’t always need more data.

The tool we’ll be using for this ‘hdparm’ and it’s available for any major distro out there. In fact, it may be installed by default. So, if you want to get a head start, check to see if you have it installed. If not, go ahead and install it – just like you’d install any other software.

Anyhow, the tool describes itself as:

hdparm – get/set hard disk parameters

Which sums it up nicely. If you check the man page with man hdparm, you’ll see it’s actually pretty complicated. Fortunately, we’ll just be using it to check the disk speed. It can be used to do all sorts of stuff, as you can see from the man page. Perhaps we’ll cover some of that in a future article?

Anyhow, there’s not a whole lot that goes into this. So, let’s jump right in.

Check The Disk Speed In The Terminal:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With the terminal open, you should first identify the disk you’re looking to test. You can list all your attached drives with:

Once you identify the drive you’re looking to check, you’ll almost certainly want to add a /dev/ in front of it – because that’s really where it’s mounted. So, if the disk you want to check is sda1, you’d use /dev/sda1. Even if it says something like /media/<user>/<drive_name>, you’ll still be using /dev/<disk>.

Now, to check the disk speed, you’ll use the following:

That gives you a good example result, including things like buffer and cache. If you want, you can actually check the direct disk speed as well. That just requires the --direct flag. It looks like this:

That’ll give you some results as though you were reading directly from the disk without a buffer involved. It’s an option to check, should you want to. But, you can get a good look at what your disk reads are going to be.

Closure:

That’s actually all there is to it. ‘Snot very difficult. Sure, hdparm is this big complicated application – but you can still use it to check the disk speed in the terminal. You don’t actually have to master all the options of these complicated applications in order to use them. You can still use them, learning more and more options as you use their features as needed.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Check A Disk For Errors

In today’s article, we’re going to learn how to check a disk for errors. We’ll be using a multi-pronged process to thoroughly check a disk for errors in the Linux terminal. By itself, none of these are particularly complicated. As such, I expect this to be a relatively easy article to follow.

If you’ve been seeing errors when transferring data to a disk, it’s probably a good sign that it’s time to check that disk for errors. You may also want to check a disk for errors if you’ve not used it before – like if it is used or if you have just purchased it.

To perform these tests, the disk must not be mounted! If need be, you’ll have to do these tests from a live environment. That’s easy enough. Remember how you installed Linux? Well, that same installation media is (usually) the same media you’ll need to enter a live environment. You will, of course, need to boot to the media when you start your system – be it USB, or CD, or DVD. It’s much the same as though you were going to install Linux – except you don’t opt to do the installation – you just work in the live environment.

Anyhow, we’ll be using a few tools for this. All of these tools will almost certainly be available by default. If they’re not, ummm… Well, if they’re not, pick a different distro’s live environment to use, or install them yourself! These tools are all on the installation media for distros in the Ubuntu family, for example. So, yeah, find a distro where they are available – which should be pretty much all of them.

Check A Disk For Errors:

So, you’re booted to a live instance of your favorite distro (or the disk you’re going to check is unmounted) and you’re ready to start testing. Well, you need an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Once you have your terminal open, use lsblk to identify the disk you wish to check for errors. For the purposes of this exercise, we’re going to assume the disk you’re checking for errors is known as ‘sda’. Be sure to change that to suit your particular needs.

First, let’s check for S.M.A.R.T. errors (which we’ve previously covered in-depth). You can do so with this command:

Next, let’s check for bad blocks. Bad blocks are physical points on your device that no longer work properly. Some bad blocks isn’t, necessarily, indicative of immediate disk failure. Some bad blocks may be normal. Still, let’s check it.

If you’re really into this, you’ll want to check it for bad blocks – and then check it again soon after. That will let you know if the number of bad blocks is increasing. If the number is rapidly increasing, disk failure will likely soon follow. Otherwise, you’re probably okay for the time being.

Finally, let’s check for file-system consistency. This is typically done with the ‘fsck’ command, a command you should have some understanding of. There are many ways to run the command, but you can just use the following command to see what’s going on:

Now, you’ve run three tests. Between them all, you should have a pretty good understanding of your disk’s health and you’ll know how to check a disk for errors. Again, you’ll want to check a disk for errors when the situation dictates – especially if you’re getting disk errors while in the operating system. 

When you get disk errors, it’s time to consider retiring the drive. Depending on the severity of the errors, you might wish to stop using the drive immediately, creating an image of the drive, and retiring the drive from your system. Disk failures happen and recovering data from a failed drive can be a major hassle. So, use these warnings as a reason to consider replacing your drives if drive failure is in the cards.

Closure:

And there you have it! You now know how to check a disk for errors! It’s a handy skill to have. After all, disks fail. Knowing when they are going to fail is a good thing. Being prepared for disk failure is a bonus and a good idea! It’s also worth checking new disks. I’ve tested new disks and had unsatisfactory results that meant I returned the disk to the retailer, so it’s a concern and worth taking the time to test.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.