Windows+Ubuntu dual system, expansion of Ubuntu system

preamble

Since I didn't notice the space problem when I first started learning, now I run a data set of more than 100 G, and I don't want to destroy the already configured environment, so I have to expand the capacity! The following is a detailed record of Windows compressed space and expansion to Ubuntu system.

Separate a blank disk in Windows system

There are many ways to obtain space, and the commonly used ones are [a, b], as follows:

  • You can format a disk of the Win10 system as [NTFS] for distribution to Ubuntu;
  • You can also use the disk management tool of Win10 to compress XX G space from a larger hard disk for
    use by Ubuntu, specifically: right-click [Computer] -> [Management], and jump to the location as shown below;
  • It is worth noting that the disk space is guaranteed to be in NTFS format, and do not use [Delete Volume] to get an empty disk (this way, the empty disk cannot be recognized after entering the Ubuntu system).
    insert image description here
    compressed volume

insert image description here
Right-click the blank volume just compressed to create a new simple volume. System file type select NTFS format
insert image description here
insert image description here

Ubuntu gets the space just created

To restart the computer and enter the Ubuntu system, you need to obtain the disk space divided from Win10. The specific steps are as follows:

1. First enter the following command to find the blank disk space created by the win system

lsblk   // 或者输入: df -ls

Note: df -ls may not find

insert image description here

2. Create a new directory for mounting on disk

sudo mkdir /home/chm/pan1  //其中chm是个人的用户名,pan1为挂载点名称

3. Format the disk

The format of the disk created under the Windows system is NTFS, but it needs to be changed to ext4 format under the Ubuntu system. So enter the following command:

sudo mkfs -t ext4 /dev/nvme0n1p6   //其中nvme0n1p6是新创建的磁盘名称

4. View the disk format to be mounted

sudo blkid /dev/nvme0n1p6

Get the tag code UUID of the disk: 31fc6c94-2017-4deb-a0d9-c545db20e054
insert image description here

5. Realize permanent mount
Input command:

sudo gedit /etc/fstab

6. Then the fstab file appears, write the UUID into the file, and add the following code at the end of the file:

UUID=31fc6c94-2017-4deb-a0d9-c545db20e054 /home/chm/pan1 ext4 defaults 0 0

insert image description here
Save and exit, so far, permanently hang on completion.

7. Execute the following command to ensure file permissions:

sudo chmod 777 /home/chm/pan1    // 每个人都有读和写以及执行的权限

insert image description here

Guess you like

Origin blog.csdn.net/weixin_45080292/article/details/129405764