CentOs how to mount a hard disk (taught you)

First, re-mount the hard disk read-write:

mount -o remount, rw /  

Second, the remote SSH to log on after Centos server, proceed as follows

Reminder: mount operation will clear the data, make sure that no data or mount disk unused

The first step: List all disk    command:

 ll /dev/disk/by-path

Tip: If you can not confirm the data disk device names, use the df command to verify the name of the system disk, thus excluding cases linked to the wrong disk.

 

Step two: format the hard disk       commands:

fdisk /dev/sdb

Note: The arrows mark at the continued manually typed

 

Step 3: Create Partition         command:

 

mkfs.ext4 /dev/sdb1

 

Step Four: Mount the partition          command:

1 mkdir /data 
2 mount /dev/sdb1 /data 

The sdb mount the hard drive become / data

 

 

Step five: to write information fstab, the system is turned on automatically mounted. command:

 echo "/dev/sdb1               /data                   ext4    defaults        0 0" >> /etc/fstab 

 

Amway a good resource sharing platform: quick access

Guess you like

Origin www.cnblogs.com/alex96/p/12162906.html