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.

How To: Remove AppArmor From Ubuntu

In today’s article, we’re going to learn how to remove AppArmor from Ubuntu. This will work for other distros, like Debian. It’s actually not a very difficult task to remove AppArmor from Ubuntu, but it’s not something you necessarily want to do. Just because you can, doesn’t mean you should…

As many of you know, I write many of these articles based on the notes I’ve taken over the years. I’m a little reluctant to write this one, because removing AppArmor is probably not the best of choices.

AppArmor is similar to the various jails and application isolation techniques. It’s a security tool that restricts applications to a constrained set of resources. If the application is then compromised, it only has access to that set of resources and not to the whole system.

In other words, unless you know what you’re doing, you almost certainly don’t want to remove AppArmor from Ubuntu. In fact, if you don’t know what you’re doing then doing this is almost certainly a ‘not-bright’ choice.

If you’re going to remove AppArmor, you should consider replacing it with something else. SELinux is an option that’s similar, though I suppose you could use something like Firejail and be prepared to craft your own application profiles.

Again, removing AppArmor from Ubuntu (or whatever distro you’re using that has it) is probably not a good idea. I include the article because the information is already out there and because some folks may just decide to operate their system without such protections. This is Linux, you have the freedom to make bad choices. This isn’t even the first time I’ve shown you how to make bad choices.

Remove AppArmor From Ubuntu:

Like oh so many of these articles, you’re gonna need an open terminal. Just press CTRL + ALT + T and your default terminal should open. (I say that a whole lot on this site.)

We should first check to ensure AppArmor exists and is running. To do so, enter the following command:

What you’re looking for is several lines into the output. You’re looking for ‘apparmor module is loaded‘. If you see that, AppArmor both exists and is running. So, the next step in removing AppArmor is to stop the service. You do that with:

In case AppArmor is somehow installed again, we’ll make sure that it won’t start at boot by disabling the service entirely. That seems like a good idea.

Finally, we nuke AppArmor from existence with a purge command:

And that should do it. You probably want to reboot, just to make sure there are no tendrils sticking around – but stopping the service first should mean you don’t need to. Either way, you have now removed AppArmor from your system – assuming you followed the directions.

Closure:

Again, and I can’t stress this enough, don’t do this unless you know what you’re doing and unless you have something to replace AppArmor with. It’s really a bad idea and you’ll gain very little. I wouldn’t even do this with a system air-gapped from the network, unless I had a very good reason to do so.

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.

Turn Your Ubuntu Into A Wireless Hotspot

Have you ever wanted to use your Linux computer as a wireless hotspot? It’s actually pretty easy. Today’s article will get you started and it really isn’t all that difficult. We will actually be cribbing a bit of this article from the software’s homepage, but while some more, rather important, information added.

For many years, I used my own router that I had configured on my own hardware. It was built on Linux. The preceding version actually ran on BSD, but that’s not important for a site called Linux-Tips. Today, you can get a NUC or Pi for dirt cheap and so making a new router is back on my list of things to do. In other words, it’s a fun project that won’t take a lot of money to get into.

All of the varied software and hardware components are already there to make your own router, but I want to enable wireless connectivity. a wireless hotspot, and that’s what we’re going to look at today. The tool we’re going to use is called ‘linux-wifi-hotspot‘ That’s is a great tool, complete with GUI if wanted, written by lakinduakash. It has only been around for a few years, but it’s spoken of very highly – and it just works and works well.

At least it worked the last time I used it. This article is from the old site and I’m just moving it to this site. I actually haven’t bothered much with my own router for the past year or so. So, this information is a bit dated.

Turn Your Ubuntu Into A Wireless Hotspot:

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 software is easy enough to install. If you’re using Debian/Ubuntu, just add the PPA and install the software. To add the PPA, you just run:

On a modern Ubuntu, you shouldn’t need to do this, but you might want to go ahead and run a quick update with:

Then you can install the software, starting to get your system into a workable wireless hotspot. To do that, it’s just:

If you want, you can visit the link above (in the preamble), click on releases, and download the .deb file for the current release and just install it with gdebi. In this case, I’d suggest installing with the PPA – just to make sure

Then, you can go ahead and start it. You can also go ahead and make it start at boot, which would be prudent if you intended to use this to make your own router. It’s really self-explanatory and without specific questions for using it, I’m just going to refer you to the man page and the information at the project page.

Caveats:

But, before you can even do all of this, you need to know that your wireless adapter actually supports doing this. To find out, you need to know if your wireless adapter supports “AP” mode. AP obviously meaning ‘Access Point’.

To check this, you need to run the following command:

The project page is noticeably silent with this, but it’s a necessary step. See, you need to know if your hardware actually supports it before you even bother trying. Come to think of it, I probably should have put this closer to the top of the page! Ah well…

Anyhow, the output should contain one or both of the following lines:

Device supports AP scan.

And/Or:

Driver supports full state transitions for AP/GO clients.

So long as you see one or both of those, you should be all set to proceed. If you don’t see either of them, there’s no software solution and you’ll need to get hardware that supports AP mode. In many cases, that’ll mean doing a bunch of research and may even mean contacting the vendor or OEM.

Nobody appears to have compiled a list of hardware that supports AP mode and I don’t think I’ve ever bought wireless adapters that explicitly stated they do on the box. As near as I can tell, more modern adapters support it just fine, so you’ll probably be alright. Online specs are more thorough than what’s printed on the outside of the box, so maybe searching is okay.

Closure:

Alright, there’s your article for the day. I have no idea if you want to make a wireless hotspot for your Linux box, but now you know how. It’s pretty self-explanatory, and you shouldn’t have any questions. If you do, you know where to find me – or to find others who can help you – at Linux.org.

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.

Change Ownership Of Files And Folders

Today, we’ll be covering how to change ownership of files and folders. This is a pretty basic task and one every Linux user should know. This needn’t be terribly complicated, so this article will explain all you really need to know about changing ownership of files and folders.

When dealing with file management, permissions are important. It’s a security matter and a usability matter. You can assign various file and folder permissions, such as read and write permissions, a subject for a different article. However, files and folders all should have owners – owners who can do anything they want with the file or folder.

Curiously, your account should not always be the owner. While maybe not all that intuitive, you shouldn’t have ownership of all the files. This is why you have to use elevated permissions to perform certain tasks. This is to keep things segmented and secure.

Remember, Linux is designed to be a multi-user operating system. That’s not just human users, but different processes and applications may also be associated with users. For example, look at all the users on your system by running the following command in your terminal emulator:

You can also see all the groups on your system with this command:

Obviously, if a user is a member of a group they share permissions with that group. Files also only have one owner and one associated group, of course. So, if you want two people to have control over a file, one way to do that would be to make sure they’re both members of the same group. There’s all sorts of creative things you can do with permissions. This article will be covering just one aspect, it’ll be about how you can …

Change Ownership Of Files And Folders:

Like oh so many of these articles, this one requires an open terminal. You can do so using only your keyboard – just press CTRL + ALT + T and your default terminal should open.

Go right ahead and stay in your home directory. You can check the various files and their permissions with the following:

The output of that command will show you the user and group, with the two being listed in that order as in the image below:

ll listing user and groups
See? I even gave you handy arrows. The order is owner:group, to repeat myself.

To change the owner, the format is:

To change the group, the format is:

If you want to recursively take ownership, you need the -R flag. For that, you’d want something that looks a bit like this:

You can actually just use chown to change both the owner and group at the same time. You’ll most often do this with your own user and group, so I’ll show the command that way:

As you can guess, the -R flag will work there and an asterisk will cover all the files and folders within that directory. Obviously, this applies to folders and not to files.

Closure:

There you have it. You have yet another article and this one has hopefully taught you how to change ownership of files and folders. It may not be one of the most interesting articles, but it’s a skill you’ll eventually want to have and another tool for your Linux toolbox. 

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.

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.