How to mount a hard disk in centos?

coldplay.xixi
Release: 2020-07-28 13:46:36
Original
11578 people have browsed it

How to mount a hard disk in centos: first check the currently unmounted hard disk and create a hard disk partition; then format the hard disk and create a mounting directory; then mount the hard disk and set it to be automatically mounted at boot; Finally, restart the server.

How to mount a hard disk in centos?

How to mount a hard disk in centos:

1. Check the currently unmounted hard disk

# fdisk -l
Copy after login

How to mount a hard disk in centos?

2. Create a hard disk partition

# fdisk /dev/sdb
Copy after login

How to mount a hard disk in centos?

According to the prompts, enter "n", "p" and "1" in sequence. Enter "wq" the next time, and the partitioning will begin and will be completed soon.

3. Format the hard disk

# mkfs.ext4 /dev/sdb
Copy after login

How to mount a hard disk in centos?

4. Create a mounting directory

# mkdir /data
Copy after login

5. Mount the hard disk

# mount /dev/sdb /data
Copy after login

6. Set up automatic mounting at boot

# vi /etc/fstab
Copy after login

Enter i in vi to enter INERT mode, move the cursor to the end of the file and press Enter, copy/paste the following content, then press the Esc key and enter ":wq" (without double quotes) save and exit

/dev/sdb    /data    ext4    defaults    0 0
Copy after login

7. Restart the server

# shutdown -r now
Copy after login

Recommended related tutorials: centos tutorial

The above is the detailed content of How to mount a hard disk in centos?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template