Technical Note: Adding space to Linux partitions when a customer needs additional drive space for their VM
Systems Impacted
Impact: High
The following systems are impacted:
- Smart Suite
- Red Hat 5
Overview
After a customer has added space to their database server virtual machines, the following process is needed for Linux to utilize this additional VM storage.
Remediation
Process Steps
Prior to beginning this procedure, the customer needs to make a clone of the VM to provide a backup.
-
Verify Red Hat 5 is being used.
more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.11 (Tikanga)
Work with your Spok DBA to ensure the server you are touching is not the primary DB. If it is primary, the DBA will need to perform a failover. During this time, the customer will see a 30 second freeze system wide. Next, the Spok DBA will disable FSFO.
-
Verify the default Smart Suite VM is in place by checking that the current hard drive looks like the following:
[root@05092018Diskpart ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01
250G 29G 209G 12% /
/dev/mapper/VolGroup00-LogVol02
4.8G 1.1G 3.5G 23% /var
/dev/mapper/VolGroup00-LogVol03
4.8G 149M 4.4G 4% /var/log
/dev/mapper/VolGroup00-LogVol05
1.4G 43M 1.3G 4% /tmp
/dev/mapper/VolGroup00-LogVol04
19G 181M 18G 1% /var/log/audit
/dev/sda1 289M 25M 250M 9% /boot
tmpfs 16G 0 16G 0% /dev/shm
[root@testpart57db01 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 39162.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sda: 322.1 GB, 322122547200 bytes
255 heads, 63 sectors/track, 39162 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 38 305203+ 83 Linux
/dev/sda2 39 39162 314263530 8e Linux LVM
Command (m for help): q
-
The customer needs to increase the VMware disk by 100 GB (VMware edit settings).
Then the VM needs to be rebooted to make the new space available to grow in.
[root@testpart57db01 ~]# reboot
Broadcast message from root (pts/1) (Wed May 9 18:56:33 2018):
The system is going down for reboot NOW!
-
Log back into the system after reboot.
#### Who is currently logged in ####
18:58:58 up 1 min, 1 user, load average: 0.64, 0.17, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 berney.corp.ad.p 18:58 0.00s 0.00s 0.00s -bash
[root@testpart57db01 ~]# fdisk /dev/sda
The number of cylinders for this disk is set to 52216.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sda: 429.4 GB, 429496729600 bytes
255 heads, 63 sectors/track, 52216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 38 305203+ 83 Linux
/dev/sda2 39 39162 314263530 8e Linux LVM
-
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (39163-52216, default 39163):
Using default value 39163
Last cylinder or +size or +sizeM or +sizeK (39163-52216, default 52216):
Using default value 52216
Command (m for help): p
Disk /dev/sda: 429.4 GB, 429496729600 bytes
255 heads, 63 sectors/track, 52216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 38 305203+ 83 Linux
/dev/sda2 39 39162 314263530 8e Linux LVM
/dev/sda3 39163 52216 104856255 83 Linux
Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 8e
Command (m for help): p
Disk /dev/sda: 429.4 GB, 429496729600 bytes
255 heads, 63 sectors/track, 52216 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 38 305203+ 83 Linux
/dev/sda2 39 39162 314263530 8e Linux LVM
/dev/sda3 39163 52216 104856255 8e Linux LVM
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@testpart57db01 ~]# reboot
-
Log back into the system after reboot.
#### Who is currently logged in ####
14:05:05 up 1 min, 1 user, load average: 0.83, 0.23, 0.08
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/0 berney.corp.ad.p 14:05 0.00s 0.00s 0.00s -bash
[root@testpart57db01 ~]# pvcreate /dev/sda3
dev_is_mpath: failed to get device for 8:3
The desired output is the following:
Writing physical volume data to disk "/dev/sda3"
Physical volume "/dev/sda3" successfully created
[root@testpart57db01 ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 299.71 GB / not usable 17.98 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 9590
Free PE 0
Allocated PE 9590
PV UUID m3csO8-1gx4-Au7f-i7dT-Zw8d-1BUr-S0OeZ7
"/dev/sda3" is a new physical volume of "100.00 GB"
--- NEW Physical volume ---
PV Name /dev/sda3
VG Name
PV Size 100.00 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID M3n0XD-zErO-arbw-bucm-qulq-NIxT-Xrma1O
[root@testpart57db01 ~]# vgextend VolGroup00 /dev/sda3
Volume group "VolGroup00" successfully extended
[root@sm57dbtestpart ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name VolGroup00
PV Size 299.71 GB / not usable 17.98 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 9590
Free PE 0
Allocated PE 9590
PV UUID 6J0g8g-5I3u-5dwU-ZGeB-1EnM-Gdxu-0CatQE
--- Physical volume ---
PV Name /dev/sda3
VG Name VolGroup00
PV Size 100.00 GB / not usable 30.69 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 3199
Free PE 3199
Allocated PE 0
PV UUID PdUUfC-2Bq1-f7lA-jHYj-dQF1-eGbl-abVXQE
[root@testpart57db01 ~]# lvextend -l +100%FREE /dev/VolGroup00/LogVol01
Extending logical volume LogVol01 to 357.22 GB
Logical volume LogVol01 successfully resized
[root@testpart57db01 ~]# resize2fs /dev/VolGroup00/LogVol01
resize2fs 1.39 (29-May-2006)
Filesystem at /dev/VolGroup00/LogVol01 is mounted on /; on-line resizing required
Performing an on-line resize of /dev/VolGroup00/LogVol01 to 93642752 (4k) blocks.
The filesystem on /dev/VolGroup00/LogVol01 is now 93642752 blocks long.
[root@testpart57db01 ~]# df -hPFilesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01 347G 29G 300G 9% /
/dev/mapper/VolGroup00-LogVol02 4.8G 1.1G 3.5G 23% /var
/dev/mapper/VolGroup00-LogVol03 4.8G 148M 4.4G 4% /var/log
/dev/mapper/VolGroup00-LogVol05 1.4G 43M 1.3G 4% /tmp
/dev/mapper/VolGroup00-LogVol04 19G 180M 18G 1% /var/log/audit
/dev/sda1 289M 25M 250M 9% /boot
tmpfs 16G 508M 16G 4% /dev/shm
[root@testpart57db01 ~]#
The Spok DBA can now re-enable FSFO (and failback if needed).