Three types of HDD management:
Add a disk three steps:
1. Add disk 1.1 basic disk
The virtual machine manually adds a hard drive of 1 blocks of 4G size and requires a reboot for the experiment:
Fdisk-l List all hard drive names and locations on the system (including new drives)
FDISK/DEV/SDB//planning for the newly added SDB drive
Enter interaction after execution: Follow the prompts to divide
Common directives in Fdisk interactive mode
M: View the Help information for the operation instructions
P: List View partition information
N: New Partition
D: Delete partition
T: Change the partition type
W: Save partition settings and exit
Q: Discard partition settings and exit
1.2LVM logical Volumes
PV-VG-LV according to this division
PVCREATE/DEV/SDB/DEV/SDC//Convert physical hard disk B, c to physical volume
Pvremove/dev/sdb//Removing PV
Pvscan//View scan PV
Vgcreate VG01/DEV/SDB/DEV/SDC//Add PV to the volume group vg01
Vgextend VG01/DEV/SDD//volume group VG01 expansion, adding new PV
Vgremove vg01//removal of VG
Vgscan//View VG
Lvcreate-l 1g-n lv01vg01//Divide the 1g size lv01 from the volume group vg01
Lvextend-l +1g/dev/vg01/lv01//LV01 Expansion 1G (obtained from VG01)
LVREMOVE/DEV/VG01/LV01//removing LV01
Lvscan//View LV
1.3RAID
Generally hardware RAID, need to enter the BIOS settings;
Several raid comparisons:
Soft raid: (less used)
Mdadm-cv/dev/md0-a YES-N4-L5-X1/DEV/SD[BCDE]
Create a soft raid based on SDB, C, D, name md0,4 block hard disk, RAID5 type, 1 hot spares
2. Formatting
The above 3 methods divide the disk and then format
MKFS.XFS/DEV/VG01/LV01 to format logical volumes LV01 (XFS format)
MKSWAP/DEV/SDC Swap partition (virtual memory) formatting for a disk
3. Mounting
MOUNT/DEV/VG01/LV01/LV01//Mount the LV01 to the LV01 directory
Vi/etc/fstab Auto Mount
1. Device Name 2. mount point 3. File type 4. Mount parameter 5. Whether dump backup 6. Disk Check Order
Linux System Management-Disk Management