Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

System

  • Debian 6 / 32 bit
  • VSphere

Goal

Resize main partition to utilize all resources now available.

Issue

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

Troubleshooting

fstab

# <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

mount

/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 stackoverflow.com 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

2 Answers 2

Try with parted or some its derivative...

share|improve this answer
3  
Can you possibly expand your answer? –  Canadian Luke Jan 9 '13 at 23:07

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 unix.stackexchange.com 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.