Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


  • Debian 6 / 32 bit
  • VSphere


Resize main partition to utilize all resources now available.


I increased the disk space on my vm instance in Vsphere however I'm new to Linux and can't figure out how to:

  1. See this new available space (an extra 13 gigs)
  2. Figure out which partition is the main partition (I believe it's /dev/sda1)
  3. Figure out how to resize it up to the full 20g now available
  4. Figure out if I have offending files that are using up all my disk space in the first place



# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda1 during installation
UUID=15a985ca-91ce-48ca-b235-cc0dad9418ef /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=296256d8-f84a-4f4e-8511-1c2b9ea986d3 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0


/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
overflow on /tmp type tmpfs (rw,size=1048576,mode=1777)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

df -a

/dev/sda1              7867856   7474208         0 100% /
tmpfs                  1557572         0   1557572   0% /lib/init/rw
proc                         0         0         0   -  /proc
sysfs                        0         0         0   -  /sys
udev                   1553124       120   1553004   1% /dev
tmpfs                  1557572         0   1557572   0% /dev/shm
devpts                       0         0         0   -  /dev/pts
overflow                  1024        68       956   7% /tmp
fusectl                      0         0         0   -  /sys/fs/fuse/connections
binfmt_misc                  0         0         0   -  /proc/sys/fs/binfmt_misc
share|improve this question

migrated from Jan 9 '13 at 0:49

This question came from our site for professional and enthusiast programmers.

This looks like a question for SuperUser (a division of Stack Overflow) specifically for, well, Super Users :P – Nitroware Jan 8 '13 at 23:29
Or ServerFault. – Andy Lester Jan 8 '13 at 23:31

If you've changed the size of a virtual disk that Linux is running on, what you've done is changed the size of an underlying block device i.e. /dev/sda. Partitions cause "sub" block devices to be created, i.e. /dev/sda1, etc. but of course, since those are derived from the partition table, which probably didn't change when you added space, those are not going to change. To find out the size of the "underlying" disk, what you want to do is query the size of the main /dev/sda block device. See this answer for how to do that.

In Linux, the "main" partition is the one that / is mounted on. So, according to the above, it's /dev/sda. Please note that on some other systems, /var, /usr, and /home might be on different partitions - these are pretty essential to a normally functioning system as well (although you can work around it if needed in an emergency).

You may want to look into ext2online to resize the / partition. I've never used it. If you can't use it or a similar too for some reason, you could boot into the system in rescue mode, copy everything off of / onto a temporary external volume (or second virtual disk), repartition, and then copy everything back.

As far as looking into offending files, generally first you want to check /var and delete or trim any log files you don't need to keep (and do this on a regular basis). You also may want to delete uneeded things from /home and take a look at aptitude to delete any uneeded packages. Last you can try using the cruft utility. This Serverfault question has great ideas for some GUI applications that can give you a visual report on what is on your system.

share|improve this answer

If you extended the size of a running disk in vSphere, you need to rescan scsi bus with this command :

echo "- - -" > /sys/class/scsi_host/host#/scan

where # is the number of the host (0 by default).

Then , you will see the new size of the disk and you will be able to extend filesystem with e2extend

share|improve this answer

You must log in to answer this question.