Page 1 of 2

Resize disk

Posted: Wed May 14, 2014 11:34 am
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?

Re: Resize disk

Posted: Wed May 14, 2014 12:00 pm
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

Re: Resize disk

Posted: Wed May 14, 2014 12:08 pm
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.

Re: Resize disk

Posted: Wed May 14, 2014 12:28 pm
by sreinhardt
Yes, if your vmware guy said this was already done, you should only need to pvresize and verify!

Re: Resize disk

Posted: Wed May 14, 2014 12:37 pm
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

Re: Resize disk

Posted: Wed May 14, 2014 12:45 pm
by sreinhardt
Interesting, let's verify you are infact using lvm. If you could run:

Code: Select all

df -h

Re: Resize disk

Posted: Wed May 14, 2014 12:50 pm
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 ~]#

Re: Resize disk

Posted: Wed May 14, 2014 12:59 pm
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.

Re: Resize disk

Posted: Wed May 14, 2014 1:35 pm
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.

Re: Resize disk

Posted: Wed May 14, 2014 1:41 pm
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.