Linux System Management-Disk Management

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.