Category: Linux

Resizing Cisco Prime Infrastructure partition – Very Useful Info

Here’s a little something to help my fellow users out, in extending the disk allocation of Cisco Prime. Note; this is not something you will find in any Cisco documentation anywhere!  It is aimed at stopping the /opt file system from filling up.  Which would never have occurred had the Storage Guy allocated the correct amount in the first instance (as requested) in-line with the recommended specification that was provided to him, rather that what he believed he could spare.  But that’s ok – he’s not the one fixing it up for the third time………grrrrrrrr!!!!

We have since moved on and I’ve been allocated some disk space (thanks for that).  Which now just leaves the rest of the work, so here goes:

From the Prime Infrastructure 2.2 shell login as root and run the following:

ade # fdisk /dev/sda

The number of cylinders for this disk is set to 118792.
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: 977.1 GB, 977105059840 bytes
255 heads, 63 sectors/track, 118792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
/dev/sda2 64 77 102400 83 Linux
/dev/sda3 77 38245 306584576 8e Linux LVM

Command (m for help): n
Command action
e extended
p primary partition (1-4)

p

Selected partition 4

First cylinder (38245-118792, default 38245):
Using default value 38245
Last cylinder or +size or +sizeM or +sizeK (38245-118792, default 118792):
Using default value 118792

Running fdisk we should see the additional 600 Gb of disk space available. Now we create an additional primary partition, being number 4 or ‘/dev/sda4’, and by default this partition will created at last sector/track of the previous partition being 38245 and extend to the maxium available.

Taking a look at the partition table we can see the following has been allocated:

/dev/sda4 38245 118792 646996740 83 Linux

From here we can to tag this 8e to be a Linux LVM Filesystem, verify and write to the partition table 🙂 then reboot.

Post reboot the partition should be usable and we can use the pvcreate to create the new volume.

ade # pvdisplay /dev/sda4
“/dev/sda4” is a new physical volume of “617.02 GB”
— NEW Physical volume —
PV Name /dev/sda4
VG Name
PV Size 617.02 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID MHCoKt-mfe4-Yzp3-HSbB-NIQU-l1T4-NYX67c

ade # pvcreate /dev/sda4

Writing physical volume data to disk “/dev/sda4”
Physical volume “/dev/sda4” successfully created

pvcreate is used to create the new physical volume and vgdisplay will still show the old 292.38 GB because it’s not added yet to smosvg.

ade # vgdisplay

— Volume group —
VG Name smosvg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 12
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 11
Open LV 11
Max PV 0
Cur PV 1
Act PV 1
VG Size 292.38 GB
PE Size 32.00 MB
Total PE 9356
Alloc PE / Size 9356 / 292.38 GB
Free PE / Size 0 / 0
VG UUID ORncbY-QHjO-TMX0-A9L2-RFdw-8FFr-LoYJHT

pvdisplay shows two volumes still:

ade # pvdisplay

— Physical volume —
PV Name /dev/sda3
VG Name smosvg
PV Size 292.38 GB / not usable 7.00 MB
Allocatable yes (but full)
PE Size (KByte) 32768
Total PE 9356
Free PE 0
Allocated PE 9356
PV UUID RJzYZ4-7DRk-Nq2C-jLSA-mw3V-NGgX-R47L2M

“/dev/sda4” is a new physical volume of “617.02 GB”
— NEW Physical volume —
PV Name /dev/sda4
VG Name
PV Size 617.02 GB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID MHCoKt-mfe4-Yzp3-HSbB-NIQU-l1T4-NYX67c

Here we are going to add the volume to /opt then extend it using resize2fs so that kernel knows the size has increased but first we need to do some other funky magic:

ade # vgextend smosvg /dev/sda4

Volume group “smosvg” successfully extended

ade # lvextend /dev/mapper/smosvg-optvol /dev/sda4

Extending logical volume optvol to 823.22 GB
Logical volume optvol successfully resized

ade # resize2fs /dev/mapper/smosvg-optvol

resize2fs 1.39 (29-May-2006)
Filesystem at /dev/mapper/smosvg-optvol is mounted on /opt; on-line r
Performing an on-line resize of /dev/mapper/smosvg-optvol to 21580185
The filesystem on /dev/mapper/smosvg-optvol is now 215801856 blocks long.

Done! 😛