How to expand disk space in Debian?

To expand the disk space of a Debian system, you can follow these steps:

  1. Add a new hard drive or expand the existing disk space on a virtual machine or physical machine.
  2. Run the command “fdisk -l” to view information about all disks and partitions, locate the disk and its partition that needs to be extended.
  3. Run the command “parted /dev/sdX” to adjust the size of the partition (where /dev/sdX is the disk that needs to be extended). Use the command “resizepart” to expand the partition.
  4. Execute the command resize2fs /dev/sdXY to enlarge the file system (where /dev/sdXY is the partition that needs to be extended).
  5. Finally, run the command “df -h” to check the disk space usage and ensure that the disk space has been successfully expanded.

Please be careful when following these steps, make sure to back up important data in case of unexpected situations.

bannerAds