Thoughts, notes & the occasional opinion.

Category: Ubuntu

Expanding Ubuntu boot volume in Oracle Cloud

This is an aide-memoire for myself and only applies to Ubuntu running on Oracle Cloud. Whilst Oracle has a relevant guide, it is tailored to Oracle Linux and referres to OCI utilities – in particular oci-growfs – that are not available in Ubuntu.

As always, this guide is provided “AS IS” – you use it at your own risk. If your server blows up, it’s on you. Ensure you have a full backup of the instance and don’t do this during peak periods as a reboot is required.

In Oracle Cloud Console

  1. Log into Oracle Cloud Console and select the appropriate compartment (for most this won’t apply)
  2. From (top left) Main Navigation go to Storage then click on Block Volumes from within the expanded menu
  3. Under the left-hand Block ‘Storage’ menu, select Boot Volumes
  4. From list of Boot Volumes, click on the applicable volume name
  5. In Boot Volume Details, click on the Edit button.
  6. Make the necessary changes and then click on Save Changes. If you change the volume size you will receive a prompt containing two commands to run on the host system

In Shell or SSH

Run the two commands supplied by Oracle (the ones given to me are below)

sudo dd iflag=direct if=/dev/oracleoci/oraclevda of=/dev/null count=1

echo "1" | sudo tee /sys/class/block/readlink /dev/oracleoci/oraclevda | cut -d'/' -f 2/device/rescan

Now run the lsblk command to check the detected disk sizes. You should see something like below (resizing from a 47GB disk to 75GB):

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 63.8M 1 loop /snap/core20/2571
loop1 7:1 0 55.4M 1 loop /snap/core18/2855
loop2 7:2 0 89.4M 1 loop /snap/lxd/31333
loop3 7:3 0 88.6M 1 loop /snap/oracle-cloud-agent/94
loop4 7:4 0 50.9M 1 loop /snap/snapd/24505
sda 8:0 0 75G 0 disk
├─sda1 8:1 0 46.9G 0 part /
├─sda14 8:14 0 4M 0 part
└─sda15 8:15 0 106M 0 part /boot/efi

The value of sda should that of the resized or expanded value. In this example, this is 75GB. The value of sda1 should be current size of the root partition (at the moment, 46.9G).

To apply the resized disk, simply restart the Ubuntu instance using the reboot command.

reboot -f

Upon restart, use either lsblk or any other tool to check sd3 is now resized.

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 63.8M 1 loop /snap/core20/2571
loop1 7:1 0 55.4M 1 loop /snap/core18/2855
loop2 7:2 0 89.4M 1 loop /snap/lxd/31333
loop3 7:3 0 88.6M 1 loop /snap/oracle-cloud-agent/94
loop4 7:4 0 50.9M 1 loop /snap/snapd/24505
sda 8:0 0 75G 0 disk
├─sda1 8:1 0 74.9G 0 part /
├─sda14 8:14 0 4M 0 part
└─sda15 8:15 0 106M 0 part /boot/efi

Icinga missing check_nrpe on Ubuntu

Now that I’ve got Icinga up and running, I was looking to expand its’ reach by using NRPE to monitor some additional items, most noticeably Windows Event Log entries.

However, I could not get any NRPE commands to work. The reason, the check_nrpe plugin was missing from /usr/lib/nagios/plugins or anywhere else on the server.

It would seem that the check_nrpe plugin is no longer included within the standard Nagios Plugins, but it may be installed separately through apt-get:

apt-get install nagios-nrpe-plugin

However, this also command will prompt you install the additional packages of nagios3, nagios3-cgi, nagios3-common and nagios3-core. As I’m using Icinga, this is the last things I want or need to install.

The solution, is to run the apt-get command with –use-no-install-recommends parameter:

apt-get install nagios-nrpe-plugin --use-no-install-recommends

Worked like a treat.

 

– very few of the

Resetting Webmin password for Ubuntu

The inevitable happened: I forgot the password for Webmin on one of my Ubuntu servers. In my defence, it is a server that I principally manage via SSH. Being Ubuntu, the necessary files are not in the same place as Webmin documentation. However, a quick Google search found a blog post with the solution. For my own records, I am duplicating below:

  1. Open a shell or SSH session on the target server
  2. Enter the command
    • /usr/share/webmin/changepass.pl /etc/webmin username password
    • Where username = webmin username. For me this was root
    • And password = new password.
  3. Login to Webmin to test

Thanks to and original information from http://ranawd.wordpress.com/2010/06/14/reset-webmin-password-for-ubuntu/

Given the number of password I seemingly have to remember, I think it is time that I employed some for of Password Safe.

Reset Webmin Password for ubuntu

13 Votes

I found this problem at the first time when webmin installed. Also this happens to everyone at one time or another. You go on vacation and when you come back, you forget all of the passwords on your computer.

I failed logging in several times and then Webmin blocked my IP. Getting localhost blocked isn’t a good thing to see. So I searched the Internet for a way to reset the password and I found this procedure:

1. Login to your computer as root. Type on browser address bar https://localhost:10000/
2. If you are running a Debian distribution (ubuntu), enter the following command:
/usr/share/webmin/changepass.pl /etc/webmin username password
3. Login to Webmin with your reset password.
4. eNjoY!

Getting list of network interface in Linux

For those of us used to Windows management tools, getting a comprehensive list of data regarding installed hardware on a Linux box can be a little daunting. Whilst recently migrating a virtualised ubuntu box, I needed to find out just what network hardware was in use.

Within a linux shell, type the following

lshw -class network

This will produce a full list of all installed network hardware. For newbies, the define name you are probably looking for is called logical name.

Manually Setting DNS Server Addresses in Ubuntu (Linux)

No matter how many times I have installed and configured Linux, I can never remember the name of the configuration file that stores the DNS/Nameserver details. This really only applies if your Linux machine is using a static IP address. In most scenarios, it does not apply to DHCP clients.

DNS server settings are stored in /etc/resolve.conf To edit this file, enter the following command from the shell

1
$sudo nano /etc/resolv.conf

(If you have installed XWindows/Gnome, you can use sudo gedit /etc/resolve.conf instead)

Add the entries for your DNS or nameservers as follows

1
2
nameserver <IP address of DNS server 1>
nameserver <IP address of DNS server 2>

etc…

© 2025 Alexander John

Theme by Anders NorénUp ↑