Step 1: Create a directory
Mkdir /uardata1 mkdir /uardata2 mkdir /uardata3 mkdir /uardata4 mkdir /uardata5 mkdir /uardata6 mkdir /uardata7 mkdir /uardata8 mkdir /uardata9 mkdir /uardata10Copy the code
Step 2: Create a partition
echo 'y'|mkfs.ext4 /dev/sdb &
echo 'y'|mkfs.ext4 /dev/sdc &
echo 'y'|mkfs.ext4 /dev/sdd &
echo 'y'|mkfs.ext4 /dev/sde &
echo 'y'|mkfs.ext4 /dev/sdf &
echo 'y'|mkfs.ext4 /dev/sdg &
echo 'y'|mkfs.ext4 /dev/sdh &
echo 'y'|mkfs.ext4 /dev/sdi &
echo 'y'|mkfs.ext4 /dev/sdj &
echo 'y'|mkfs.ext4 /dev/sdk &
Copy the code
Step 3: Mount the partition
Note: Mount \ only after partition is complete
Mount: mount /dev/sdb /uardata1 mount /dev/sdc /uardata2 mount /dev/sdd /uardata3 mount /dev/sde /uardata4 mount /dev/sdf /uardata5 mount /dev/sdg /uardata6 mount /dev/sdh /uardata7 mount /dev/sdi /uardata8 mount /dev/sdj /uardata9 mount /dev/sdk /uardata10Copy the code
Step 4:
Edit /etc/fstab /dev/sdb/uardata1 ext4 defaults 1 2 /dev/sdc /uardata2 ext4 defaults 1 2 /dev/sdd /uardata3 ext4 defaults 1 2 /dev/sde /uardata4 ext4 defaults 1 2 /dev/sdf /uardata5 ext4 defaults 1 2 /dev/sdg /uardata6 ext4 defaults 1 2 /dev/sdh /uardata7 ext4 defaults 1 2 /dev/sdi /uardata8 ext4 defaults 1 2 /dev/sdj /uardata9 ext4 defaults 1 2 /dev/sdk /uardata10 ext4 defaults 1 2Copy the code
Fault: If a hard disk of a server is faulty and needs to be replaced, the partition corresponding to the hard disk must be replaced in the/etc/fstab
Comment it out, otherwise the server cannot be started
Symptom: The system fails to start, and all files become readable and cannot be modified.
Solutions:
- Enter root single-user mode and mount the system as writable.
mount -o w /
Copy the code
Second, the Linux MKFS
Command: MKFS User permission: superuser MKFS [-v] [-t fstype] [fs-options] filesys [blocks] [-l Lable] For example, /dev/sda1 -v: specifies the detailed display mode. -t: specifies the file system type. The default value for Linux is ext2 -c. -l bad_blocks_file: adds the block data with a bad rail to the bad_blocks_file. Block: specifies the size of the block. -l: creates a LableCopy the code
2.2 Format file types
[root@chb CHB]# mkfs.ext3 /dev/sda6 note: Format the device as an ext3 filesystem [root@chb CHB]# mkfs.ext4 /dev/sda6 note: Format the device as an ext3 filesystem [root@chb CHB]# mkfs.ext4 /dev/sda6 note: Format the device as an ext4 file system [root@chb CHB]# mke2fs -j /dev/sda6 Note: Format the device as an ext3 file system [root@chb CHB]# mkfs.ext2 /dev/sda6 Note: Format the device as an ext2 file system [root@chb CHB]# mke2fs /dev/sda6 Format the device as reiserfs filesystem [root@chb CHB]# mkfs.vfat /dev/sda6 Note: Format the device as fat32 filesystem [root@chb CHB]# mkfs.msdos /dev/sda6 Note: Format the device as fat32 filesystem [root@chb CHB]# mkfs.msdos /dev/sda6 note: Format the device as fat32 filesystem [root@chb CHB]# mkfs.msdos /dev/sda6 note: Format the device as a FAT16 file system, which is the MSDOS file system; [root@chb CHB]# mkdosfs /dev/sda6 Note: Format the device as fat16 file system, same as mkfs.msdosCopy the code