How to add a device on btrfs system

If you need to insert new drives to your btrfs-run Linux details center servers, Jack Wallen is listed here to display you how.

Image: Jack Wallen

You have Linux serving up many solutions from in just your data center. Probably one of these servers is used for a database and you’re locating the connected drives are filling up with space. When that comes about, it really is time to increase added drives to accommodate the continuously developing collection of information. If that server works by using the btrfs file system, what do you do?

You plug that machine in, open up a terminal window, and add the device.

It is really that simple. How do you do it? Let me present you.

SEE: Kubernetes security manual (cost-free PDF) (TechRepublic)

What you can require

  • A Linux process that takes advantage of the btrfs file process

  • A new travel formatted to the btrfs file program

  • A user with sudo privileges

How to add the unit

The 1st thing you will have to do is add the generate–possibly plug it into a USB port or attach it as an internal drive. Either way, would not matter. As soon as you’ve attached the generate, you are going to will need to locate out the title the generate has been assigned. You can usually do this by issuing the command:

dmesg

You should really see reference to the newly added push near the base of the output. The identify will be in the form of /dev/sdk1

Future, we want to create a mount place for the new push. Let us generate a listing with the command:

sudo mkdir /facts

You can title that directory whatsoever you like. If that listing wants precise privileges, these types of as for a person or a group, look at operating a instructions like:

sudo chown -R User.Group /knowledge
this kind of chown -R ug+rw /knowledge

Exactly where Consumer is a specific username and Group is a certain user. Make confident you alter all those accordingly, if they are even necessary.

Now it really is time to add the travel. The command for this will be:

sudo btrfs device include -f /dev/sdk1 /information

Don’t forget, the web hosting file procedure that properties /knowledge must be of the btrfs file method form. If you get an mistake that the generate is currently mounted, you may well have to unmount it with a command like:

sudo umount /dev/sdk1

After the machine is extra, you can validate by running the command:

sudo btrfs filesystem exhibit

You must see the new device outlined in the output (Determine A).

Determine A

btrfsadd.jpg

I’ve just added /dev/sdk1 to the program and mounted to the /info listing on HALEY.

Right after you’ve got added the drive, it truly is a good time to do a rebalance of the recently added drive. For that, you would difficulty the command:

sudo btrfs filesystem equilibrium /information

You’d want to make certain that /facts is the full route to the mount place of the newly-extra btrfs drive. When the push is well balanced, you are completely ready to use it.

If you at any time will need to delete that unit, challenge a command like:

sudo btrfs device delete /dev/sdk1 /data

Which is all there is to adding a new system to a btrfs procedure in your facts heart. Love that expanded storage room.

Subscribe to TechRepublic’s How To Make Tech Operate on YouTube for all the hottest tech assistance for business enterprise pros from Jack Wallen.

Also see

Fibo Quantum