zoukankan      html  css  js  c++  java
  • CentOS7.6中raid5的搭建与测试

    以下过程记录是关于raid5的搭建与测试,主要内容:
    一、添加硬盘;
    二、对磁盘进行初始化设置;
    三、搭建raid5;
    四、raid5的测试;
    五、raid5的维护;
    六、mdadm命令总结。

    Last login: Mon Apr 1 10:09:16 2019
    [root@vmhzp-raid5 ~]# fdisk -l

    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x741b59c1

    Device Boot Start End Blocks Id System
    /dev/sda1 * 128 2097279 1048576 83 Linux

    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x4821b046

    Device Boot Start End Blocks Id System
    /dev/sdb1 128 10485887 5242880 8e Linux LVM

    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/mapper/centos-root: 4718 MB, 4718592000 bytes, 9216000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/mapper/centos-swap: 645 MB, 645922816 bytes, 1261568 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes

    [root@vmhzp-raid5 ~]# ls /dev/sd*
    /dev/sda /dev/sdb /dev/sdc /dev/sde
    /dev/sda1 /dev/sdb1 /dev/sdd /dev/sdf
    [root@vmhzp-raid5 ~]# fdisk -l | grep sd
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    [root@vmhzp-raid5 ~]# fdisk -l | grep sd
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    [root@vmhzp-raid5 ~]# fdisk /dev/sdc
    Welcome to fdisk (util-linux 2.23.2).

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0x6a318f0c.

    Command (m for help): m
    Command action
    a toggle a bootable flag
    b edit bsd disklabel
    c toggle the dos compatibility flag
    d delete a partition
    g create a new empty GPT partition table
    G create an IRIX (SGI) partition table
    l list known partition types
    m print this menu
    n add a new partition
    o create a new empty DOS partition table
    p print the partition table
    q quit without saving changes
    s create a new empty Sun disklabel
    t change a partition's system id
    u change display/entry units
    v verify the partition table
    w write table to disk and exit
    x extra functionality (experts only)

    Command (m for help): n
    Partition type:
    p primary (0 primary, 0 extended, 4 free)
    e extended
    Select (default p):
    Using default response p
    Partition number (1-4, default 1):
    First sector (2048-2097151, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
    Using default value 2097151
    Partition 1 of type Linux and of size 1023 MiB is set

    Command (m for help): l

    0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
    1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
    2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
    3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
    4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
    5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
    6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
    7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
    8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
    9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
    a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
    b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
    c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
    e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
    f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
    10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
    11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
    12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
    14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary
    16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
    17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
    18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
    1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
    1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
    1e Hidden W95 FAT1 80 Old Minix

    Command (m for help): fd
    f: unknown command
    Command action
    a toggle a bootable flag
    b edit bsd disklabel
    c toggle the dos compatibility flag
    d delete a partition
    g create a new empty GPT partition table
    G create an IRIX (SGI) partition table
    l list known partition types
    m print this menu
    n add a new partition
    o create a new empty DOS partition table
    p print the partition table
    q quit without saving changes
    s create a new empty Sun disklabel
    t change a partition's system id
    u change display/entry units
    v verify the partition table
    w write table to disk and exit
    x extra functionality (experts only)

    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): l

    0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
    1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
    2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
    3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
    4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
    5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
    6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
    7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
    8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
    9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
    a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
    b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
    c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
    e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
    f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
    10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
    11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
    12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
    14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary
    16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
    17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
    18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
    1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
    1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
    1e Hidden W95 FAT1 80 Old Minix
    Hex code (type L to list all codes): fd
    Changed type of partition 'Linux' to 'Linux raid autodetect'

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@vmhzp-raid5 ~]# fdisk -l | grep sdc
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect
    [root@vmhzp-raid5 ~]# fdisk -l | grep sd*
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x741b59c1
    Device Boot Start End Blocks Id System
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x4821b046
    Device Boot Start End Blocks Id System
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x6a318f0c
    Device Boot Start End Blocks Id System
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk /dev/mapper/centos-root: 4718 MB, 4718592000 bytes, 9216000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk /dev/mapper/centos-swap: 645 MB, 645922816 bytes, 1261568 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    [root@vmhzp-raid5 ~]# fdisk -l | grep sd
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    [root@vmhzp-raid5 ~]# fdisk /dev/sdd
    Welcome to fdisk (util-linux 2.23.2).

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0x2107dd6a.

    Command (m for help): m
    Command action
    a toggle a bootable flag
    b edit bsd disklabel
    c toggle the dos compatibility flag
    d delete a partition
    g create a new empty GPT partition table
    G create an IRIX (SGI) partition table
    l list known partition types
    m print this menu
    n add a new partition
    o create a new empty DOS partition table
    p print the partition table
    q quit without saving changes
    s create a new empty Sun disklabel
    t change a partition's system id
    u change display/entry units
    v verify the partition table
    w write table to disk and exit
    x extra functionality (experts only)

    Command (m for help): n
    Partition type:
    p primary (0 primary, 0 extended, 4 free)
    e extended
    Select (default p):
    Using default response p
    Partition number (1-4, default 1):
    First sector (2048-2097151, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
    Using default value 2097151
    Partition 1 of type Linux and of size 1023 MiB is set

    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): l

    0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
    1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
    2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
    3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
    4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
    5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
    6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
    7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
    8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
    9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
    a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
    b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
    c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
    e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
    f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
    10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
    11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
    12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
    14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary
    16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
    17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
    18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
    1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
    1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
    1e Hidden W95 FAT1 80 Old Minix
    Hex code (type L to list all codes): fd
    Changed type of partition 'Linux' to 'Linux raid autodetect'

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@vmhzp-raid5 ~]# fdisk /dev/sde
    Welcome to fdisk (util-linux 2.23.2).

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0x4f90ccd1.

    Command (m for help): n
    Partition type:
    p primary (0 primary, 0 extended, 4 free)
    e extended
    Select (default p):
    Using default response p
    Partition number (1-4, default 1):
    First sector (2048-2097151, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
    Using default value 2097151
    Partition 1 of type Linux and of size 1023 MiB is set

    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): l

    0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
    1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
    2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
    3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
    4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
    5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
    6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
    7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
    8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
    9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
    a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
    b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
    c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
    e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
    f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
    10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
    11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
    12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
    14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary
    16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
    17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
    18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
    1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
    1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
    1e Hidden W95 FAT1 80 Old Minix
    Hex code (type L to list all codes): fd
    Changed type of partition 'Linux' to 'Linux raid autodetect'

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@vmhzp-raid5 ~]# fdisk /dev/sdf
    Welcome to fdisk (util-linux 2.23.2).

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0xb86f4073.

    Command (m for help): n
    Partition type:
    p primary (0 primary, 0 extended, 4 free)
    e extended
    Select (default p):
    Using default response p
    Partition number (1-4, default 1):
    First sector (2048-2097151, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
    Using default value 2097151
    Partition 1 of type Linux and of size 1023 MiB is set

    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): l

    0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
    1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
    2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
    3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
    4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
    5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
    6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
    7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
    8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
    9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
    a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
    b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
    c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
    e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
    f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
    10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
    11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
    12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
    14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary
    16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
    17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
    18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
    1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
    1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
    1e Hidden W95 FAT1 80 Old Minix
    Hex code (type L to list all codes): fd
    Changed type of partition 'Linux' to 'Linux raid autodetect'

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@vmhzp-raid5 ~]# fdisk -l

    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x741b59c1

    Device Boot Start End Blocks Id System
    /dev/sda1 * 128 2097279 1048576 83 Linux

    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x4821b046

    Device Boot Start End Blocks Id System
    /dev/sdb1 128 10485887 5242880 8e Linux LVM

    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x4f90ccd1

    Device Boot Start End Blocks Id System
    /dev/sde1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x2107dd6a

    Device Boot Start End Blocks Id System
    /dev/sdd1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x6a318f0c

    Device Boot Start End Blocks Id System
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0xb86f4073

    Device Boot Start End Blocks Id System
    /dev/sdf1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/mapper/centos-root: 4718 MB, 4718592000 bytes, 9216000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/mapper/centos-swap: 645 MB, 645922816 bytes, 1261568 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes

    [root@vmhzp-raid5 ~]# fdisk -l|grep sd
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sde1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdd1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdf1 2048 2097151 1047552 fd Linux raid autodetect
    [root@vmhzp-raid5 ~]# rpm -qa | grep mdadm
    [root@vmhzp-raid5 ~]# yum install -y mdadm
    Loaded plugins: fastestmirror
    Determining fastest mirrors
    * base: centos.ustc.edu.cn
    * extras: mirrors.163.com
    * updates: mirrors.aliyun.com
    base | 3.6 kB 00:00:00
    extras | 3.4 kB 00:00:00
    updates | 3.4 kB 00:00:00
    (1/2): extras/7/x86_64/primary_db | 187 kB 00:00:00
    (2/2): updates/7/x86_64/primary_db | 3.4 MB 00:00:02
    Resolving Dependencies
    --> Running transaction check
    ---> Package mdadm.x86_64 0:4.1-rc1_2.el7 will be installed
    --> Processing Dependency: libreport-filesystem for package: mdadm-4.1-rc1_2.el7.x86_64
    --> Running transaction check
    ---> Package libreport-filesystem.x86_64 0:2.1.11-42.el7.centos will be installed
    --> Finished Dependency Resolution

    Dependencies Resolved

    =================================================================================
    Package Arch Version Repository
    Size
    =================================================================================
    Installing:
    mdadm x86_64 4.1-rc1_2.el7 base 433 k
    Installing for dependencies:
    libreport-filesystem x86_64 2.1.11-42.el7.centos base 39 k

    Transaction Summary
    =================================================================================
    Install 1 Package (+1 Dependent package)

    Total download size: 472 k
    Installed size: 1.0 M
    Downloading packages:
    (1/2): libreport-filesystem-2.1.11-42.el7.centos.x86_64.r | 39 kB 00:00:00
    (2/2): mdadm-4.1-rc1_2.el7.x86_64.rpm | 433 kB 00:00:00
    ---------------------------------------------------------------------------------
    Total 1.1 MB/s | 472 kB 00:00
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
    Installing : libreport-filesystem-2.1.11-42.el7.centos.x86_64 1/2
    Installing : mdadm-4.1-rc1_2.el7.x86_64 2/2
    Verifying : libreport-filesystem-2.1.11-42.el7.centos.x86_64 1/2
    Verifying : mdadm-4.1-rc1_2.el7.x86_64 2/2

    Installed:
    mdadm.x86_64 0:4.1-rc1_2.el7

    Dependency Installed:
    libreport-filesystem.x86_64 0:2.1.11-42.el7.centos

    Complete!
    [root@vmhzp-raid5 ~]# rpm -qa | grep mdadm
    mdadm-4.1-rc1_2.el7.x86_64
    [root@vmhzp-raid5 ~]# mdadm -C /dev/md0 -ayes -l5 -n3 -x1 /dev/sd[c-f]1
    mdadm: Defaulting to version 1.2 metadata
    mdadm: array /dev/md0 started.
    [root@vmhzp-raid5 ~]# cat /proc/mdstat
    Personalities : [raid6] [raid5] [raid4]
    md0 : active raid5 sde1[4] sdf1[3](S) sdd1[1] sdc1[0]
    2091008 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

    unused devices: <none>
    [root@vmhzp-raid5 ~]# mdadm -D /dev/md0
    /dev/md0:
    Version : 1.2
    Creation Time : Mon Apr 1 13:32:49 2019
    Raid Level : raid5
    Array Size : 2091008 (2042.00 MiB 2141.19 MB)
    Used Dev Size : 1045504 (1021.00 MiB 1070.60 MB)
    Raid Devices : 3
    Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Mon Apr 1 13:32:57 2019
    State : clean
    Active Devices : 3
    Working Devices : 4
    Failed Devices : 0
    Spare Devices : 1

    Layout : left-symmetric
    Chunk Size : 512K

    Consistency Policy : resync

    Name : vmhzp-raid5:0 (local to host vmhzp-raid5)
    UUID : 56fba125:c67d3b92:ad0e45b0:f4dcb624
    Events : 18

    Number Major Minor RaidDevice State
    0 8 33 0 active sync /dev/sdc1
    1 8 49 1 active sync /dev/sdd1
    4 8 65 2 active sync /dev/sde1

    3 8 81 - spare /dev/sdf1
    [root@vmhzp-raid5 ~]# cat /etc/mdadm.conf
    cat: /etc/mdadm.conf: No such file or directory
    [root@vmhzp-raid5 ~]# echo 'DEVICE /dev/sd[c-f]1' >>/etc/mdadm.conf
    [root@vmhzp-raid5 ~]# mdadm -Ds >>/etc/mdadm.conf
    [root@vmhzp-raid5 ~]# cat /etc/mdadm.conf
    DEVICE /dev/sd[c-f]1
    ARRAY /dev/md0 metadata=1.2 spares=1 name=vmhzp-raid5:0 UUID=56fba125:c67d3b92:ad0e45b0:f4dcb624
    [root@vmhzp-raid5 ~]# mkfs.xfs /dev/md0
    meta-data=/dev/md0 isize=512 agcount=8, agsize=65408 blks
    = sectsz=512 attr=2, projid32bit=1
    = crc=1 finobt=0, sparse=0
    data = bsize=4096 blocks=522752, imaxpct=25
    = sunit=128 swidth=256 blks
    naming =version 2 bsize=4096 ascii-ci=0 ftype=1
    log =internal log bsize=4096 blocks=2560, version=2
    = sectsz=512 sunit=8 blks, lazy-count=1
    realtime =none extsz=4096 blocks=0, rtextents=0
    [root@vmhzp-raid5 ~]# mkdir /mydata
    [root@vmhzp-raid5 ~]# mount /dev/md0 /mydata
    [root@vmhzp-raid5 ~]# df -hl
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
    devtmpfs 483M 0 483M 0% /dev
    tmpfs 496M 0 496M 0% /dev/shm
    tmpfs 496M 7.0M 489M 2% /run
    tmpfs 496M 0 496M 0% /sys/fs/cgroup
    /dev/sda1 1014M 156M 859M 16% /boot
    tmpfs 100M 0 100M 0% /run/user/0
    /dev/md0 2.0G 33M 2.0G 2% /mydata
    [root@vmhzp-raid5 ~]# cat /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Tue Feb 5 15:11:01 2019
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/centos/root / xfs defaults 0 0
    /dev/sda1 /boot xfs defaults 0 0
    /dev/centos/swap swap swap defaults 0 0
    [root@vmhzp-raid5 ~]# vim /etc/fstab
    #
    # /etc/fstab
    # Created by anaconda on Tue Feb 5 15:11:01 2019
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/centos/root / xfs defaults 0 0
    /dev/sda1 /boot xfs defaults 0 0
    /dev/centos/swap swap swap defaults 0 0
    "/etc/fstab" 12L, 377C written
    [root@vmhzp-raid5 ~]# cat /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Tue Feb 5 15:11:01 2019
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/centos/root / xfs defaults 0 0
    /dev/sda1 /boot xfs defaults 0 0
    /dev/centos/swap swap swap defaults 0 0
    /dev/md0 /mydata xfs defaults 0 0
    [root@vmhzp-raid5 ~]# reboot
    Last login: Mon Apr 1 10:12:47 2019 from 172.16.5.80
    [root@vmhzp-raid5 ~]# df -hl
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
    devtmpfs 483M 0 483M 0% /dev
    tmpfs 496M 0 496M 0% /dev/shm
    tmpfs 496M 7.1M 489M 2% /run
    tmpfs 496M 0 496M 0% /sys/fs/cgroup
    /dev/sda1 1014M 156M 859M 16% /boot
    /dev/md0 2.0G 33M 2.0G 2% /mydata
    tmpfs 100M 0 100M 0% /run/user/0
    [root@vmhzp-raid5 ~]# cd /mydata
    [root@vmhzp-raid5 mydata]# ls
    [root@vmhzp-raid5 mydata]# wget https://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz
    --2019-04-01 13:51:51-- https://www.rarlab.com/rar/rarlinux-x64-5.5.0.tar.gz
    Resolving www.rarlab.com (www.rarlab.com)... 5.135.104.98
    Connecting to www.rarlab.com (www.rarlab.com)|5.135.104.98|:443... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 536028 (523K) [application/x-gzip]
    Saving to: ‘rarlinux-x64-5.5.0.tar.gz’

    100%[==============================================================================================>] 536,028 220KB/s in 2.4s

    2019-04-01 13:51:55 (220 KB/s) - ‘rarlinux-x64-5.5.0.tar.gz’ saved [536028/536028]

    [root@vmhzp-raid5 mydata]# ls -al
    total 524
    drwxr-xr-x. 2 root root 39 Apr 1 13:51 .
    dr-xr-xr-x. 18 root root 218 Apr 1 13:41 ..
    -rw-r--r--. 1 root root 536028 Aug 11 2017 rarlinux-x64-5.5.0.tar.gz
    [root@vmhzp-raid5 mydata]# mdadm /dev/md0 -f /dev/sdc1
    mdadm: set /dev/sdc1 faulty in /dev/md0
    [root@vmhzp-raid5 mydata]# mdadm -D /dev/md0
    /dev/md0:
    Version : 1.2
    Creation Time : Mon Apr 1 13:32:49 2019
    Raid Level : raid5
    Array Size : 2091008 (2042.00 MiB 2141.19 MB)
    Used Dev Size : 1045504 (1021.00 MiB 1070.60 MB)
    Raid Devices : 3
    Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Mon Apr 1 14:02:31 2019
    State : clean
    Active Devices : 3
    Working Devices : 3
    Failed Devices : 1
    Spare Devices : 0

    Layout : left-symmetric
    Chunk Size : 512K

    Consistency Policy : resync

    Name : vmhzp-raid5:0 (local to host vmhzp-raid5)
    UUID : 56fba125:c67d3b92:ad0e45b0:f4dcb624
    Events : 38

    Number Major Minor RaidDevice State
    3 8 81 0 active sync /dev/sdf1
    1 8 49 1 active sync /dev/sdd1
    4 8 65 2 active sync /dev/sde1

    0 8 33 - faulty /dev/sdc1
    [root@vmhzp-raid5 mydata]# cat /proc/mdstat
    Personalities : [raid6] [raid5] [raid4]
    md0 : active raid5 sdf1[3] sde1[4] sdc1[0](F) sdd1[1]
    2091008 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

    unused devices: <none>
    [root@vmhzp-raid5 mydata]# ls
    rarlinux-x64-5.5.0.tar.gz
    [root@vmhzp-raid5 mydata]# mdadm /dev/md0 -r /dev/sdc1
    mdadm: hot removed /dev/sdc1 from /dev/md0
    [root@vmhzp-raid5 mydata]# mdadm -D /dev/md0
    /dev/md0:
    Version : 1.2
    Creation Time : Mon Apr 1 13:32:49 2019
    Raid Level : raid5
    Array Size : 2091008 (2042.00 MiB 2141.19 MB)
    Used Dev Size : 1045504 (1021.00 MiB 1070.60 MB)
    Raid Devices : 3
    Total Devices : 3
    Persistence : Superblock is persistent

    Update Time : Mon Apr 1 14:04:52 2019
    State : clean
    Active Devices : 3
    Working Devices : 3
    Failed Devices : 0
    Spare Devices : 0

    Layout : left-symmetric
    Chunk Size : 512K

    Consistency Policy : resync

    Name : vmhzp-raid5:0 (local to host vmhzp-raid5)
    UUID : 56fba125:c67d3b92:ad0e45b0:f4dcb624
    Events : 39

    Number Major Minor RaidDevice State
    3 8 81 0 active sync /dev/sdf1
    1 8 49 1 active sync /dev/sdd1
    4 8 65 2 active sync /dev/sde1
    [root@vmhzp-raid5 mydata]# mdadm /dev/md0 -a /dev/sdc1
    mdadm: added /dev/sdc1
    [root@vmhzp-raid5 mydata]# mdadm -D /dev/md0
    /dev/md0:
    Version : 1.2
    Creation Time : Mon Apr 1 13:32:49 2019
    Raid Level : raid5
    Array Size : 2091008 (2042.00 MiB 2141.19 MB)
    Used Dev Size : 1045504 (1021.00 MiB 1070.60 MB)
    Raid Devices : 3
    Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Mon Apr 1 14:06:49 2019
    State : clean
    Active Devices : 3
    Working Devices : 4
    Failed Devices : 0
    Spare Devices : 1

    Layout : left-symmetric
    Chunk Size : 512K

    Consistency Policy : resync

    Name : vmhzp-raid5:0 (local to host vmhzp-raid5)
    UUID : 56fba125:c67d3b92:ad0e45b0:f4dcb624
    Events : 40

    Number Major Minor RaidDevice State
    3 8 81 0 active sync /dev/sdf1
    1 8 49 1 active sync /dev/sdd1
    4 8 65 2 active sync /dev/sde1

    5 8 33 - spare /dev/sdc1
    [root@vmhzp-raid5 mydata]# fdisk -l

    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x741b59c1

    Device Boot Start End Blocks Id System
    /dev/sda1 * 128 2097279 1048576 83 Linux

    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x4821b046

    Device Boot Start End Blocks Id System
    /dev/sdb1 128 10485887 5242880 8e Linux LVM

    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x2107dd6a

    Device Boot Start End Blocks Id System
    /dev/sdd1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0xb86f4073

    Device Boot Start End Blocks Id System
    /dev/sdf1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x4f90ccd1

    Device Boot Start End Blocks Id System
    /dev/sde1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x6a318f0c

    Device Boot Start End Blocks Id System
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect

    Disk /dev/mapper/centos-root: 4718 MB, 4718592000 bytes, 9216000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/mapper/centos-swap: 645 MB, 645922816 bytes, 1261568 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/md0: 2141 MB, 2141192192 bytes, 4182016 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 524288 bytes / 1048576 bytes

    [root@vmhzp-raid5 mydata]# fdisk -l|grep sd
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdd1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdf1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sde1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect
    [root@vmhzp-raid5 mydata]# reboot
    Last login: Mon Apr 1 13:49:31 2019 from 172.16.5.80
    [root@vmhzp-raid5 ~]# fdisk -l|grep sd
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sde1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdf1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdg: 1073 MB, 1073741824 bytes, 2097152 sectors
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdd1 2048 2097151 1047552 fd Linux raid autodetect
    [root@vmhzp-raid5 ~]# fdisk /dev/sdg
    Welcome to fdisk (util-linux 2.23.2).

    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.

    Device does not contain a recognized partition table
    Building a new DOS disklabel with disk identifier 0x3774b911.

    Command (m for help): m
    Command action
    a toggle a bootable flag
    b edit bsd disklabel
    c toggle the dos compatibility flag
    d delete a partition
    g create a new empty GPT partition table
    G create an IRIX (SGI) partition table
    l list known partition types
    m print this menu
    n add a new partition
    o create a new empty DOS partition table
    p print the partition table
    q quit without saving changes
    s create a new empty Sun disklabel
    t change a partition's system id
    u change display/entry units
    v verify the partition table
    w write table to disk and exit
    x extra functionality (experts only)

    Command (m for help): n
    Partition type:
    p primary (0 primary, 0 extended, 4 free)
    e extended
    Select (default p):
    Using default response p
    Partition number (1-4, default 1):
    First sector (2048-2097151, default 2048):
    Using default value 2048
    Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151):
    Using default value 2097151
    Partition 1 of type Linux and of size 1023 MiB is set

    Command (m for help): t
    Selected partition 1
    Hex code (type L to list all codes): l

    0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
    1 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT-
    2 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT-
    3 XENIX usr 3c PartitionMagic 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
    4 FAT16 <32M 40 Venix 80286 85 Linux extended c7 Syrinx
    5 Extended 41 PPC PReP Boot 86 NTFS volume set da Non-FS data
    6 FAT16 42 SFS 87 NTFS volume set db CP/M / CTOS / .
    7 HPFS/NTFS/exFAT 4d QNX4.x 88 Linux plaintext de Dell Utility
    8 AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
    9 AIX bootable 4f QNX4.x 3rd part 93 Amoeba e1 DOS access
    a OS/2 Boot Manag 50 OnTrack DM 94 Amoeba BBT e3 DOS R/O
    b W95 FAT32 51 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
    c W95 FAT32 (LBA) 52 CP/M a0 IBM Thinkpad hi eb BeOS fs
    e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a5 FreeBSD ee GPT
    f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
    10 OPUS 55 EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
    11 Hidden FAT12 56 Golden Bow a8 Darwin UFS f1 SpeedStor
    12 Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
    14 Hidden FAT16 <3 61 SpeedStor ab Darwin boot f2 DOS secondary
    16 Hidden FAT16 63 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
    17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
    18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
    1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
    1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
    1e Hidden W95 FAT1 80 Old Minix
    Hex code (type L to list all codes): fd
    Changed type of partition 'Linux' to 'Linux raid autodetect'

    Command (m for help): w
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.
    [root@vmhzp-raid5 ~]# fdisk -l|grep sd
    Disk /dev/sda: 1075 MB, 1075838976 bytes, 2101248 sectors
    /dev/sda1 * 128 2097279 1048576 83 Linux
    Disk /dev/sdb: 5370 MB, 5370806272 bytes, 10489856 sectors
    /dev/sdb1 128 10485887 5242880 8e Linux LVM
    Disk /dev/sde: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sde1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdf: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdf1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdg: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdg1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdc: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdc1 2048 2097151 1047552 fd Linux raid autodetect
    Disk /dev/sdd: 1073 MB, 1073741824 bytes, 2097152 sectors
    /dev/sdd1 2048 2097151 1047552 fd Linux raid autodetect
    [root@vmhzp-raid5 ~]# df -hl
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
    devtmpfs 483M 0 483M 0% /dev
    tmpfs 496M 0 496M 0% /dev/shm
    tmpfs 496M 7.1M 489M 2% /run
    tmpfs 496M 0 496M 0% /sys/fs/cgroup
    /dev/sda1 1014M 156M 859M 16% /boot
    /dev/md0 2.0G 33M 2.0G 2% /mydata
    tmpfs 100M 0 100M 0% /run/user/0
    [root@vmhzp-raid5 ~]# mdadm /dev/md0 -a /dev/sdg1
    mdadm: added /dev/sdg1
    [root@vmhzp-raid5 ~]# mdadm -D /dev/md0
    /dev/md0:
    Version : 1.2
    Creation Time : Mon Apr 1 13:32:49 2019
    Raid Level : raid5
    Array Size : 2091008 (2042.00 MiB 2141.19 MB)
    Used Dev Size : 1045504 (1021.00 MiB 1070.60 MB)
    Raid Devices : 3
    Total Devices : 5
    Persistence : Superblock is persistent

    Update Time : Mon Apr 1 14:22:11 2019
    State : clean
    Active Devices : 3
    Working Devices : 5
    Failed Devices : 0
    Spare Devices : 2

    Layout : left-symmetric
    Chunk Size : 512K

    Consistency Policy : resync

    Name : vmhzp-raid5:0 (local to host vmhzp-raid5)
    UUID : 56fba125:c67d3b92:ad0e45b0:f4dcb624
    Events : 41

    Number Major Minor RaidDevice State
    3 8 81 0 active sync /dev/sdf1
    1 8 49 1 active sync /dev/sdd1
    4 8 65 2 active sync /dev/sde1

    5 8 33 - spare /dev/sdc1
    6 8 97 - spare /dev/sdg1
    [root@vmhzp-raid5 ~]# mdadm /dev/md0 -G -n4
    [root@vmhzp-raid5 ~]# mdadm -D /dev/md0
    /dev/md0:
    Version : 1.2
    Creation Time : Mon Apr 1 13:32:49 2019
    Raid Level : raid5
    Array Size : 2091008 (2042.00 MiB 2141.19 MB)
    Used Dev Size : 1045504 (1021.00 MiB 1070.60 MB)
    Raid Devices : 4
    Total Devices : 5
    Persistence : Superblock is persistent

    Update Time : Mon Apr 1 14:24:29 2019
    State : clean, reshaping
    Active Devices : 4
    Working Devices : 5
    Failed Devices : 0
    Spare Devices : 1

    Layout : left-symmetric
    Chunk Size : 512K

    Consistency Policy : resync

    Reshape Status : 18% complete
    Delta Devices : 1, (3->4)

    Name : vmhzp-raid5:0 (local to host vmhzp-raid5)
    UUID : 56fba125:c67d3b92:ad0e45b0:f4dcb624
    Events : 57

    Number Major Minor RaidDevice State
    3 8 81 0 active sync /dev/sdf1
    1 8 49 1 active sync /dev/sdd1
    4 8 65 2 active sync /dev/sde1
    6 8 97 3 active sync /dev/sdg1

    5 8 33 - spare /dev/sdc1
    [root@vmhzp-raid5 ~]# df -hl
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
    devtmpfs 483M 0 483M 0% /dev
    tmpfs 496M 0 496M 0% /dev/shm
    tmpfs 496M 7.1M 489M 2% /run
    tmpfs 496M 0 496M 0% /sys/fs/cgroup
    /dev/sda1 1014M 156M 859M 16% /boot
    /dev/md0 2.0G 33M 2.0G 2% /mydata
    tmpfs 100M 0 100M 0% /run/user/0
    [root@vmhzp-raid5 ~]# xfs_growfs /dev/md0
    meta-data=/dev/md0 isize=512 agcount=8, agsize=65408 blks
    = sectsz=512 attr=2, projid32bit=1
    = crc=1 finobt=0 spinodes=0
    data = bsize=4096 blocks=522752, imaxpct=25
    = sunit=128 swidth=256 blks
    naming =version 2 bsize=4096 ascii-ci=0 ftype=1
    log =internal bsize=4096 blocks=2560, version=2
    = sectsz=512 sunit=8 blks, lazy-count=1
    realtime =none extsz=4096 blocks=0, rtextents=0
    data blocks changed from 522752 to 784128
    [root@vmhzp-raid5 ~]# df -hl
    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/centos-root 4.4G 1.4G 3.1G 31% /
    devtmpfs 483M 0 483M 0% /dev
    tmpfs 496M 0 496M 0% /dev/shm
    tmpfs 496M 7.1M 489M 2% /run
    tmpfs 496M 0 496M 0% /sys/fs/cgroup
    /dev/sda1 1014M 156M 859M 16% /boot
    /dev/md0 3.0G 34M 3.0G 2% /mydata
    tmpfs 100M 0 100M 0% /run/user/0

  • 相关阅读:
    webstorm & phpstorm破解
    JSON和JSONP
    angular.extend(dst, src)对象拓展
    angular.foreach 循环方法使用指南
    angular 指令@、=、&的用法和区别
    angular directive指令相互独立
    angular directive指令的复用
    对apply和call的理解
    图片上传
    vue 路由缓存
  • 原文地址:https://www.cnblogs.com/tiantom/p/10636217.html
Copyright © 2011-2022 走看看