Hi,
I have need it again, and I reply here for to explain the right way. It works for me (I home it works for you too, but be careful ):
df -h
fdisk -ul /dev/vda To show the hard disk. It looks like:
Disk /dev/vda: 21.5 GB, 21474836480 bytes
16 heads, 63 sectors/track, 41610 cylinders, total 41943040 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: 0x000574cf
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 41943039 20970496 83 Linux
fdisk -u /dev/vdaCommand (m for help):
dSelected partition
1Command (m for help):
pCommand (m for help):
nCommand action
e extended
p primary partition (1-4)
pPartition number (1-4):
1First sector (63-41943039, default 63):
2048 <-- You can see it in the size table that we showed 1 minute ago.
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):
41943039 <-- You can see it in the size table that we showed 1 minute ago.
Command (m for help):
aPartition number (1-4):
1Command (m for help):
wThe partition table has been altered!
reboot
....
resize2fs /dev/vda1