Rudimentary Linux Bits: Nifty and clean updating progress report on btrfs balance.

in #linux5 years ago (edited)

Hello again! Long time no see. ;)

So... as I'm not able to use my dedicated desktop computer while we are relocated to the next-door apartment that is too tiny to set up any comfortable space for a workstation, I've been using my laptop instead.

Today I decided to upgrade the Linux on my laptop to the latest KDE Neon has to offer, I came upon a problem, and that is that my harddrive has some consistency issues with files. I decided to run the btrfs balancing tool btrfs fi balance /home.

It's a peculiar one, since it doesn't give out any output. So at first I used the dmesg -w command to see what it is doing, but found out a btrfs command for a progress report: btrfs balance status /home that gives out a static progress report like this:

root@trabant:~# btrfs balance status /home
Balance on '/home' is running
138 out of about 180 chunks balanced (178 considered),   37% left

The only problem was that I needed to repeat that command every time I wanted to see the progress, and I wanted to see it in real-time.

The solution is a simple one: a while loop. :) Like this:

while sleep 5; do (btrfs balance status /home&) ; done

And I got a page full of status reports.

I wanted to do better, so I added clear to the beginning of the line.

while sleep 5; do (clear && btrfs balance status /home&) ; done

Result:

Screenshot_20190321_150853.png
Now the progress report updates cleanly in the top of the window.

Neat, huh? :)

If I come up with other nice tips, I'll be sure to post them here. :)

See ya!

Sort:  

@gamer00,
Personally I am not a Linux user, but DOS type programming, yeah I know a bit too! Good one and wanna see more new tips from you. Very interesting thing for me!

Cheers~

Good to see a post :D

I fully agree on that. What I'm missing is @gamer00's photography posts. I'd love to see a new take of some familiar subjects but with some tips as to how to get better pics. Jaro is a very experienced photographer who knows his shit. :)

Thank you.

The truth is I've been more or less out of ideas and motivation, especially now as my main editing rig is not available.

My personal computer has Linux installed a version created by the government and was buying through the company of the very economical state for that time 10 years ago, I can not update it because I would lose many things, a friend told me.

10 year old Linux installation and no updates? I would not feel very secure with that.

A thing you could do is take a backup copy of the /home directory and install a brand new version of your preferred distro, making the /home directory live on a whole separate partition, or harddrive, then copy the things you need back from the back-ups.

Friend Jaro. I would like only if you can visit my publication where I expose the current situation of university professors, I would love to know your opinion.
The Ministry of Higher Education of Venezuela suspends payroll resources from public universities.

Hi gamer good to see you around. I seem to keep missing your posts. Hopefully the move is temporary and you are back in your own space really soon.

Hey... I've been a bit slow making posts lately, being forced to use mobile connection and a laptop. So you haven't missed much. ;) Anyway, we'll be moving back into our own apartment on April 12th. It should be fully renovated by then. We sincerely hope the move is not as taxing as the previous one.

I believe it won't be. Why? Because, hopefully, you've been getting rid of a good deal of useless stuff.

thank you for the information, this is very helpful for me

Hi, @gamer00!

You just got a 7.95% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Coin Marketplace

STEEM 0.26
TRX 0.11
JST 0.033
BTC 64507.66
ETH 3080.07
USDT 1.00
SBD 3.85