Ubuntu 2204 uses commands to expand the system disk

1. First add the disk space in the virtual machine to the size you need.

2. View current disk information

fdisk -l

Note: Use the parted -l command to solve the partition table problem in the red part.

3. Use the parted command to expand /dev/sda3

parted /dev/sda

unit s (set Size unit)

p free (view disk details)

resizepart 3 (expand the third disk)

Yes (the partition is in use, confirm whether to continue)

125829086s (the size value to which the disk needs to be expanded)

q (exit disk partition mode)

4. Use the resize2fs /dev/sda3 command to update the capacity of disk 3.

5. Use the df -h or fdisk -l command to check the disk status.

Okay, let’s call it a day.

おすすめ

転載: blog.csdn.net/ynstxx/article/details/129068856