Extend second hard drive on Debian system

There are plenty of guides out there describing how to extend or increase the disk space of a second hard drive on a Debian system. Many of them are to complexe and some of them simply don’t works.

After some long struggles, I’ve come up with a few simple steps that I got working on every modern Debian and Ubuntu system out of the box. It might not be the case for you, but I thought it would be nice to share it anyway. Hope it will help someone!

  1. For virtual systems, increase the disk size in the hypervizor
  2. Reboot the server
  3. Stop any services that uses the disk and unmount it (umount /path/to/mount)
  4. Run parted /dev/sdb (where b is the drive letter)
  5. Run resizepart -> Type 1 (where 1 is the parition number) -> Type correct disk size -> Hit Ctrl + C
  6. Unmount the disk again (same as in step 3)
  7. Run e2fsck -f /dev/sdb1 (where b is the drive letter and 1 is the parition number)
  8. Run resize2fs /dev/sdb1 (where b is the drive letter and 1 is the parition number)
  9. Reboot the server

Hint
Type fdisk -l and/or df -h to find out drive letters, partition numbers, mount paths, disk size etc.

Leave a Reply

Your email address will not be published. Required fields are marked *