Extending an LVM / XFS mount/partition online in Rocky Linux

Scenario: You have a VM and you’ve increased the disk size in the hypervisor and want to extend the LVM and partition in the guest.

LVM is the last partition so we can grow it versus creating a new partition and adding it to the VolGroup:

(parted) p                                                                
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 335544320s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start     End         Size        Type     File system  Flags
 1      2048s     2099199s    2097152s    primary  xfs          boot
 2      2099200s  167772159s  165672960s  primary               lvm

The easiest way to extend this is via the growpart tool, found in the cloud-utils-growpart package in AppStream

dnf install cloud-utils-growpart
Last metadata expiration check: 3:13:02 ago on Fri 25 Oct 2024 04:47:25 AM MST.
Dependencies resolved.
==============================================================================
 Package                                                                               Architecture                                                            Version                                                                      Repository                                                                  Size
==============================================================================
Installing:
 cloud-utils-growpart                                                                  noarch                                                                  0.33-0.el8                                                                   appstream                                                                   35 k

Transaction Summary
==============================================================================
Install  1 Package

Total download size: 35 k
Installed size: 75 k
Is this ok [y/N]: y
Downloading Packages:
cloud-utils-growpart-0.33-0.el8.noarch.rpm                                                                                                                                                                                                                                                    78 kB/s |  35 kB     00:00    
------------------------------------------------------------------------------
Total                                                                                                                                                                                                                                                                                         47 kB/s |  35 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                                                                                                     1/1 
  Installing       : cloud-utils-growpart-0.33-0.el8.noarch                                                                                                                                                                                                                                                              1/1 
  Running scriptlet: cloud-utils-growpart-0.33-0.el8.noarch                                                                                                                                                                                                                                                              1/1 
  Verifying        : cloud-utils-growpart-0.33-0.el8.noarch                                                                                                                                                                                                                                                              1/1 

Installed:
  cloud-utils-growpart-0.33-0.el8.noarch                                                                                                                                                                                                                                                                                     

Complete!

Now extend partition #2 with the tool:

growpart /dev/xvda 2
CHANGED: partition=2 start=2099200 old: size=165672960 end=167772159 new: size=333445087 end=335544286

That’s it, the partition is now extended, next up, extend the LV:

lvextend -l +100%FREE /dev/mapper/rl-root 
  Size of logical volume rl/root changed from <71.12 GiB (18206 extents) to <151.12 GiB (38686 extents).
  Logical volume rl/root successfully resized.

Finally grow the XFS file system via xfs_growfs

xfs_growfs /
meta-data=/dev/mapper/rl-root    isize=512    agcount=4, agsize=4660736 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=18642944, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=9103, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 18642944 to 39614464

TrueNAS Core Nextcloud 23.0.2 Plugin update -> 27.0.2

A nextcloud plugin in a TrueNAS Core system that hadn’t been updated is well, a problem. If you update the Plugin it will go straight to Nextcloud 27 which well you can’t do an update like that. So here’s what we did.

Update to the latest version of 23 in the web browser and proceed with this until you get to version 25. You will notice that you cannot get past here if you’re on a Jail running 12.2 because it has PHP74 installed by default with the original Nextcloud package.

After this point you have to install PHP 8. But doing so will try and remove nextcloud-php74 package which would remove Nextcloud of course and kinda make the whole thing pointless so, we need to force that to remain installed while we gut PHP and reinstall PHP 8.

Lock the nextcloud package, we don’t want to remove it.

pkg lock nextcloud-php74

Install PHP80

pkg install php80-bcmath php80-bz2 php80-ctype php80-curl php80-dom php80-exif php80-fileinfo php80-filter php80-gd php80-gmp php80-iconv php80-intl php80-ldap php80-mbstring php80-opcache php80-pcntl php80-pcntl php80-pdo_mysql php80-pecl-APCu php80-pecl-imagick php80-pecl-redis php80-posix php80-session php80-simplexml php80-xmlreader php80-xmlwriter php80-xsl php80-zip php80-zlib

Restart FPM to reload the web UI:
/usr/local/etc/rc.d/php-fpm restart

Perform the update through to v27 from the Web UI.

Update the plugin in TrueNAS Core once the web UI update completes. THIS WILL FAIL.

Once it fails, log back into the console and manually uninstall/install the following:

pkg unlock nextcloud-php74
pkg remove nextcloud-php74-23.0.2
pkg install nextcloud-php80 nginx mysql80-server redis php80-pecl-redis wget rsync

Now, the included nextcloud version is 27.0.0 and we’re already above that and downgrading is not supported so, we need to pull the archive from nextcloud and copy over our install;

mkdir /root/scratch
cd /root/scratch
wget https://download.nextcloud.com/server/releases/latest.tar.bz2
tar -xjvf latest.tar.bz2
rsync -avz /root/scratch/nextcloud/ /usr/local/www/nextcloud/

Now we need to fix some permission:

cd /usr/loca/www
chown www:www nextcloud
cd nextcloud
chown -R www:www .htaccess .user.ini 3rdparty/ apps AUTHORS config/ console.php COPYING core/ cron.php dist/ index.html index.php lib/ occ ocm-provider/ ocs* public.php remote.php resources/ robots.txt status.php themes/ updater/ version.php

Now start redis and mysql and, restart fpm;

/usr/local/etc/rc.d/redis start
/usr/local/etc/rc.d/mysql-server start
/usr/local/etc/rc.d/php-fpm restart

All done, easy right? LOL.

Axigen X3 to X4 Docker upgrade

I upgraded my Axigen deployment from the X3 to X4 containers which required some changes, and there’s still some issues.

The team at Axigen has resolved one of them (TNEF Loading) but we’re still having some SpamAssassin issues.

Forum thread over at Axigen.

Holiday Busy-ness

Well it’s the holidays and as such there’s a million other little projects that have been obstructing hobby jobs and tinkering so here’s a couple of the things we’ve been working on.

First, we made snow out of a few parts from the hardware store, the big air compressor and a pressure washer:

We had to get our Christmas lights hung up;

Then we had to fix an outlet on the front of the house where we connect the Christmas lights as it had gone flaky

And finally we did actually get to work on the RV a bit and replace the door lock:

Bad kitchen plumbing

So this is an issue on this house that has been around since we bought the house and frankly I should have fixed it a long time ago but, here we areā€¦ one of those low items on the list as it only presents an issue every year or so and the duration it takes to resolve it is significantly less than a permanent fix.. At any rate, I made a video so that people can understand that if you add a garbage disposal, take care in understanding your drain elevations so you know to either expect this issue or, far preferably; avoid it.