centos7 the method to mount a disk under the cloud host system
- 2020-05-17 07:32:08
- OfStack
1. Prepare
2. Mount the disk
1.1 view the new disk
[root@cgsl ]# fdisk � l
Find the newly added disk numbered /dev/vdc
1.2 hard disk partition into fdisk mode
[root@cgsl ]# /sbin/fdisk /dev/vdc
Enter n to partition
[root@cgsl ]# Command (m for help): n
Select partition type
[root@cgsl ]# Select (default p): p
Select the number of partitions
[root@cgsl ]# Partition number (1-4, default 1): 1
1 straight enter, and finally enter q to exit.
3. Format partition format the new partition as ext3 file system
[root@cgsl ]# mkfs -t ext3 /dev/vdc
4. Mount the hard drive
1. Create the mount point and create the storage directory at the root
[root@cgsl ]# mkdir /storage
2. Mount /dev/vdc under /storage
[root@cgsl ]# mount /dev/vdc /storage
3. The newly created partition cannot be booted and mounted automatically, and the machine should be mounted manually every time it is restarted. Setting up the boot mount automatically requires modifying the /etc/fstab file
#vi /etc/fstab
Add 1 line at the end of the file /dev/vdc /storage ext3 defaults 1 2
Note that to query 1 for your own hard disk format, use df-T.