Last update at :2024-07-03,Edit by888u
I helped an online friend mount a disk on CentOS 7.9, only to realize that I have never mounted a single 4TB disk before. After all, I mostly play VPS, and I don’t need such a large disk. The machine has 1TB+4TB by default. , a 1TB disk was used to install the system, and now it is necessary to hang 4TB in /home as a data disk. After running fdisk, I found that it is only 2TB... because the fdisk tool can only create a maximum partition of 2TB. If it exceeds 2TB, you need to use the parted tool to record It will be convenient for you to use ctrl+c next time you do it.
As you can see in the picture below, we have used fdisk to mount before. It is only 2TB. We first cancel the mount and then use the parted tool to re-create the partition.
Following steps:
[root@localhost/]#parted /dev/sdb #Select the hard disk (parted)mklabel gpt #Convert gpt partition (parted)mkpart primary 1 -1 #Divided into a zone (parted)print #View partition status (parted)q #Exit ***The following steps are the same as fdisk partition**** [root@localhost/]#lsblk #View partitions [root@localhost/]#mkfs.ext4 /dev/sdb1 #Format the disk to ext4 [root@localhost/]#mount /dev/sdb1 /home #Mount to /home [root@localhost/]#vi /etc/fstab #Mount automatically at boot, add the following content /dev/sdb1 /home ext4 defaults 0 0 Or directly: echo "/dev/sdb1 /home ext4 defaults 0 0">> /etc/fstab
Recommended site searches: space rental, Korean cn2 server, view ip, me domain name registration, overseas virtual host space, proxy ip, registration-free cdn in mainland China, exclusive host, free ip proxy server, free website application domain name, < /p>
发表评论