Expand the ubuntu system under the dual system

    Since I didn't understand anything when I installed the ubuntu system at first, the space allocated to ubuntu from the windiws system was very small, resulting in insufficient disk capacity for the ubuntu system. So it took 3 or 4 hours to complete the expansion of the ubuntu system. Now document the solution. The main idea is to mount an additional disk under ubuntu, and this additional disk is allocated from the windows system.

1. First separate the blank disk area from the windows system

    Enter the windows system, press the Windows+X key or right-click the start button, and then click "Disk Management" to enter the disk management page. Then select a disk that you don’t like (a disk with a relatively large capacity), right-click to select the compressed volume, and select the appropriate size for compression, as shown below: Then, right-click the blank volume that was just compressed to create a new simple volume. Select the NTFS format for the system file type.

2. Switch back to the ubuntu system

    If you encounter the problem of not being able to boot when you switch to the Ubuntu system, it may be that the disk space just separated under the windows system causes the boot page grub to fail to find the disk directory where the system is located. You need to manually enter the disk location to start the system. For details, refer to the following link :

Grub error: unknown filesystem solution_Linux Tutorial_Linux Commune-Linux System Portal Website

 2.1 Open the terminal and check the disk mount status

    You can enter the following code to find the name of the newly created disk in the windows system:

 lsblk //或者df -h 

The disk I added is shown in the picture below. Remember the disk name, it will be used later.

 2.2 Create a new directory for mounting disks

sudo mkdir /home/rxz/pan1  //其中rxz是自己ubuntu系统的用户名,pan1是挂载点名称

2.3 Format disk

     The format of the disk created under the windows system is NTFS format, but it needs to be changed to ext4 format in the ubuntu system. So use the following code, where nvme0n1p4 is the newly created disk name:

sudo mkfs.ext4 /dev/nvme0n1p4

2.4 Temporary mount

        Temporarily mount the disk on the pan1 mount point, the name can be determined by yourself.

sudo mount /dev/nvme0n1p4 /home/rxz/pan1

2.5 View the disk format to be mounted

sudo blkid /dev/nvme0n1p4

   The UUID (Universally Unique IDentifier) ​​of the disk will be obtained, which is the marking code of the disk, similar to a person's ID card, like mine here: UUID=b40a8108-1cd7-4f1e-8bf6-474d4ed12498.

2.6 Realize persistent mounting of disk

    Step 4 is only for temporary mounting. If you only get to step 4, you need to remount after re-entering the ubuntu system every time. Therefore, for persistent mounting, after getting the UUID of the disk, use the following code to open the fstab file.

sudo gedit /etc/fstab

     After the fstab file appears, add the following code at the end of the file:

UUID=b40a8108-1cd7-4f1e-8bf6-474d4ed12498  /home/rxz/pan1 ext4  defaults 0  0

Among them, the UUID is different for everyone, fill in what you found, and then /home/rxz/pan1 is the name and address of the mount point, and then ext4 is the disk format, the penultimate number 0 means no backup, and finally A number must be 2 or 0 (unless the boot partition is 1).

As shown below:

Reference link:

(Ubuntu achieves permanent mounting of hard disks_it's so difficult to name a blog-CSDN blog_ubuntu permanently mounts hard disks

The complete process of dual system win10+ubuntu18.04 expansion

 Mount hard disk on ubuntu20.04_PolarisHuster's blog-CSDN blog_ubuntu20 mount hard disk

Guess you like

Origin blog.csdn.net/weixin_70026476/article/details/127143509
Recommended