Home >System Tutorial >LINUX >How to mount a hard drive under a GPT partition in Ubuntu 16.04?

How to mount a hard drive under a GPT partition in Ubuntu 16.04?

王林
王林forward
2024-01-02 12:28:071443browse

Record the method of using GTP to partition the hard disk and mount the hard disk in Ubuntu 16.04. Generally speaking, the hard disk mounted on the server is relatively large. Traditionally, partitioning the hard disk requires typing sudo fdisk on the terminal. However, When the capacity of the mounted hard disk is greater than 2T, it cannot be partitioned through sudo fdisk. At this time, GPT must be used for partitioning and set to boot. The operation method is as follows (enlarge More clearly~):
在Ubuntu 16.04下使用GPT分区并挂载硬盘
Run sudo fdisk -l to check which installation disks are plugged into the machine. You can see /dev/sda and no partitioning has been done.
It is not mounted at this time. Run the following command:

sudo parted /dev/sda #进入parted
mklabel gpt #将磁盘设置为gpt格式,
mkpart logical 0 -1 #将磁盘所有的容量设置为GPT格式
print #查看分区结果

At this time, a /dev/sda1 partition should be divided by default. At this time, run sudo mkfs.ext4 -F /dev/sda1 to format the sda1 just separated into the ext4 format, and then you can set it. It is automatically mounted on boot.

sudo vim /etc/fstab

Then add /dev/sda1 /home/anaconda/Shi ext4 defaults 0 0 at the end of the file, and then use sudo mount -a to remount

The above is the detailed content of How to mount a hard drive under a GPT partition in Ubuntu 16.04?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:linuxprobe.com. If there is any infringement, please contact admin@php.cn delete