Views:


Step By Step



  1. Make a backup of the ECX Server, preferably a clone, before proceeding with the steps below.
  2. The root file system resides on Disk1. In the vSphere console, expand Disk1.
  3. Open a command line session to the ECX Server and log in as root:
    Follow the commands below.  In the example below the root partition is expanded from 25Gb to 35GB.
  4. Since disk1 was expanded, rescan the SCSI disk.
[root@ CXW_ECX ~]# cd /sys/class/scsi_device/
[root@ CXW_ECX ~]# scsi_device]# ls
The SCSI disk we will need to rescan is 2:0:0:0 as this is for Disk1.
[root@CXW_ECX ~]# echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
List the Partition Table for /dev/sda as this is the file system for the root partition.
[root@CXW_ECX ~]# fdisk -l /dev/sda
 
Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00099713
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          33      262144   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              33        2073    16384000   82  Linux swap / Solaris
/dev/sda3            2073        5221    25290514+  83  Linux

As per the output above, you will only be working on partition 3, /dev/sda3, which is the root file system.
  1. Extend partition 3 to the new allocated blocks. First delete the partition, then re-create it.
[root@CXW_ECX ~]# fdisk /dev/sda
 
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
 
Command (m for help): p
 
Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00099713
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          33      262144   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              33        2073    16384000   82  Linux swap / Solaris
/dev/sda3            2073        5221    25290514+  83  Linux
 
Command (m for help): d
Partition number (1-4): 3
 
Command (m for help): p
 
Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00099713
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          33      262144   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              33        2073    16384000   82  Linux swap / Solaris
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (2073-6527, default 2073): Keep blank, press enter.
Using default value 2073
Last cylinder, +cylinders or +size{K,M,G} (2073-6527, default 6527): Keep blank, press enter.
Using default value 6527
 
Command (m for help): p
 
Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00099713
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          33      262144   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              33        2073    16384000   82  Linux swap / Solaris
/dev/sda3            2073        6527    35780959+  83  Linux
 
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 or after you run partprobe(8) or kpartx(8)
Syncing disks.
 
  1. Reboot the ECX server.
    After rebooting the server type the command below.
resize2fs /dev/sda3
Enter the command below to view the new size of the partition:
df -h
 
Related Products: ECX