Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have Debian Lenny inside a Virtual Machine (vmware) and I need increase the space of / to continue the upgrade to Squeeze.

Can I increase the size of "/"? I got another disk with 250GB. What's the best solution? Thank you for taking your time with me.

df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1             327M  291M   20M  94% /
tmpfs                 4.0G     0  4.0G   0% /lib/init/rw
udev                   10M   76K   10M   1% /dev
tmpfs                 4.0G     0  4.0G   0% /dev/shm
/dev/sda9             4.7G  138M  4.3G   4% /home
/dev/sda7             373M   11M  343M   3% /tmp
/dev/sda5             4.6G  848M  3.6G  20% /usr
/dev/sda8              23G   15G  7.3G  66% /var

fdisk -l

Disk /dev/sda: 248.6 GB, 248617369600 bytes
255 heads, 63 sectors/track, 30226 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: 0x0005199d

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          43      345366   83  Linux
/dev/sda2              44        5221    41592285    5  Extended
/dev/sda5              44         651     4883728+  83  Linux
/dev/sda6            1017        1568     4433908+  82  Linux swap / Solaris
/dev/sda7            1569        1617      393561   83  Linux
/dev/sda8            1618        4608    24025176   83  Linux
/dev/sda9            4609        5221     4923891   83  Linux

Disk /dev/sdb: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 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: 0x35532143

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       32635   262140606   8e  Linux LVM

Mount

/dev/sda1 on / type ext3 (rw,errors=remount-ro)
tmpfs on /dev type tmpfs (rw,size=10M,mode=0755)
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)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda9 on /home type ext3 (rw)
/dev/sda7 on /tmp type ext3 (rw)
/dev/sda5 on /usr type ext3 (rw)
/dev/sda8 on /var type ext3 (rw)

And fstab

proc            /proc           proc    defaults        0       0
/dev/sda1       /               ext3    errors=remount-ro 0       1
/dev/sda9       /home           ext3    defaults        0       2
/dev/sda7       /tmp            ext3    defaults        0       2
/dev/sda5       /usr            ext3    defaults        0       2
/dev/sda8       /var            ext3    defaults        0       2
/dev/sda6       none            swap    sw              0       0
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0
share|improve this question
1  
If you are inside a VM, then it sure seems like it would be trivial to simply create a nice big virtual disk create one nice big partition, and then transfer everything over to the new disk, and then disconnect the small disk. –  Zoredache Jul 11 '12 at 23:57
    
This is why friends don't let friends use raw partitions... –  womble Jul 12 '12 at 3:27
add comment

1 Answer

up vote 1 down vote accepted

Your current partition layout seems to be rather silly, so the best thing to do is to backup, and reinstall.

Having separate volumes for /usr, /var, /home, and /tmp is silly because now you have plenty of space in those volumes, but not in the one where you need it. Reallocating that space is difficult to impossible without LVM, and still an unnecessary bother with LVM.

Had you originally setup the system with LVM, you could easily extend the root partition. Since you aren't using LVM, you will need to use gparted to shrink sda5 and move it to the right, then drag the start of sda2 to the right, freeing up space to expand sda1 into. This process is both time consuming, and dangerous, since if it is interrupted for any reason, your partition will be corrupted.

share|improve this answer
    
Debian Lenny apparently recommended this partition configuration by default, and you have to jump through hoops to do anything more sane. Squeeze fixed this problem. –  Michael Hampton Jul 12 '12 at 3:38
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.