Ubuntu adds a new hard disk: partition, mount to specified directory, change permissions

Summary:

There are currently many tutorials on adding new hard disks to Ubuntu on the Internet, but they are quite messy. Many of them use terminal commands to perform partitioning and other operations, which are not friendly to students who are not familiar with related commands. This article introduces a simpler and more intuitive way to partition and mount. Tutorial, make full use of the "Disk" tool that comes with the Ubuntu system, and the "GParted" (requires additional installation) two tools to partition a new hard disk;

introduce:

  • System Ubuntu18.04 LTS 

Mounting and partitioning:

1. Install your own hard drive; and install the GParted tool.

 sudo apt-get install gparted

 2. Under normal circumstances, the hard disk will be automatically mounted under media. First, use the built-in "Disk" tool and click "Square" to stop mounting it:

3. Open GParted, select the newly added hard disk in the upper right corner, then right-click on the box and click Delete

4. After deleting, right-click on the box->New

5. Use all the memory size to create an extended partition

6. In the "Unallocated" row below, right-click -> New, you can add a logical partition of the size you want.

 7. I created two logical partitions, and then clicked the check mark to apply the operation

 8. Terminal input

sudo  gedit /etc/fstab

9. Imitate the sentence patterns inside and add the corresponding sentences below. The UUID here can be seen from the "Disk" tool

The second field is the directory you want to mount. Just choose 0 for the last number, which means that the disk will not be checked at startup. Click to save the file. For other specific parameter meanings, please refer here .

10. In the "Disk" tool, click the corresponding partition and click the triangle to automatically mount it to the directory you want.

 Unlock

If it is mounted under /home/test as above, the folder is not locked, but if it is mounted under your own user such as /home/username/test, there will be a lock mark.

1. Terminal input (the specific path of the folder inside must be changed according to your own)

sudo chmod -R 777 /home/wgk/test    #改权限

sudo chgrp wgk /home/wgk/test       #改所属的组

sudo chown wgk /home/wgk/test       #改所有者

2. Restart, right-click the folder properties -> Permissions, and you will find that it is the same as other ordinary folders (but the folder name cannot be changed)

Guess you like

Origin blog.csdn.net/u012057432/article/details/107784262