A simple tutorial on mounting a hard disk under Linux

888u

Last update at :2024-05-17,Edit by888u

There are many VPS or independent servers with multiple hard drives. For example, it is very common to separate the system disk and data disk. Here we will briefly introduce how to hang the new hard disk on the system.

The specific operation is divided into three steps:

1) The disk needs to be formatted

2) Format and mount to the required mount point

3) Finally, you need to add a partition boot table so that it can be mounted randomly and automatically next time the system starts.

The detailed graphic tutorial is as follows: 1. First, check the disk information in the system. The command is: fdisk -l. After input, it is displayed: "Disk /dev/vda: 21.5 GB", which is the system disk and the name is vda. In addition There is another disk that is not formatted, has no partitions (Disk /dev/vdb doesn't contain a valid partition table), and is not in use: "Disk /dev/vdb: 32.2 GB", 1. Check whether there is a data disk: fdisk -l (l is the lower case of the English letter "L") 2. After confirming that there is a data disk, enter the command: mkfs.ext3 /dev/vdb to format the data disk.

Then the starting command is: cd . . : mount /dev/vdb /www/ (Create a custom folder name in the root directory, I wrote WWW) : echo ‘/dev/vdb /www ext3 defaults 0 0’ >>/etc/fstab (Write the command to automatically mount the disk when the system starts. At this point, the data disk has been mounted) :df -lh (check whether the data disk is successful)

Recommended site search: server space rental US attack-proof server, external network IP query, server overseas, registration-free space free network, agent registration, Korean server rental, free cloud server, foreign space, registered domain name query,

A simple tutorial on mounting a hard disk under Linux

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码