Tuesday, May 23, 2017

How to print ZFS filesystems ordered by space used

How to print ZFS filesystems ordered by space used

zfs get -o value,name -Hp used|sort -n

Saturday, May 20, 2017

rpmbuild random notes

sudo dnf install rpmdevtools

rpmdev-setuptree

~/rpmbuild/SRPMS/
~/rpmbuild/SPECS/
~/rpmbuild/SOURCES/
~/rpmbuild/RPMS/
~/rpmbuild/BUILD/
~/.rpmmacros

sudo dnf download --source package

Thursday, March 9, 2017

Fedora dnf history

Sometimes it can happen that you remove a package and inadvertently you remove a bunch of dependencies. Like removing the entire desktop manager: what a mess, waht a pain in the ass!
Sometimes dependecies are strange.

Rarely, but it can happen too, after an update something doesn't work anymore. Maybe the updated package is buggy? Better waiting for a fix.

By the way. If you install or uninstall packages by mistake, there is a way to rollback the changes: history.

sudo dnf history list

And you can see the dnf activities.

sudo dnf history info 132

You can see the details of the dnf command labeled as 132

Let's say 132 is the number of the last action

ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   132 | update                   | 2017-03-09 16:06 | Update         |    8 

Issue the following command in order to uninstall these updates:

sudo dnf history undo 132

And you will get something like:

Undoing transaction 132, from Thu Mar  9 21:06:10 2017
No package libgdata-0:0.17.6-3.fc25.x86_64 available.
Error: An operation cannot be undone

Well. WTF!

It seems that, if you would like to have the option to rollback updates, you must enable packages cache beforehand with keepcache=1 in the /etc/dnf/dnf.conf configuration file. This could lead to some disk space used to store previous versions of rpms? I must investigate a bit deeper.

References: 

Monday, March 6, 2017

Tuesday, February 21, 2017

Oracle Database Appliance: random notes

How to create a shared repository

[root@oda11 ~]# oakcli create repo shared1 -dg data -size 50G

How to import a VM template

You must/can download a template from edelivery.oracle.com
You need to put the template or the assemly inside the DOM0, then import it from ODA_BASE.
[root@oda11 ~]# oakcli import vmtemplate prova -assembly /tmp/OVM_OL7U2_x86_64_PVHVM.ova -repo shared1 -node 0

How to create a VM

[root@oda11 ~]# oakcli clone vm pigna -vmtemplate prova -repo shared1 -node 0

How to create a vdisk

A vdisk that will be attacched to the VM
[root@oda11 ~]# oakcli create vdisk pignadiskl -repo shared1 -size 5G -type local

How to create a cpupool

The same pool name must be configured on each node.
[root@oda12 ~]# oakcli create cpupool provapool -numcpu 2 -node 1
[root@oda12 ~]# oakcli create cpupool provapool -numcpu 2 -node 0

How to configure the VM

Add two network interfaces

[root@oda11 ~]# oakcli configure vm pigna -network "['type=netfront,bridge=net1','type=netfront,bridge=net2']"

Enable failover

[root@oda11 ~]# oakcli configure vm pigna -failover true

Attach an additional disk

[root@oda11 ~]# oakcli modify vm pigna -attachvdisk pignadiskl

Configuring cpupool

[root@oda11 ~]# oakcli configure vm pigna -cpupool provapool

Starting the VM

[root@oda11 ~]# oakcli start vm pigna

Attacching to the console

You must ssh to the ODA_BASE using -Y flag.
[root@oda11 ~]# oakcli show vmconsole pigna
A VNC session will start

Expanding the disk space from inside the VM

This is the vdisk created before.
[root@pigna ~]# btrfs device add /dev/xvdb /
You can attach additional vdisks, and the VM OS will see them without the need to reboot it.

Adding space to the repo

[root@oda11 ~]# oakcli configure repo shared1 -incsize 25G

Monday, December 12, 2016

Percona Monitoring Plugins for Nagios on SmartOS

Using Percona monitoring plugins inside a SmartOS branded zone, I get an error related to the local command.

percona-monitoring-plugins-1.1.7/nagios/bin/pmp-check-mysql-innodb[58]: local: not found [No such file or directory]

To solve this problem, perform the following command against every script (i.e. inside the nagios/bin/ directory).

sed -i 's/^\( \{2,4\}\)local /\1typeset /' *

Monday, November 28, 2016

rsyslog gnutls: could not load module

Starting rsyslog with gnutls configured I got this error:

Nov 27 21:57:03 prometeo rsyslogd-2068: could not load module '/usr/lib64/rsyslog/lmnsd_gtls.so', rsyslog error -2078 [try http://www.rsyslog.com/e/2068 ]

The suggested link is not useful as the description (module could not be loaded - init failed) is too generic.

The problem here was that in the config file, the line DefaultNetstreamDriverCAFile was pointing to a non existent file.