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

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)


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
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

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

“/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! 😛

9 thoughts on “Resizing Cisco Prime Infrastructure partition – Very Useful Info

  1. This procedure isn’t documented by Cisco because they don’t support it. Doesn’t mean it doesn’t work though.

    Personally after increasing the disk size in VMware, I boot off a GParted ISO and increase the partition that way with a nice GUI slider bar. Reboot, ncs stop, login as root then run the lvextend and resize2fs commands to increase the /opt partition. Older versions of Prime or NCS used to have sda2 has /opt then a small 1GB sda3 for /storedconfig. GParted works better in this situation as you need to move the sda3 partition.

    Cisco’s official solution is to add another disk to the VM and reboot. ADE-OS will then see this unformated disk and automatically add it tot the volume group for /opt. I’ve never tried it but apparently it works. You know about the ncs cleanup command as well?

    For what it’s worth I don’t think any amount of disk space will make Prime stop running out of space. It’s a pig of a product. I miss WCS it just worked.

  2. Thanks John, it does seem to eat through the disk-space at a fair rate. I embarked on this adventure, upgrading PI, so that it would support some of my newer hardware. This in itself was quite a bit of fun, upgrading to a version that allowed me to backup PRIME to a version that allowed me to get the licenses back into version – that was just simply WOW!!

    As far as just adding additional disk to the VM and it being recognised. Needless to say this didn’t work either and I still had to carry out the steps mentioned.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: