[SOLVED] Resizing Hard Disk Script Error

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
dfsocha
Posts: 14
Joined: Tue Aug 29, 2017 9:46 am

[SOLVED] Resizing Hard Disk Script Error

Post by dfsocha »

I'm trying to resize the virtual disk for my Nagios Log Server installation but when I run the automated script I get an error:

Code: Select all

This is not the standard Nagios OVA partitioning scheme.
Is there an alternate method or some way of fixing this? I'm afraid to do the "Manual" method because I don't want to break anything.
Last edited by dfsocha on Mon Dec 20, 2021 2:15 pm, edited 1 time in total.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Resizing Hard Disk Script Error

Post by pbroste »

Hello @dfsocha

Thanks for reaching out, did you look through these?

https://assets.nagios.com/downloads/nag ... M-Disk.pdf
and
https://support.nagios.com/kb/article.php?id=814

Please let us know if you have questions,
Perry
dfsocha
Posts: 14
Joined: Tue Aug 29, 2017 9:46 am

Re: Resizing Hard Disk Script Error

Post by dfsocha »

pbroste wrote:Hello @dfsocha

Thanks for reaching out, did you look through these?

https://assets.nagios.com/downloads/nag ... M-Disk.pdf
and
https://support.nagios.com/kb/article.php?id=814

Please let us know if you have questions,
Perry

I'm running CentOS 7.9 so I followed the instructions for that. I resized the disk in Hyper-V and then ran the automated script and received the error mentioned above. I did not want to do the manual process for fear of messing something up.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Resizing Hard Disk Script Error

Post by pbroste »

Hello @dfsocha

Thanks for following up, we see from the 'extend_vm_disk.sh' script that it is failing on the "DEVICE" check:

Code: Select all

df -hkPBG / | tail -1 | awk '{print $1}'
Results argument:
if [ "$DEVICE" != "/dev/mapper/centos-root" ] && [ "$DEVICE" != "/dev/mapper/VolGroup-lv_root" ]; then
echo "This is not the standard Nagios OVA partitioning scheme."
Let's take a closer look at this, please follow up and send over the results on the following:

Code: Select all

sudo cat /etc/os-release
 sudo uname -a
 sudo lsb_release -a
cat /etc/os-release
Disk info:

Code: Select all

parted -l
fdisk -l
df -h
mount
Thanks,
Perry
dfsocha
Posts: 14
Joined: Tue Aug 29, 2017 9:46 am

Re: Resizing Hard Disk Script Error

Post by dfsocha »

Perry,

Sorry for the delayed response - I was out of town for a few days. Below is the output from what you requested. Please note that lsb_release was not recognized as a command and when I ran parted -l, it told me there was an issue with GPT (you can see the error message in the information below). Please let me know if you need anything else!

Code: Select all

[root@NagiosLogServer ~]# sudo cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[root@NagiosLogServer ~]# sudo uname -a
Linux NagiosLogServer 3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 30 15:51:32 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@NagiosLogServer ~]# sudo lsb_release -a
sudo: lsb_release: command not found
[root@NagiosLogServer ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

[root@NagiosLogServer ~]# parted -l
Error: The backup GPT table is not at the end of the disk, as it should be.
This might mean that another operating system believes the disk is smaller.
Fix, by moving the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? cancel
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 537GB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags:

Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos_zabbix-home: 261GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End    Size   File system  Flags
 1      0.00B  261GB  261GB  xfs


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos_zabbix-swap: 6308MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system     Flags
 1      0.00B  6308MB  6308MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/centos_zabbix-root: 53.7GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  53.7GB  53.7GB  xfs


[root@NagiosLogServer ~]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes, 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1   629145599   314572799+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/centos_zabbix-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/centos_zabbix-swap: 6308 MB, 6308233216 bytes, 12320768 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/centos_zabbix-home: 260.8 GB, 260835377152 bytes, 509444096 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

[root@NagiosLogServer ~]# df -h
Filesystem                      Size  Used Avail Use% Mounted on
devtmpfs                        5.8G     0  5.8G   0% /dev
tmpfs                           5.8G     0  5.8G   0% /dev/shm
tmpfs                           5.8G  218M  5.6G   4% /run
tmpfs                           5.8G     0  5.8G   0% /sys/fs/cgroup
/dev/mapper/centos_zabbix-root   50G  7.9G   43G  16% /
/dev/sda2                      1014M  281M  734M  28% /boot
/dev/sda1                       200M   12M  189M   6% /boot/efi
/dev/mapper/centos_zabbix-home  243G  243G  353M 100% /home
tmpfs                           1.2G     0  1.2G   0% /run/user/1000
tmpfs                           1.2G     0  1.2G   0% /run/user/0
[root@NagiosLogServer ~]# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=6039040k,nr_inodes=1509760,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio,net_cls)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mapper/centos_zabbix-root on / type xfs (rw,relatime,attr2,inode64,noquota)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=31,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12176)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
/dev/sda2 on /boot type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
/dev/mapper/centos_zabbix-home on /home type xfs (rw,relatime,attr2,inode64,noquota)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=1210136k,mode=700,uid=1000,gid=100)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=1210136k,mode=700)
tmpfs on /run/user/48 type tmpfs (rw,nosuid,nodev,relatime,size=1210136k,mode=700,uid=48,gid=48)
[root@NagiosLogServer ~]#

User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Resizing Hard Disk Script Error

Post by pbroste »

Hello @dfsocha

Thanks for following up with the additional info, appears that Zabbix was introduced. We see that the disk partition on your OVA was renamed to "/dev/mapper/centos_zabbix-root", the 'extend_vm_disk.sh' is looking for '/dev/mapper/centos-root". For that reason, the arguments do not match, so the script is exciting. One could go into the script and change the name to match the "/dev/mapper/centos_zabbix-root" but not quite sure what else changed other than the name of the partition.(use at your own risk)

As for the "Partition 1 does not start on physical sector boundary" message should not affect anything on the disk partition. For the most part this means that the partition is misaligned or started on an odd sector. It also includes the message: "Error: The backup GPT table is not at the end of the disk".

Going forward and next steps, definitely make a known good backup on the instance. The option to edit the 'extend_vm_disk.sh' to update the partition name to match so that the script continues or run through the manual process.

Thanks,
Perry
dfsocha
Posts: 14
Joined: Tue Aug 29, 2017 9:46 am

Re: Resizing Hard Disk Script Error

Post by dfsocha »

Ahh yes, that would make sense in regards to the drive name. I'll modify the script to reflect the correct name of the drive.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Resizing Hard Disk Script Error

Post by pbroste »

Hello @dfsocha

Please follow up and let us know how things go and if you need anything further,
Perry
dfsocha
Posts: 14
Joined: Tue Aug 29, 2017 9:46 am

Re: Resizing Hard Disk Script Error

Post by dfsocha »

OK so changing the name of the drive actually broke the VM so that I couldn't even load it up. Should I just try doing it the manual way and hope that works out?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: [SOLVED] Resizing Hard Disk Script Error

Post by pbroste »

Hello @dfsocha

Dang, you are correct something has changed within the environment and the next step is to walk through the manual resize, and if that does not work then you will need to run through the backup/restore/migration.

Thanks,
Perry
Locked