The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘openSuSE’ Category

A bash script to btrfs snapshot details like disk sizes (requires btrfs quota to be enabled)

Posted by jpluimers on 2016/09/06

One thing I’ve not figured out yet is this: How does enabling btrfs quotas impact the system? – Unix & Linux Stack Exchange

My gut feeling says it’s not much. But if someone knows: please chime in.

Anyway: btrfs quota support helps you to see how big snapshots (and other subvolumes) are.

Enabling and disabling is easy (the slash is the path from where to enable quota):

btrfs quota enable /

btrfs quota disable /

The bad thing is that there is no command that gives just the quota status. You have to revert to btrfs qgroup show /

This will show you quota groups when quota are enabled:

qgroupid         rfer         excl 
--------         ----         ---- 
0/5          16.00KiB     16.00KiB 

or errors when quota are disabled either of these two errors:

# btrfs qgroup show /
ERROR: can't perform the search - No such file or directory
ERROR: can't list qgroups: No such file or directory

# btrfs qgroup show /
ERROR: can't list qgroups: quotas not enabled

You might also want to check the syslogs as there was a [PATCH 1/2] btrfs: syslog when quota is enabled.

The btrfs qgroup output is the base for agronick/btrfs-size: A script that will print out a list of BTRFS subvolumes along with their size in megabytes and their name.

It actually shows it in human readable form (kilo/mega/giga/… bytes) and is documented at Get the size of your BTRFS Snapshots | PoisonPacket. It gives me a nice overview that corresponds to the snapper list output (see below).

The script has two drawbacks:

./btrfs-size/btrfs-size.sh: line 55: can't + 0: syntax error: invalid arithmetic operator (error token is "'t + 0")

  • it can take a while for btrfs quota enable / to actually deliver the quota for all the qgroupid values snapper uses. Until that time, the columns ID/Total/Exclusive Data are empty.
  • it won’t warn you if the quota data is out of data; to check that, run the below script

# btrfs qgroup show / > /dev/null
WARNING: Qgroup data inconsistent, rescan recommended

In that case, run btrfs quota rescan / and wait for it to complete by running this command until the warning is gone:

# btrfs qgroup show / > /dev/null
WARNING: Rescan is running, qgroup data may be incorrect

If the warning reverts to WARNING: Qgroup data inconsistent, rescan recommended then you might see the effects from this bug and should not worry about it: Bug 933428 – btrfs qgroup – allways shows WARNING: Qgroup data inconsistent.

For more btrfs quota background information, see: UseCases – btrfs Wiki.

–jeroen

Read the rest of this entry »

Posted in *nix, *nix-tools, bash, Development, Linux, openSuSE, Power User, Scripting, Software Development, SuSE Linux, Tumbleweed | 1 Comment »

OpenSuSE Tumbleweed `zypper dist-upgrade`: `mt-st` versus `mt_st`

Posted by jpluimers on 2016/08/08

TL;DR: I’m not the only one being partially word-blind.

I had the below while performing a zypper distribution upgrade on "openSUSE Tumbleweed (20160726) (x86_64)".

revue:/etc # zypper dist-upgrade
...
Detected 2 file conflicts:

File /usr/bin/mt
  from install of
     mt-st-1.3-1.1.x86_64 (Main Repository (OSS))
  conflicts with file from package
     mt_st-1.3-1.2.x86_64 (@System)

File /usr/sbin/stinit
  from install of
     mt-st-1.3-1.1.x86_64 (Main Repository (OSS))
  conflicts with file from package
     mt_st-1.3-1.2.x86_64 (@System)

File conflicts happen when two packages attempt to install files with the same name but different contents. If you continue, conflicting files will be replaced losing the previous content.
Continue? [yes/no] (no): no

Problem occured during or after installation or removal of packages:
Installation aborted by user

Please see the above error message for a hint.

Did you see the cause of the error in the above message?

Neither did I.

So I went to the #opensuse-factory IRC channel on freenode with this information:

revue:/etc # zypper repos --details 
# | Alias                               | Name                       | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                                                    | Service
--+-------------------------------------+----------------------------+---------+-----------+---------+----------+--------+----------------------------------------------------------------------------------------+--------
1 | download.opensuse.org-non-oss       | Main Repository (NON-OSS)  | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/tumbleweed/repo/non-oss/                                  |        
2 | download.opensuse.org-oss           | Main Repository (OSS)      | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/tumbleweed/repo/oss/                                      |        
3 | download.opensuse.org-tumbleweed    | Main Update Repository     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/tumbleweed/                                        |        
4 | http-download.opensuse.org-f3ba78e8 | server:monitoring          | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/repositories/server:/monitoring/openSUSE_Tumbleweed/      |        
5 | openSUSE-20150508-0                 | openSUSE-20150508-0        | No      | ----      | No      |   99     | yast2  | cd:///?devices=/dev/disk/by-id/ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001 |        
6 | repo-debug                          | openSUSE-Tumbleweed-Debug  | No      | ----      | Yes     |   99     | NONE   | http://download.opensuse.org/debug/tumbleweed/repo/oss/                                |        
7 | repo-source                         | openSUSE-Tumbleweed-Source | No      | ----      | Yes     |   99     | NONE   | http://download.opensuse.org/source/tumbleweed/repo/oss/                               |        
revue:/etc # cat /etc/os-release 
NAME=openSUSE
VERSION="Tumbleweed"
VERSION_ID="20160726"
PRETTY_NAME="openSUSE Tumbleweed (20160726) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:20160726"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
ID_LIKE="suse"

There cooloo pointed out both the cause and solution were deceptively simple:

coolo: wiert: zypper remove mt_st ; zypper dup; zypper in mt-st
coolo: the package was incorrectly renamed

My partial word-blindness didn’t spot the difference between mt_st and mt-st, but it was indeed renamed.

So here I went:

zypper remove mt_st ; zypper dist-upgrade; zypper install mt-st

Note that strictly zypper install mt-st isn’t needed on my system as it is part of  Base:System. which means that zypper dist-upgrade automatically re-installed it.

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

bash – How can I convert tabs to spaces in every file of a directory? – Stack Overflow

Posted by jpluimers on 2016/08/05

Kev:

Try the command line tool expand.

expand -t 4 input >output

Chrono Kitsune:

And for those systems that don’t use the GNU Core Utilities, you have a decent chance of expand being installed since it is standardized by The Open Group’s Single Unix Specification. See Issue 6, which is from 2001, though some updates were applied, hence the year of publication being 2004: expand

–jeroen

via bash – How can I convert tabs to spaces in every file of a directory? – Stack Overflow.

Posted in *nix, *nix-tools, bash, bash, Development, Linux, openSuSE, Power User, Scripting, Software Development, SuSE Linux | Leave a Comment »

moreutils: sponge

Posted by jpluimers on 2016/07/29

sponge, a great *nix tool part of moreutils:

sponge: soak up standard input and write to a file

Now need to figure out how to get it on Tumbleweed; maybe http://rpm.pbone.net/index.php3/stat/4/idpl/23781842/dir/opensuse/com/moreutils-0.48-1.1.i586.rpm.html

–jeroen

via: moreutils.

Posted in *nix, *nix-tools, Linux, openSuSE, Power User, SuSE Linux | Leave a Comment »

HOWTO: Multirouting with Linux : Luke Cyca Dot Calm

Posted by jpluimers on 2016/07/08

Multihoming without BGP with home routers and Linux. Need to apply this on OpenSuSE one day: HOWTO: Multirouting with Linux : Luke Cyca Dot Calm.

Basically it does Multirouting of Sessions using NAT, routing tables, rules, removal of the default routing and adding a round robin routing, fixing DNS, adding more rules and creating a failover script.

In case it ever goes offline: the WayBack Machine link.

Some more background research links:

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux | Leave a Comment »

Aliases for tools removed from `net-tools` package – via: openSUSE Build Service

Posted by jpluimers on 2016/06/16

Since quite a few commands that you regularly see mentioned on the web have been removed from OpenSuSE net-tools, I’ve created a few bash aliases in /etc/bash.bashrc.local below.

Note the original commands are not good have been deprecated for years on various distros and therefore removed:

# stuff removed from net-tools
# see https://features.opensuse.org/317197 and https://build.opensuse.org/package/view_file/network:utilities/net-tools/net-tools.changes
## Because of changes on Thu Apr 10 12:33:41 UTC 2014
alias "arp=echo 'use \"ip neigh\" or \"ip -r neight\"' && ip neigh"
alias "ifconfig=echo 'use \"ip a\"' && ip a"
alias "netstat= echo 'use \"ss\" or \"ss -r\"' && ss"
alias "route=echo 'use \"ip r\"' && ip r"
## Because of changes on Sun Mar 29 00:41:21 UTC 2015
alias "ipmaddr=echo 'use \"ip maddr\"' && ip maddr"
alias "iptunnel=echo 'use \"ip tunnel\"' && ip tunnel"

Some bits of the net-tools change-log:

-------------------------------------------------------------------
Sun Mar 29 00:41:21 UTC 2015 - jengelh@inai.de
- ipmaddr and iptunnel are obsolete too, move them to subpackage.
(Superseded by `ip maddr` and `ip tunnel`)
- remove redundant %clean section
-------------------------------------------------------------------
Thu Apr 10 12:33:41 UTC 2014 - mmarek@suse.cz
- Move arp, ifconfig, netstat and route to a -deprecated subpackage
(fate#317196, fate#317197)
- Drop the rarp tool, which has been broken since kernel 2.3

Note that the -lntu parameter seems to be the same for both ss and netstat: [WayBackGet a list of Open Ports in Linux – Super User

–jeroen

via File net-tools.changes of Package net-tools – openSUSE Build Service.

Posted in *nix, *nix-tools, bash, bash, Development, Linux, openSuSE, Power User, Scripting, Software Development, SuSE Linux | Leave a Comment »

OpenSuSE Tumbleweed notes

Posted by jpluimers on 2016/06/13

After zypper dup (dist-upgrade) or zypper up (update) a zypper ps will list processes using deleted files (i.e. processes that likely need to be restarted).

Some processes that can be restarted without reboot:

To research

  • dhcpcd
  • rs:main
  • agetty
  • lvmetad
  • agetty
  • dmeventd

Some processes that require a reboot:

–jeroen

Posted in *nix, ESXi5, ESXi5.1, ESXi5.5, ESXi6, Linux, openSuSE, Power User, SuSE Linux, Virtualization, VMware, VMware ESXi | Leave a Comment »

TUMBLEWEED: local console yast linedrawing characters garbage after first reboot

Posted by jpluimers on 2016/06/09

I long while after asking TUMBLEWEED: local console yast linedrawing characters garbage after first reboot, I researched the issue further.

First the workaround:

It is enough if any user on any console (for which /usr/bin/tty will usually show /dev/tty#) runs /bin/unicode_start.

After that, any user that logs on on any console will get the correct line-drawing characters with yast.

Then about the problem:

It looks like the problem is that during boot, nothing calls /bin/unicode_start. This was a solved bug, but seems to be back in Tumbleweed so I posted a comment to the bug.

I don’t think it is related to a truckload of PuTTY UTF-8 line-drawing issues like below. I’ve included them just for reference in any case proves me wrong (:

Same for changing unicode_start by hand:

–jeroen

via:

Original question thread:

Read the rest of this entry »

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux | 1 Comment »

bash – How do I find all of the symlinks in a directory tree? – Stack Overflow

Posted by jpluimers on 2016/06/01

I needed to find the symlinks in /etc pointing to directories and know both the name and place they point to.

revue:~ # ls -al `find -L /etc/ -xtype l -type d`
find: ‘/etc/ssh/broken/ssh_host_dsa_key’: Too many levels of symbolic links
find: ‘/etc/ssh/broken/ssh_host_ecdsa_key’: Too many levels of symbolic links
find: ‘/etc/ssh/broken/ssh_host_key’: Too many levels of symbolic links
find: ‘/etc/ssh/ssh_host_ecdsa_key’: Too many levels of symbolic links
find: ‘/etc/ssh/ssh_host_dsa_key’: Too many levels of symbolic links
find: ‘/etc/ssh/ssh_host_key’: Too many levels of symbolic links
lrwxrwxrwx 1 root root 19 May  7 15:43 /etc/apparmor.d/cache -> /var/cache/apparmor
lrwxrwxrwx 1 root root  6 Sep 28  2014 /etc/rc.d -> init.d
lrwxrwxrwx 1 root root 26 May 23 13:50 /etc/squid/errors -> /usr/share/squid/errors/de
lrwxrwxrwx 1 root root 28 Mar 25 22:07 /etc/ssl/certs -> /var/lib/ca-certificates/pem
lrwxrwxrwx 1 root root 18 Apr 30 14:20 /etc/xdg/systemd/user -> ../../systemd/user

–jeroen

via: bash – How do I find all of the symlinks in a directory tree? – Stack Overflow.

Posted in *nix, *nix-tools, bash, bash, Development, Linux, openSuSE, Power User, Scripting, Software Development, SuSE Linux | Leave a Comment »

Keeping openSuSE Tumbleweed rolling release up to date

Posted by jpluimers on 2016/05/27

openSuSE provides a rolling release called tumbleweed. Given the very different nature, traditional means of updating don’t work (I added some links to the text):

You should use “zypper dup” to keep your system up-to-date, YaST->Online Update is useless on Tumbleweed.

You can use the update applet, YaST->Software Management, or “zypper up” as well most of the time, but those won’t be able to cope with _all_ changes in Tumbleweed, e.g. they might have problems when packages are dropped or renamed.

There are mixed opinions on using rolling releases, for instance Are rolling release Linux distros better than fixed releases? | ITworld.

But I have the feeling that many of them are ready for real primetime, and Windows 10 seems to follow the rolling-release direction too. It’s a matter of the process leading to the rolling updates being very well, and offering customers a choice when to install updates.

Edit 20160527:

Richard Brown (@sysrich), Geek, Linux engineer. openSUSE Chairman, chimed in on Twitter:

I prefer `zypper dup –no-allow-vendor-change`. It is safer when additional repos are present. I alias it as `zypper-twup`

–jeroen

via TUMBLEWEED: Tumbleweed Repos.

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux | 1 Comment »