Disk management
Disk free (df)
Displaying all filesystems and their disk usage in human-readable form can be done through
the df
utility:
df --human
To check what type of file system you are using use the -T
flag as follows:
df -T
To get a good description divided in Megabyte and Gygabyte:
sudo du -cha --max-depth=2 / | grep -E "M|G"
Disk usage (du)
Instead to estimate and summarize file and directory space usage,
use the disk usage du
utility as follows:
du -hT
A common usage of the du
utility is to check the root directory usage as follows:
du -h --max-depth=1 / | sort -n
Enlarge the disk volume
If allocated a new disk, run the following command to list all storage devices in a tree-like format:
lsblk
To enlarge a current disk perform the following commands:
sudo growpart /dev/nvme0n1 1
lsblk
Extended the file system
The commands to extend the file system differ depending on the file system type. For XFS file system usd
sudo xfs_growfs -d /
For Ext4 file system use the correspective:
sudo resize2fs /dev/<nvme0n1p...>