Reset Search
 

 

Article

How to expand NetSight VM disk space

« Go Back

Information

 
TitleHow to expand NetSight VM disk space
Objective
Expand NetSight VM disk space
Environment
NetSight Virtual Machine
Procedure
Disk Provisioning



We looked on Google and found - http://www.geoffstratton.com/expand-hard-disk-ubuntu-lvm.  Following the steps listed on the page, you cqn expand the free disk space on a NetSight VM machine.

---- USING THIS PROCESS HAS NOT BEEN TESTED IN SQA.  THIS IS JUST FOLLOWING THE CONFIGURATION STEPS LISTED ON A RANDOM WEB SITE. ---

The first thing I did was to increase the "Disk Provisioning > Provisioned Size" option from 40 GB to 50 GB from within the vSphere Client (see image above).
 
(Note: if the user is unable to increase the "Provisioned Size" then they will need to remove any VM snapshots. See https://communities.vmware.com/thread/417849?start=0&tstart=0)

I powered on the virtual machine and then followed the steps listed on the page above.

Here is the output from my test using a 7.0.6.11 Purview-VM appliance running on a Ubuntu 12.04 LTS server.

root@purview-vm.dmqa.enterasys.com:~$ df -h

Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/systemvg-root   28G  5.2G   21G  20% /   <<< EXPAND THIS PARTITION
udev                       5.9G  4.0K  5.9G   1% /dev
tmpfs                      1.2G  260K  1.2G   1% /run
none                       5.0M     0  5.0M   0% /run/lock
none                       5.9G     0  5.9G   0% /run/shm
/dev/sda1                  228M   80M  137M  37% /boot


root@purview-vm.dmqa.enterasys.com:~$ parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.

Prompt will be: (parted)
Type the command: print free

This will show the following data:

Model: VMware Virtual disk (scsi)

Disk /dev/sda: 53.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
        32.3kB  1049kB  1016kB            Free Space
 1      1049kB  256MB   255MB   primary   ext2         boot
        256MB   257MB   1048kB            Free Space
 2      257MB   42.9GB  42.7GB  extended
 5      257MB   42.9GB  42.7GB  logical                lvm
       
42.9GB  53.7GB  10.7GB            Free Space     <<< NEW FREE DISK SPACE

(parted) quit

root@purview-vm.dmqa.enterasys.com:~$ cfdisk
 Note: this will open an application. 
    > I selected the "free disk space" named /sda6
    > Selected "New"
    > Selected "Logical"
    > Left the "FS Type" set to "Linux" option 83
    > Selected "Write" to save the changes
    > Selected "Quit" to exit

root@purview-vm.dmqa.enterasys.com:~$ fdisk -l /dev/sda


Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003dfb8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   104857599    52177921    5  Extended
/dev/sda5          501760    83884031    41691136   8e  Linux LVM

/dev/sda6        83884095   104857599    10486752+  83  Linux   <<< NEW FREE DISK SPACE

root@purview-vm.dmqa.enterasys.com:~$ pvcreate /dev/sda6
 
Device /dev/sda6 not found (or ignored by filtering).

root@purview-vm.dmqa.enterasys.com:~$ reboot   <<< NEEDED TO REBOOT IN ORDER TO CONTINUE THE PROCESS

--- AFTER REBOOT ---

root@purview-vm.dmqa.enterasys.com:~$ pvcreate /dev/sda6
  Physical volume "/dev/sda6" successfully created

root@purview-vm.dmqa.enterasys.com:~$ pvdisplay

  --- Physical volume ---
  PV Name               /dev/sda5
  VG Name              
systemvg
  PV Size               39.76 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              10178
  Free PE               0
  Allocated PE          10178
  PV UUID               6IRZnw-JmLL-yAAT-hWXx-1j9B-Zv7u-JVQJDv

  "/dev/sda6" is a new physical volume of "10.00 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/sda6
  VG Name
  PV Size               10.00 GiB
  Allocatable           NO
  PE Size               0
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               fotg5i-2XNv-ucNI-J0vZ-Ntxh-oKcE-OVo2Oz


root@purview-vm.dmqa.enterasys.com:~$ vgextend systemvg /dev/sda6
  Volume group "systemvg" successfully extended

root@purview-vm.dmqa.enterasys.com:~$ pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda5
  VG Name              
systemvg
  PV Size               39.76 GiB / not usable 2.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              10178
  Free PE               0
  Allocated PE          10178
  PV UUID               6IRZnw-JmLL-yAAT-hWXx-1j9B-Zv7u-JVQJDv

  --- Physical volume ---
  PV Name               /dev/sda6
  VG Name              
systemvg
  PV Size               10.00 GiB / not usable 992.50 KiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              2560
  Free PE               2560
  Allocated PE          0
  PV UUID               fotg5i-2XNv-ucNI-J0vZ-Ntxh-oKcE-OVo2Oz


root@purview-vm.dmqa.enterasys.com:~$ lvdisplay
  --- Logical volume ---
  LV Name                /dev/systemvg/root
  VG Name                systemvg
  LV UUID                YujeL7-IGjx-K8Gn-iQGK-pVID-5nlk-FD0BIA
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                27.76 GiB
  Current LE             7106
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Name                /dev/systemvg/swap_1
  VG Name                systemvg
  LV UUID                ZPG7px-o3td-g7A7-5b0B-IMGP-SO93-04ykNn
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                12.00 GiB
  Current LE             3072
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1


root@purview-vm.dmqa.enterasys.com:~$ lvextend -l+100%FREE /dev/systemvg/root
  Extending logical volume root to 37.76 GiB
  Logical volume root successfully resized

root@purview-vm.dmqa.enterasys.com:~$ resize2fs /dev/mapper/systemvg-root
resize2fs 1.42 (29-Nov-2011)
Filesystem at /dev/mapper/systemvg-root is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 3
The filesystem on /dev/mapper/systemvg-root is now 9897984 blocks long.


root@purview-vm.dmqa.enterasys.com:~$ df -h
Filesystem                 Size  Used Avail Use% Mounted on
/dev/mapper/systemvg-root   38G  5.2G   31G  15% /   <<< SIZE HAS BEEN INCREASED
udev                       5.9G  4.0K  5.9G   1% /dev
tmpfs                      1.2G  264K  1.2G   1% /run
none                       5.0M     0  5.0M   0% /run/lock
none                       5.9G     0  5.9G   0% /run/shm
/dev/sda1                  228M   80M  137M  37% /boot



 
Additional notes
What's described in NetSight V7 documentation is one possible way to increase the disk space for an appliance.
One possible reason for using the new hard drive option is that it does not appear to be possible to modify a partition when that partition is already mounted.   But the Ubuntu appliances look to be using LVM "Logical Volumes" and it appears that the partition can be expanded while the partition is already mounted.

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255