多个磁盘做软件raid并解决分区aligned对齐问题


centos 服务器验证创建软件raid10数据盘,该机器缺少raid硬件。只能做软件raid。

/dev/sdd至/dev/sdm共10块8T磁盘,做raid10;

步骤如下:

(第一步)创建raid10
事先不需要对单个磁盘做分区
10个相同数据盘创建raid10命令:mdadm -C -v  /dev/md10 -a yes -l 10 -n 10  /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm

2个相同数据盘创建raid1命令:mdadm -C -v  /dev/md0 -a yes -l 1 -n 2  /dev/sdb /dev/sdc

创建命令参数说明:

选项:-C
专用选项:
-l 级别
-n 设备个数
-a {yes|no} 自动为其创建设备文件
-c 指定数据块大小(chunk)
-x 指定空闲盘(热备磁盘)个数,空闲盘(热备磁盘)能在工作盘损坏后自动顶替
-v, --verbose:显示细节

参考文档:

Linux中mdadm命令管理RAID磁盘阵列的实例总结_PHP教程_IDC笔记

linux软raid mdadm命令详讲_mdadm查看raid信息-CSDN博客

mdadm  -D   /dev/md10  查看状态

【第二步】解决分区格式化的对齐问题:"The resulting partition is not properly aligned for best performance."

[root@10.74.67.29~]# cat /sys/block/md10/queue/optimal_io_size 
2621440
[root@10.74.67.29~]# cat /sys/block/md10/queue/minimum_io_size 
524288
[root@10.74.67.29~]# cat /sys/block/md10/alignment_offset 
0
[root@10.74.67.29~]# cat /sys/block/md10/queue/physical_block_size 
4096


获取正确的偏移扇区数是将 optimal_io_size 和 alignment_offset 相加然后除以 physical_block_size,这里算出来是640=(optimal_io_size +alignment_offset )/physical_block_size ;

parted  /dev/md10 

(parted) h
(parted) mklabel gpt
(parted) mkpart primary xfs 640 100%    【这是关键步骤】

【第三步】正常的分区格式化大容量磁盘, 添加开机自启动

mkfs.xfs /dev/md10p1   【格式化成默认的xfs文件系统】

blkid /dev/md10p1

cat /etc/fstab && vi /etc/fstab

以下是详细命令

【第一步】创建raid10
不需要对单个磁盘做分区
[root@10.74.67.29~]# mdadm -C -v  /dev/md10 -a yes -l 10 -n 10  /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm
mdadm: layout defaults to n2
mdadm: layout defaults to n2
mdadm: chunk size defaults to 512K
mdadm: partition table exists on /dev/sdd
mdadm: partition table exists on /dev/sdd but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sde
mdadm: partition table exists on /dev/sde but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdf
mdadm: partition table exists on /dev/sdf but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdg
mdadm: partition table exists on /dev/sdg but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdh
mdadm: partition table exists on /dev/sdh but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdi
mdadm: partition table exists on /dev/sdi but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdj
mdadm: partition table exists on /dev/sdj but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdk
mdadm: partition table exists on /dev/sdk but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdl
mdadm: partition table exists on /dev/sdl but will be lost or
       meaningless after creating array
mdadm: partition table exists on /dev/sdm
mdadm: partition table exists on /dev/sdm but will be lost or
       meaningless after creating array
mdadm: size set to 7813894144K
mdadm: automatically enabling write-intent bitmap on large array
Continue creating array? yes
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md10 started.
[root@10.74.67.29~]# mdadm  -D /dev/md10
/dev/md10:
           Version : 1.2
     Creation Time : Wed Dec 20 11:38:54 2023
        Raid Level : raid10
        Array Size : 39069470720 (37259.55 GiB 40007.14 GB)
     Used Dev Size : 7813894144 (7451.91 GiB 8001.43 GB)
      Raid Devices : 10
     Total Devices : 10
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Wed Dec 20 11:39:09 2023
             State : clean, resyncing 
    Active Devices : 10
   Working Devices : 10
    Failed Devices : 0
     Spare Devices : 0

            Layout : near=2
        Chunk Size : 512K

Consistency Policy : bitmap

     Resync Status : 0% complete

              Name : 10
              UUID : e6b3fd6d:b15db153:afa11b20:7f6a2231
            Events : 3

    Number   Major   Minor   RaidDevice State
       0       8       48        0      active sync set-A   /dev/sdd
       1       8       64        1      active sync set-B   /dev/sde
       2       8       80        2      active sync set-A   /dev/sdf
       3       8       96        3      active sync set-B   /dev/sdg
       4       8      112        4      active sync set-A   /dev/sdh
       5       8      128        5      active sync set-B   /dev/sdi
       6       8      144        6      active sync set-A   /dev/sdj
       7       8      160        7      active sync set-B   /dev/sdk
       8       8      176        8      active sync set-A   /dev/sdl
       9       8      192        9      active sync set-B   /dev/sdm
[root@10.74.67.29~]# 

【第二步】解决分区格式化的对齐问题:"The resulting partition is not properly aligned for best performance."

(parted) mkpart primary xfs 640 100%    【这是关键步骤】

(parted) mkpart primary xfs 2048 100% 【不涉及align对齐问题,大容量磁盘做分区默认都这样】

关键一步需要解决align对齐问题,参考链接:
https://www.cnblogs.com/oradba/p/16145117.html
https://blog.51cto.com/u_15076212/4373955
https://blog.csdn.net/zfw_666666/article/details/126744930

[root@10.74.67.29~]# parted /dev/md10
GNU Parted 3.1
Using /dev/md10
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Error: /dev/md10: unrecognised disk label
Model: Linux Software RAID Array (md)                                     
Disk /dev/md10: 40.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: unknown
Disk Flags: 
(parted) mklabel gpt                                                      
(parted) mkpart primary xfs 2048                                          
End? 40.0TB                                                               
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Cancel
(parted) mkpart primary xfs 1024
End? 40.0TB                                                               
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? ^C
(parted) q                                                                
Information: You may need to update /etc/fstab.

[root@10.74.67.29~]# cat /sys/block/md10/queue/optimal_io_size 
2621440
[root@10.74.67.29~]# cat /sys/block/md10/queue/minimum_io_size 
524288
[root@10.74.67.29~]# cat /sys/block/md10/alignment_offset 
0
[root@10.74.67.29~]# cat /sys/block/md10/queue/physical_block_size 
4096


获取正确的偏移扇区数是将 optimal_io_size 和 alignment_offset 相加然后除以 physical_block_size.
【算出来是640】
[root@10.74.67.29~]# parted /dev/md10
GNU Parted 3.1
Using /dev/md10
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: Linux Software RAID Array (md)
Disk /dev/md10: 40.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 3      640MB   640MB   512B                 primary
 1      1024MB  40.0TB  40.0TB               primary

(parted) rm 3                                                             
(parted) rm 1
(parted) mkpart primary 1MiB 100%                                         
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? ^C                                                         
(parted) mkpart primary 640MiB 100%                                         
Error: Unable to satisfy all constraints on the partition.
(parted) mkpart primary 640 100%                                       
Error: Unable to satisfy all constraints on the partition.
(parted) p                                                                
Model: Linux Software RAID Array (md)
Disk /dev/md10: 40.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  40.0TB  40.0TB               primary

(parted) rm 1
(parted) p
Model: Linux Software RAID Array (md)
Disk /dev/md10: 40.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart primary 640 100% 
(parted) p                                                                
Model: Linux Software RAID Array (md)
Disk /dev/md10: 40.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End     Size    File system  Name     Flags
 1      640MB  40.0TB  40.0TB               primary

(parted) rm 1
(parted) mkpart primary xfs 640 100%    【这是关键步骤,上面的尝试mkpart primary 都是错的,rm 删掉】
(parted)                                                                  
(parted) p
Model: Linux Software RAID Array (md)
Disk /dev/md10: 40.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End     Size    File system  Name     Flags
 1      640MB  40.0TB  40.0TB               primary

(parted) q                                                                
Information: You may need to update /etc/fstab.

[root@10.74.67.29~]# mkfs.xfs /dev/md10
md10    md10p1  
[root@10.74.67.29~]# mkfs.xfs /dev/md10
md10    md10p1  
[root@10.74.67.29~]# mkfs.xfs /dev/md10
md10    md10p1  
[root@10.74.67.29~]# mkfs.xfs /dev/md10p1   【格式化成默认的xfs文件系统】
meta-data=/dev/md10p1            isize=512    agcount=37, agsize=268435328 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=9767210880, imaxpct=5
         =                       sunit=128    swidth=640 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@10.74.67.29~]# 

[root@10.74.67.29~]# mkdir /data1
[root@10.74.67.29~]# ls /data/
acl-tools  backup  disk-manager
[root@10.74.67.29~]# mount /dev/md0 /data/
mount: /dev/md0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/md0,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
[root@10.74.67.29~]# mount /dev/md10 /data1/    【mount挂载】
md10    md10p1  
[root@10.74.67.29~]# mount /dev/md10 /data1/
md10    md10p1  
[root@10.74.67.29~]# mount /dev/md10 /data1/
md10    md10p1  
[root@10.74.67.29~]# mount /dev/md10p1 /data1/
[root@10.74.67.29~]# umount /dev/md10
umount: /dev/md10: not mounted
[root@10.74.67.29~]# umount /dev/md0
umount: /dev/md0: not mounted
[root@10.74.67.29~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        30G  2.7G   27G  10% /
devtmpfs        126G     0  126G   0% /dev
tmpfs           126G  4.0K  126G   1% /dev/shm
tmpfs           126G  2.0G  124G   2% /run
tmpfs           126G     0  126G   0% /sys/fs/cgroup
/dev/sda6       384G   33M  384G   1% /data
/dev/sda3        30G  1.1G   29G   4% /var
/dev/sda1       497M  139M  359M  28% /boot
tmpfs            26G     0   26G   0% /run/user/0
/dev/md10p1      37T   35M   37T   1% /data1
[root@10.74.67.29~]# cat /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Mon Dec  4 15:59:26 2023
#
# 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
#
UUID=0e31da41-c199-403e-9052-8752e2ca4e12 /                       xfs     defaults        0 0
UUID=073e19e0-aefb-4ea1-8bb2-e270de8ef7d9 /boot                   xfs     defaults        0 0
UUID=3e0074fe-35ec-4b32-a2b3-5af51b969737 /data                   xfs     defaults        0 0
UUID=08cb2edf-c846-4b47-85ec-39a4e9f82bdb /var                    xfs     defaults        0 0
UUID=fec0ba09-83b2-4d39-9afb-46a06061fbef swap                    swap    defaults        0 0
[root@10.74.67.29~]# umount /dev/sda6
umount: /data: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
[root@10.74.67.29~]# blkid /dev/sd
/dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5  /dev/sda6  /dev/sdb1  /dev/sdc1  
[root@10.74.67.29~]# umount /dev/md
md0     md0p1   md10    md10p1  
[root@10.74.67.29~]# umount /dev/md
md0     md0p1   md10    md10p1  
[root@10.74.67.29~]# umount /dev/md0p1
umount: /dev/md0p1: not mounted
[root@10.74.67.29~]# blkid /dev/md0p1
/dev/md0p1: UUID="7626c7d9-85d9-4582-a1a3-cde94aa3aa11" TYPE="xfs" PARTLABEL="primary" PARTUUID="393befd5-ce5e-452b-8ea3-69bdc5124b24" 
[root@10.74.67.29~]# blkid /dev/md10p1
/dev/md10p1: UUID="544cd698-3a5b-420c-b2c1-22030e763664" TYPE="xfs" PARTLABEL="primary" PARTUUID="1eb5c2a0-22b9-4efd-ab4e-d88419096075" 
[root@10.74.67.29~]# vi /etc/fstab   【添加开机自动挂载】

[root@10.74.67.29~]# 
[root@10.74.67.29~]# 
[root@10.74.67.29~]# ping www.baidu.com
connect: Network is unreachable
[root@10.74.67.29~]# 
[root@10.74.67.29~]# 
[root@10.74.67.29~]# 

【重启机器raid1和raid10的两个磁盘名字都变了,验证开机自动挂载是正确的】

/dev/md10  变成了  /dev/md127  

 /dev/md10p1 变成了  /dev/md127p1

[wangzhong@Bastion-3~]# ssh root@10.74.67.29
Last login: Wed Dec 20 12:06:42 2023 from 10.10.130.172
[root@10.74.67.29~]# 
[root@10.74.67.29~]# 
[root@10.74.67.29~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        30G  2.7G   27G  10% /
devtmpfs        126G     0  126G   0% /dev
tmpfs           126G  4.0K  126G   1% /dev/shm
tmpfs           126G   25M  126G   1% /run
tmpfs           126G     0  126G   0% /sys/fs/cgroup
/dev/sda3        30G  1.1G   29G   4% /var
/dev/sda1       497M  139M  359M  28% /boot
/dev/md126p1    892G   33M  892G   1% /data
/dev/md127p1     37T   35M   37T   1% /data1
tmpfs            26G     0   26G   0% /run/user/0
[root@10.74.67.29~]# cd /data1/
[root@10.74.67.29data1]# 
[root@10.74.67.29data1]# ls
[root@10.74.67.29data1]# fdisk -l

Disk /dev/sda: 480.1 GB, 480103981056 bytes, 937703088 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: 0x0005448a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62466047    30720000   83  Linux
/dev/sda3        62466048   123906047    30720000   83  Linux
/dev/sda4       123906048   937701375   406897664    5  Extended
/dev/sda5       123908096   132296703     4194304   82  Linux swap / Solaris
/dev/sda6       132298752   937701375   402701312   83  Linux
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdb: 960.2 GB, 960197124096 bytes, 1875385008 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: gpt
Disk identifier: 6469EB04-15C4-446B-BE63-718E7D6FB533


#         Start          End    Size  Type            Name
 1         2048   1875384974  894.3G  Linux filesyste 
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sdc: 960.2 GB, 960197124096 bytes, 1875385008 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: gpt
Disk identifier: 2DE63C12-C150-4D73-B5F5-156BE7FB408C


#         Start          End    Size  Type            Name
 1         2048   1875384974  894.3G  Linux filesyste 

Disk /dev/sdd: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sde: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdf: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdg: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdg1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdh: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdi: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdi1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdj: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdj1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdk: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdk1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdl: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdl1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdm: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdm1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/md127: 40007.1 GB, 40007138017280 bytes, 78138941440 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 2621440 bytes
Disk label type: gpt
Disk identifier: 80080657-2EE6-41EC-A62A-FD3EF006FB37


#         Start          End    Size  Type            Name
 1      1249280  78138936319   36.4T  Microsoft basic primary
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/md126: 960.1 GB, 960060784640 bytes, 1875118720 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: gpt
Disk identifier: 1FF3CEA7-609B-4204-8B0F-1FF7976F70EF


#         Start          End    Size  Type            Name
 1      3999744   1875118079  892.2G  Microsoft basic primary
[root@10.74.67.29data1]# 

[root@10.74.67.29data1]# mdadm  -D /dev/md
md/      md126    md126p1  md127    md127p1  
[root@10.74.67.29data1]# mdadm  -D /dev/md126
/dev/md126:
           Version : 1.2
     Creation Time : Thu Dec 14 12:21:59 2023
        Raid Level : raid1
        Array Size : 937559360 (894.13 GiB 960.06 GB)
     Used Dev Size : 937559360 (894.13 GiB 960.06 GB)
      Raid Devices : 2
     Total Devices : 2
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Wed Dec 20 12:44:30 2023
             State : clean 
    Active Devices : 2
   Working Devices : 2
    Failed Devices : 0
     Spare Devices : 0

Consistency Policy : bitmap

              Name : 0
              UUID : 2b7b2fc9:40aa1c39:d577443b:6a0907e4
            Events : 953

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync   /dev/sdb1
       1       8       33        1      active sync   /dev/sdc1
[root@10.74.67.29data1]# mdadm  -D /dev/md127
/dev/md127:
           Version : 1.2
     Creation Time : Wed Dec 20 11:38:54 2023
        Raid Level : raid10
        Array Size : 39069470720 (37259.55 GiB 40007.14 GB)
     Used Dev Size : 7813894144 (7451.91 GiB 8001.43 GB)
      Raid Devices : 10
     Total Devices : 10
       Persistence : Superblock is persistent

     Intent Bitmap : Internal

       Update Time : Wed Dec 20 12:44:37 2023
             State : clean, resyncing 
    Active Devices : 10
   Working Devices : 10
    Failed Devices : 0
     Spare Devices : 0

            Layout : near=2
        Chunk Size : 512K

Consistency Policy : bitmap

     Resync Status : 1% complete

              Name : 10
              UUID : e6b3fd6d:b15db153:afa11b20:7f6a2231
            Events : 940

    Number   Major   Minor   RaidDevice State
       0       8       48        0      active sync set-A   /dev/sdd
       1       8       64        1      active sync set-B   /dev/sde
       2       8       80        2      active sync set-A   /dev/sdf
       3       8       96        3      active sync set-B   /dev/sdg
       4       8      112        4      active sync set-A   /dev/sdh
       5       8      128        5      active sync set-B   /dev/sdi
       6       8      144        6      active sync set-A   /dev/sdj
       7       8      160        7      active sync set-B   /dev/sdk
       8       8      176        8      active sync set-A   /dev/sdl
       9       8      192        9      active sync set-B   /dev/sdm
[root@10.74.67.29data1]# 

[root@10.74.67.29~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        30G  2.7G   27G  10% /
devtmpfs        126G     0  126G   0% /dev
tmpfs           126G  4.0K  126G   1% /dev/shm
tmpfs           126G   41M  126G   1% /run
tmpfs           126G     0  126G   0% /sys/fs/cgroup
/dev/sda3        30G  1.1G   29G   4% /var
/dev/sda1       497M  139M  359M  28% /boot
/dev/md126p1    892G   33M  892G   1% /data
/dev/md127p1     37T   35M   37T   1% /data1
tmpfs            26G     0   26G   0% /run/user/0
[root@10.74.67.29~]#

这是另外一台重启做完软件raid10 重启系统:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/265916.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

第11章 GUI Page417~418 步骤五 支持方框 使用宏定义

运行效果: 原来的创建item的方式: 使用宏定义的方式:

Corel Painter各版本安装指南

下载链接https://pan.baidu.com/s/1g3xrCkWmOlDwAThOkqpYlg?pwd0531 #2023版本 1.鼠标右击【Corel Painter 2023】压缩包(win11及以上系统需先点击“显示更多选项”)【解压到 Corel Painter 2023】。 2.打开解压后的文件夹,双击打开【Setu…

Hadoop入门学习笔记——一、VMware准备Linux虚拟机

视频课程地址:https://www.bilibili.com/video/BV1WY4y197g7 课程资料链接:https://pan.baidu.com/s/15KpnWeKpvExpKmOC8xjmtQ?pwd5ay8 Hadoop入门学习笔记(汇总) 目录 一、VMware准备Linux虚拟机1.1. VMware安装Linux虚拟机1.…

Diffusion扩散模型学习:图片高斯加噪

高斯分布即正态分布;图片高斯加噪即把图片矩阵每个值和一个高斯分布的矩阵上的对应值相加 1、高斯分布 np.random.normal 一维: import numpy as np import matplotlib.pyplot as pltdef generate_gaussian_noise(mean, std_dev, size):noise np.ran…

【智慧办公】如何让智能会议室的电子标签实现远程、批量更新信息?东胜物联网硬件网关让解决方案更具竞争力

近年来,为了减少办公耗能、节能环保、降本增效,越来越多的企业开始从传统的办公模式转向智慧办公。 以智能会议室为例,会议是企业业务中不可或缺的一部分,但在传统办公模式下,一来会议前行政人员需要提前准备会议材料…

Hadoop入门学习笔记——四、MapReduce的框架配置和YARN的部署

视频课程地址:https://www.bilibili.com/video/BV1WY4y197g7 课程资料链接:https://pan.baidu.com/s/15KpnWeKpvExpKmOC8xjmtQ?pwd5ay8 Hadoop入门学习笔记(汇总) 目录 四、MapReduce的框架配置和YARN的部署4.1. 配置MapReduce…

Python脚本打包成exe文件

我们很多时候写好一个python脚本之后,想要发给朋友,可是朋友没有安装python怎么办呢?别急,今天我就教你如何将python脚本打包成exe可执行文件,这样无论你的朋友有没有安装python,都可以运行你写好的程序&am…

ChatGPT的GPTs是什么?

我的新书《Android App开发入门与实战》已于2020年8月由人民邮电出版社出版,欢迎购买。点击进入详情 ​ 在 OpenAI 的DevDay(11 月 6日),该公司宣布推出 ChatGPT GPT:任何人都可以制作并与他人共享的 ChatGPT 自定义版…

快速实现宠物用品小程序开发,从小白到专家的实战教程

随着移动互联网的普及,越来越多的消费者通过手机购物,宠物用品市场也不例外。制作一个专门的宠物用品小程序商城,可以方便消费者随时随地浏览和购买宠物用品,同时也可以帮助宠物店或宠物用品卖家拓宽销售渠道。本文将从开发准备、…

SpringBoot3-基础特性

文章目录 自定义 banner自定义 SpringApplicationFluentBuilder APIProfiles指定环境环境激活环境包含Profile 分组Profile 配置文件 外部化配置配置优先级 外部配置导入配置属性占位符 单元测试-JUnit5测试组件测试注解断言嵌套测试参数化测试 自定义 banner banner 就是启动…

80x86汇编—汇编程序基本框架

文章目录 First Program指令系统伪指令数值表达式 程序框架解释int 21 中断 通过一个基本框架解释各个指令和用处,方便复习。所以我认为最好的学习顺序就是先看一段完整的汇编代码程序,然后给你逐个逐个的解释每一个代码是干嘛用的。然后剩下的还有很多指…

前端三剑客实验5-6-复盘

实验 5 - JavaScript对象 若需要源代码,文章末尾自提 1、实现如下编程内容: 1. 分别使用工厂模式、构造函数和class模式来构建移动硬盘对象 2. 彩票号码生成器 随机生成7个1-36之间的随机数,要求数字不重复,并按从小到大的顺序…

合并排序可视化

合并排序可视化 结果 按照位置分色 按照数组值大小分色 可视化代码 参照 冒泡排序可视化 合并排序 public void mergeSort(List<Integer> list, int[] help, int l, int r) {if (l > r) {return;}int mid l (r - l) / 2;mergeSort(list, help, l, mid);mergeSor…

WPF中使用ListView封装组合控件TreeView+DataGrid

&#xff08;关注博主后&#xff0c;在“粉丝专栏”&#xff0c;可免费阅读此文&#xff09; wpf的功能非常强大&#xff0c;很多控件都是原生的&#xff0c;但是要使用TreeViewDataGrid的组合&#xff0c;就需要我们自己去封装实现。 我们需要的效果如图所示&#x…

Nsum问题

题目 题解 暴力法 class Solution:def fourSum(self, nums: List[int], target: int) -> List[List[int]]:if len(nums) < 4:return []nums.sort()N len(nums)res []for i in range(N-3):for j in range(i1, N-2):for k in range(j1, N-1):for m in range(k1, N):tmp…

灰盒测试简要指南!

在本文中&#xff0c;我们将了解什么是灰盒测试、以及为什么要使用它&#xff0c;以及它的优缺点。 在软件测试中&#xff0c;灰盒测试是一种有用的技术&#xff0c;可以确保发布的软件是高性能的、安全的并满足预期用户的需求。这是一种从外部测试应用程序同时跟踪其内部操作…

ffmpeg使用入门

1. ffmpeg是什么&#xff1a; FFmpeg是一款音视频编解码工具&#xff0c;也是一组音视频编解码开发套件&#xff0c;为开发者提供了丰富的音视频处理调用接口。 FFmpeg源代码编译后会生成三个可执行程序&#xff0c;分别是&#xff1a;ffmpeg、ffplay、ffprobe&#xff0c; 这…

行为型设计模式(四):中介模式 命令模式

中介模式 Mediator 1、什么是中介模式 中介模式用于减少对象之间的直接通信&#xff0c;让系统可以更加松耦合。定义了一个中介者对象&#xff0c;该对象封装了一系列对象的交互&#xff0c;使得对象之间不再直接相互引用&#xff0c;而是通用这个中介者对象进行通信。 2、为…

【开源工程及源码】超级经典开源项目实景三维数字孪生智慧港口

智慧港口可视化平台&#xff0c;旨在实现对港口运营的全面监测、智能管理和优化决策。飞渡科技利用数字化、模拟和仿真的技术&#xff0c;通过互联的传感器和设备&#xff0c;实现实时数据的采集、传输和分析&#xff0c;将港口内外的复杂数据以直观、易懂的方式呈现&#xff0…

搜索二叉树(超详解)

文章目录 前言查找搜索二叉树的结构insertfinderase递归版本Findinserterase 二叉树的拷贝问题搜索二叉树的应用Key模型Key/Value的模型 前言 普通二叉树其实意义不大&#xff0c; 如果用二叉树存储数据的话&#xff0c;还不如顺序表&#xff0c;链表这些。 搜索二叉树它的意义…