1. View current drive usage: [email protected]_node1 ~]# df-hfilesystem Size used Avail use% mounted on/dev/mapper/volgroup- Lv_root 35G 25G 8.3G 76%/tmpfs 1.9G 0 1.9G 0%/dev/shm/dev/sda1 485M 35M 425M 8%/boot/dev/mapper/volgroup-lv_home 33G 176M 31G 1%/home 2. View New Hard Drive
#fdisk –l
The newly added hard drive is numbered/dev/sdb
3.Hard disk Partitioning
1) Enter Fdisk mode
#/sbin/fdisk/dev/sdb
2) enter N to partition
3) Select the partition type
Here are two options:
? P: Primary partition can have a maximum of 4 main partitions on Linux
? E: There can be only 1 extended partitions on the extended partition Linux, the extended partition cannot be used directly after creation, and the logical partition on the extended partition will be created.
Here I choose the P.
4) Select the number of partitions
can choose 4 partitions, here I only divided into 1 partitions
5) Set the cylinder, select the default value here to
6) Enter W, write to partition table, partition
4. Formatting partitions
Format the new partition as a ext3 file system
1) If you are creating a primary partition
#mkfs-T EXT3/DEV/SDB1
5. Mount the hard drive
1) Create mount point
Create the storage directory under the root directory
#mkdir/storage
2) mount the/DEV/SDB1 to the/storage
#mount/dev/sdb1/storage
6. Set up auto mount on boot
The newly created partition cannot be mounted automatically and will be mounted manually each time the machine is restarted.
Set boot auto mount requires modification of/etc/fstab file
#vi/etc/fstab
Add a line at the end of the file
/dev/sdb5/storage ext3 Defaults 1 2
CentOS Mount New Hard Drive