sasha2002 Blog's

Just another blog from admin's

How to extend disk \ partition on VMWare VM —

1. STOP VM on VMWare
2. EDIT and add disk space
3. Start VM

4. Initial size of sda1 :
# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 16G 5.6G 8.8G 39% /

5. Check partition :

# fdisk -l

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: 0x00094dbc

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 32088063 16043008 83 Linux
/dev/sda2 32090110 33552383 731137 5 Extended

6. Delete and create new partition with same “start sector” :

fdisk -u /dev/sda

p - to print current partition table
d - to select and delete it
n - crete new partition table ( create it to start from 2048 on my example , end with latest proposed number)
w - to write changes

7. Reboot VM from console :
# reboot
8. After VM load extend partition :

# resize2fs /dev/sda1
resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/sda1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 4
Performing an on-line resize of /dev/sda1 to 13106944 (4k) blocks.
The filesystem on /dev/sda1 is now 13106944 blocks long.

9. And now size is ok :
# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 50G 5.6G 42G 12% /


Categorised as: Linux



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.