running out of disk space on root partition? here's how...
Posted: Mon Mar 14, 2011 1:07 pm
running out of space on your root partition? ruby not starting etc? a quick df -h shows 100% use on /?
simply add a new physical hard drive or extend your virtual drive and:
1. let's call the new drive /dev/sdc or if virtually extending your drive sdc1 (as i did)
2. fdisk /dev/sdc
3. n for new partition and go through all the defaults to use all the new space
4. w for write the partition table and reboot
5. fdisk -l to show your new partition (hopefully it's there!)
6. mkfs.ext3 /dev/sdc1 to make a ext3 file system on the new partition
7. pvcreate /dev/sdc1 to get the partition initialised
8. vgextend vg_hda /dev/sdc1 to add it to vg_hda (amahi's default lvm group)
9. lvextend -L +20G /dev/mapper/vg_hda-lv_root to add a 20gig disk. If you get errors here about not enough extents etc, just reduce the size gradually eg 18G until it fits.
10. resize2fs /dev/mapper/vg_hda-lv_root to resize the file system
11. do a reboot
12. do a df -h to see the new size on /
the above will work on a new disk or if you have any free space on another partition. simples!!
simply add a new physical hard drive or extend your virtual drive and:
1. let's call the new drive /dev/sdc or if virtually extending your drive sdc1 (as i did)
2. fdisk /dev/sdc
3. n for new partition and go through all the defaults to use all the new space
4. w for write the partition table and reboot
5. fdisk -l to show your new partition (hopefully it's there!)
6. mkfs.ext3 /dev/sdc1 to make a ext3 file system on the new partition
7. pvcreate /dev/sdc1 to get the partition initialised
8. vgextend vg_hda /dev/sdc1 to add it to vg_hda (amahi's default lvm group)
9. lvextend -L +20G /dev/mapper/vg_hda-lv_root to add a 20gig disk. If you get errors here about not enough extents etc, just reduce the size gradually eg 18G until it fits.
10. resize2fs /dev/mapper/vg_hda-lv_root to resize the file system
11. do a reboot
12. do a df -h to see the new size on /
the above will work on a new disk or if you have any free space on another partition. simples!!