Format the New Hard Disk in CentOS and set automatic mounting upon startup
A new hard disk is added to the server, and only one sdb device can be seen under/dev.
As a result, you need to partition, create a file system, and set automatic mounting upon startup. The procedure is as follows:
1. Create a partition
Partition using the parted command:
[Plain] view plaincopy
- # Parted/dev/sdb
- (Parted) mktablegpt
- (Parted) mkpartdata1024KiB-1
- (Partedprint)
The parameter after parted is the device name. The three parameters of the mkpart command are the partition name (starting at will), the start address, and the end address (-1 indicates the end of the block device). The space in front may be used to store partition information, if you do not leave it, you will receive a warning. Print to view the partition result 2. format the partition
After the partition is created, the/dev/sdb1 partition appears. Use the mkfs command to format the partition:
[Plain] view plaincopy
- # Mkfs/dev/sdb1ext4
3. Set boot mounting
Modify the/etc/fstab file and add a line at the end:
[Plain] view plaincopy
- /Dev/sdb1/dataext4defaults00
Each field is a partition, a mount point, a file format, and a mount parameter. The last two generally use 0.
[Please specify the source for reference at http://blog.csdn.net/bhq2010/article/details/9238997]
Restart to check whether the configuration is successful.