Resize disk

This support forum board is for support questions relating to Nagios Network Analyzer, our network traffic and bandwidth analysis solution.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Resize disk

Post by snapon_admin »

IS there any documentation on how to resize the disk for NNA? Our VM has a 100G drive, but the vmWare installation only creates a 10G partition. Ours is nearly full so we need to increase it, but I want to do so with the least amount of risk possible. Thoughts?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Resize disk

Post by sreinhardt »

I believe you should be able to follow the XI resize documentation, specifically it sounds like you just need to increase the lvm scheme. http://assets.nagios.com/downloads/nagi ... M_Disk.pdf
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Resize disk

Post by snapon_admin »

So, going off this documentation do I just need to follow these steps, skipping the rest?
Resizing the Physical Volume (PV)
The CentOS system installed in the virtual machine image we ship uses Logical Volume Management (LVM) for its partitions. If you
have never worked with LVM before and want to better understand the terminology herein, visit
http://en.wikipedia.org/wiki/Logical_volume_management and http://www.tldp.org/HOWTO/LVM-HOWTO/.
In order to make use of the newly increased disk space, LVM needs to be told that it is there and should be used. For this step you will
adjust the size of the physical volume to match the new size of the partition. We want the physical volume to automatically expand to
use all the free space that is available on the device. The command to accomplish this is simple:
# pvresize /dev/sda2
Resizing the Logical Volume (LV)
The next step is to resize the logical volume to use the new space available in the LVM physical volume. Since we are going to use all
of the space, the following command can be used:
# lvresize /dev/mapper/VolGroup00-LogVol00 /dev/sda2
Resizing the Filesystem
The last step is to change the filesystem residing on the logical volume so that it knows to put files in that space. The following
command will resize the filesystem to make use of all space on the logical volume:
# resize2fs /dev/mapper/VolGroup00-LogVol00
You're done! You can confirm the disk resize worked by using df -h to display a summary of filesystem size and usage
I already checked with our VM admin and he said that the VM has 100G available.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Resize disk

Post by sreinhardt »

Yes, if your vmware guy said this was already done, you should only need to pvresize and verify!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Resize disk

Post by snapon_admin »

Forgive my ignorance, got an error on step 1:

Code: Select all

[root@lisl-ngna-01-pv ~]# pvresize /dev/sda2
-bash: pvresize: command not found
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Resize disk

Post by sreinhardt »

Interesting, let's verify you are infact using lvm. If you could run:

Code: Select all

df -h
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Resize disk

Post by snapon_admin »

Code: Select all

[root@lisl-ngna-01-pv ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                9.4G  9.1G  224M  98% /
devtmpfs              2.0G  200K  2.0G   1% /dev
tmpfs                 2.0G     0  2.0G   0% /dev/shm
/dev/sda1             9.4G  9.1G  224M  98% /
[root@lisl-ngna-01-pv ~]#
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Resize disk

Post by sreinhardt »

OK, so this is not using lvm, its just standard partitioning. When I use df on my system it specifically has a line:

Code: Select all

/dev/mapper/VolGroup00-LogVol00
In this case, I would suggest (if you haven't already) making a vmware snapshot. Then you should be able to use something like this guide to resize the partition. I should note, that you will likely need to use a livecd of some form or another, since it is unlikely that you can unmount / while in use.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Resize disk

Post by snapon_admin »

I'm not really a linux or vmware expert, how would I use a livecd in this sort of environment? What would be the steps I need to take to do this? Also (again, excuse my ignorance), but will this have any negative impact on the data on the server? I'm assuming not, but obvioulsy just want to be sure.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Resize disk

Post by sreinhardt »

I don't think it should have any negative impact other than a lack of data for the time while it is down. As for live cd, you should be able to have vmware load an iso from your local system or a datastore available to vmware. Then boot to that iso, and you can perform the resize. Otherwise a livecd, is really just a linux OS that runs off a cd, designed to not leave changes on your system.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked