The whole process of Ubuntu22.04 Linux disk expansion/hard disk expansion (including stepping on the pit process)

Table of contents

1. Setting before booting: extension (no pit)

2. Setup after startup: partition management

1. (There are pitfalls) I want to manage partitions through gparted

2. (There are pitfalls) I want to modify the disk through the sudo fdisk /dev/sda command.

3. Effective practices.


1. Setting before booting: extension (no pit)

The virtual machine shuts down. Open the virtual machine settings.

 

 

2. Setup after startup: partition management

Notice! ! ! 1 and 2 are pits! ! ! Watch 3 directly without pitfalls! ! !

1. (There are pitfalls) I want to manage partitions through gparted

Download the gparted tool

Download failed, unable to acquire lock.

Solve it by the following method. (The commands in the following three pictures are performed sequentially.)

 There is a little mistake in the middle (maybe it is because the -a suffix is ​​typed into -aaa? I don’t understand, can you answer it, thank you very much.)

 It finally downloaded correctly.

  Open gparted  via  sudo gparted .

 Tried to resize but failed.

2. (There are pitfalls) I want to modify the disk through  the sudo fdisk /dev/sda   command.

The purpose is to expand 20G into 40G.

 Modification process:

 

Shut down and restart.

However:

 There is also an abnormal state in gparted. (The picture shows the normal state later, and the red letter is the abnormal state at that time.)

3. Effective practices.

Open the disk in the virtual machine.

 

 Finish.

 gparted back to normal:

 df -h also shows that sda3 has become about 40G.

Note: The above is executed sequentially, and the system has not crashed, so if anyone is interested in 1 and 2, you can also try it hahaha, after all, it seems that there are also methods 1 and 2 that have been used successfully. 

Guess you like

Origin blog.csdn.net/weixin_48488858/article/details/130294554