Welcome: Hunan Intelligent Applications Tecgnology CO.,ltd.-HNIAT.com
Language: Chinese ∷  English

Basic knowledge

How to add a hard disk and mount a hard disk in CentOS7

Today, NetShield Technology shares a piece of dry goods for you, about how to add hard disks and mount hard disks in CentOS7, not much to say, friends in need hurry up and collect them!

This article only applies to partitioning a data disk up to 2 TB using the fdisk command. If the data disk that needs to be partitioned is larger than 2 TB and centos is installed on the server, usually the Linux system partition defaults to 3 partitions, the main partition is up to 4, and the others can be mounted according to their own needs.

/ root partition, usually around 10-100G (according to the total disk size)

/boot system operating partition (100-500MB is enough)

/swap virtual memory temporary storage partition (usually 2 times the memory, it will vary according to the habit of installing the system)


1. First check the unassigned partition names, some are different, mine are /dev/sda and /dev/sdb, sda is the system partition, and sdb is the storage data partition.

[root@huoshi-111 ~]# fdisk -l

This disk needs to be mounted here


2. Create hard disk partitions


3. The partition is completed. Enter fdisk -l to view information


4. Format the partition

[root@huoshi-111 ~]# mkfs.ext4 /dev/sdb1

5. Create a mount directory

[root@huoshi-111 ~]# mkdir /data

6. Mount partition

[root@huoshi-111 ~]# mount /dev/sdb1 /data

7. Set up automatic mount at startup

[root@huoshi-111 ~]# echo /dev/sdb1 /data ext4 defaults 0 0 >> /etc/fstab

8. Confirm whether the mount is successful

# reboot system

[root@huoshi-111 ~]# reboot


After the above explanation, I believe that everyone has a basic understanding of how to add and mount hard disks in CentOS7. If you want to know more comprehensive content, please pay attention to NetShield Technology. NetShield Technology has been focusing on Internet IDC services for 15 years. You can find the server knowledge you want in NetShield Technology!

CONTACT US

Contact: Manager Xu

Phone: 13907330718

Tel: 0731-22222718

Email: hniatcom@163.com

Add: Room 603, 6th Floor, Shifting Room, No. 2, Orbit Zhigu, No. 79 Liancheng Road, Shifeng District, Zhuzhou City, Hunan Province

Scan the qr codeClose
the qr code