有没有办法以类似于 MDADM 的方式显示 RAID 详细信息?

有没有办法以类似于 MDADM 的方式显示 RAID 详细信息?

mdadm --detail <device>当我需要知道设备正在发生什么情况时,我发现/proc/mdadm它非常有用。

例子:

/dev/md0:
        Version : 1.2
  Creation Time : Mon Mar  4 08:35:09 2013
     Raid Level : raid10
     Array Size : 1464884224 (1397.02 GiB 1500.04 GB)
  Used Dev Size : 732442112 (698.51 GiB 750.02 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Mon Mar  3 11:41:59 2014
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : near=2
     Chunk Size : 512K

           Name : server.example.com:0  (local to host server.example.com)
           UUID : bfee0572:e809b555:22d8bfdb:e585371c
         Events : 409

    Number   Major   Minor   RaidDevice State
       0       8       17        0      active sync set-A   /dev/sdb1
       1       8       33        1      active sync set-B   /dev/sdc1
       2       8       49        2      active sync set-A   /dev/sdd1
       3       8       65        3      active sync set-B   /dev/sde1

最近我开始使用 BTRFS,想知道是否有办法获得有关我的 BTRFS RAID 设备的类似信息?btrfs filesystem show <device>很好,但没有相同级别的细节......

答案1

不行。你只能有btrfs fi shbtrfs fi df /。例如:

# btrfs fi sh
Label: 'rootfs'  uuid: 44d484b7-a780-43a2-a1e4-fc98bac776e6
        Total devices 1 FS bytes used 3.16GiB
        devid    1 size 46.56GiB used 6.06GiB path /dev/mapper/sda3_crypt

Label: 'boot'  uuid: 2772f08c-8029-4cc5-8a43-11aa7a5dc699
        Total devices 3 FS bytes used 69.43MiB
        devid    1 size 238.00MiB used 192.00MiB path /dev/sda2
        devid    2 size 238.00MiB used 80.00MiB path /dev/sdb2
        devid    3 size 238.00MiB used 112.00MiB path /dev/sdc2

Label: 'home'  uuid: fcfafad3-86f6-462d-9054-aee438acb548
        Total devices 3 FS bytes used 456.93GiB
        devid    1 size 884.71GiB used 319.03GiB path /dev/mapper/sda4_crypt
        devid    2 size 884.67GiB used 318.00GiB path /dev/mapper/sdb4_crypt
        devid    3 size 884.71GiB used 319.03GiB path /dev/mapper/sdc4_crypt

Btrfs v3.14.1


# btrfs fi df /home
Data, RAID1: total=476.00GiB, used=456.21GiB
System, RAID1: total=32.00MiB, used=112.00KiB
Metadata, RAID1: total=2.00GiB, used=729.53MiB

自~2022年起,还可以使用btrfs device usage

# btrfs device usage /boot/
/dev/sdc2, ID: 5
   Device size:           715.16MiB
   Device slack:            3.50KiB
   Data,RAID1:            682.12MiB
   System,RAID1:           32.00MiB
   Unallocated:             1.04MiB

/dev/sdb2, ID: 6
   Device size:           238.33MiB
   Device slack:            2.00KiB
   Data,RAID1:             45.31MiB
   Metadata,RAID1:        192.00MiB
   Unallocated:             1.01MiB

/dev/sda2, ID: 7
   Device size:           238.00MiB
   Device slack:              0.00B
   Data,RAID1:            237.00MiB
   Unallocated:             1.00MiB

/dev/sdd2, ID: 8
   Device size:           951.67MiB
   Device slack:            3.00KiB
   Data,RAID1:            516.44MiB
   Metadata,RAID1:        192.00MiB
   System,RAID1:           32.00MiB
   Unallocated:           211.23MiB

对于 I/O 详细信息,btrfs device stats

# btrfs device stats /boot/
[/dev/sdc2].write_io_errs    0
[/dev/sdc2].read_io_errs     0
[/dev/sdc2].flush_io_errs    0
[/dev/sdc2].corruption_errs  0
[/dev/sdc2].generation_errs  0
[/dev/sdb2].write_io_errs    0
[/dev/sdb2].read_io_errs     0
[/dev/sdb2].flush_io_errs    0
[/dev/sdb2].corruption_errs  0
[/dev/sdb2].generation_errs  0
[/dev/sda2].write_io_errs    0
[/dev/sda2].read_io_errs     0
[/dev/sda2].flush_io_errs    0
[/dev/sda2].corruption_errs  0
[/dev/sda2].generation_errs  0
[/dev/sdd2].write_io_errs    0
[/dev/sdd2].read_io_errs     0
[/dev/sdd2].flush_io_errs    0
[/dev/sdd2].corruption_errs  0
[/dev/sdd2].generation_errs  0

相关内容