Monday, September 5, 2016

Teambuildings, conferences and pulling your hair out over simple update

So, you've been invited to spend a weekend with your company colleagues. There is also a conference event scheduled at destination. You can learn something, meet new people, exchange ideas, have fun. Well yes, splendid, lets do this.

Early morning, still dark, driving by bus. Developers like developers, still dreaming without it's first coffee. So everyone got back to sleep. First words could be heard over a coffee on a gas station. And adventure begins...

Arrived at our destination. Smell of sea, fresh wind and warm sun were so overwhelming so decision has been made to go to beach and relax first. Couple of drinks and conversations are on fire. Couple of minutes later, first phones got into action with some texting and taking photos. Amazing how we made without them so far :)

Next step conference. While listening to presentations of various subjects I've decided to take some time and update my Tumbleweed. Of course you don't do it on work days and weekends you use for some other activities so it was a perfect time. Well at least it was looked like one... :)

Booted my openSuSE Tumbleweed, set valid repositories and with confidence started Software application and clicked 'Update and Restart' under Updates section. Fast restart, and then hang on boot.. Waited for couple of minutes. Nothing. WiFi for sure, I was thinking. Never mind, lets do this again manually with zypper.

Restart has booted it again. Started zypper update process.
$ zypper up

And here we go. God ol' zypper working just fine. 1/1227 packages. Well that will take some time. And than it showed error stating he can't write to disk. Why not? Let's try again. This time only 200 packages. Should be fast. Going nicely and again at the end same error. So you can download and install some packages but others can't? Is it a repo problem?
Oh, presentation is over. Launch time, never-mind I'll continue later..

Conference day was coming to the end. One more try and now I got error again stating can't write to disk but this time on first package. Than in occurred to me to check disk. Quick:
$ df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb6        40G   39G  50MB  100% /

So it was problem all along. Trying to delete some unused journal logs to free some space.
$ journalctl --vacuum-time=0d

$ df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb6        40G   36G  50MB  100% /

Hm, I have available space but usage is on 100%? Is my filesystem corrupted?
No, as it turns out root is on btrfs partition and it behaves differently as opposed to traditional filesystems. It has the concept of allocating space on the underlying device, but not actually using it for files.

Also root partition was filled with update snapshots. To check the problem volume use:
$ btrfs subvolume list /

To delete snapshot you do not need use:
$ btrfs subvolume delete -c path

Where path is from previous command subvolume list that says "snapshot". We are using -c flag to commit changes immediately to btrfs file system.
Finally, after reboot zypper update passes.

Last presentation is over, and this reminds me again why I don't do updates on work days :D
And now, after-party and some team strengthening time.
Until next time, happy updating ;)