Online Book Reader

Home Category

Managing RAID on Linux - Derek Vadala [76]

By Root 1379 0
of each of those types, respectively.

The next section displays properties that are specific to the RAID level. Layout reports the parity algorithm in use, followed by the Chunk Size in kilobytes. Because both of these options are specific to various RAID levels, they will not appear in all output of mdadm -D. In this example, both settings are displayed because RAID-5 is in use. A mirroring array would display neither because it does not support striping and does not use parity, while a RAID-0 would display only Chunk Size.

The last section displays a list of all array member disks, including their major and minor numbers, their positions in the array, current states, and block special files. Finally, the UUID of the array, if available, is displayed.

The -E or --examine option is used to display information about a member disk, as opposed to information about the array.

# mdadm --examine /dev/sdb1

/dev/sdb1:

Magic : a92b4efc

Version : 00.90.00

UUID : 3d793b9a:c1712878:1113a282:465e2c8f

Creation Time : Wed Mar 13 06:52:41 2002

Raid Level : raid5

Device Size : 17920384 (17.09 GiB 18.35 GB)

Raid Devices : 4

Total Devices : 4

Preferred Minor : 0

Update Time : Wed Mar 13 06:52:41 2002

State : dirty, no-errors

Active Devices : 4

Working Devices : 4

Failed Devices : 0

Spare Devices : 0

Checksum : 79b87088 - correct

Events : 0.1

Layout : left-symmetric

Chunk Size : 64K

Number Major Minor RaidDisk State

this 0 8 17 0 active sync /dev/sdb1

0 0 8 17 0 active sync /dev/sdb1

1 1 8 33 1 active sync /dev/sdc1

2 2 8 49 2 active sync /dev/sdd1

3 3 8 65 3 active sync /dev/sde1

The above output is from a member disk (/dev/sdb1) from the array used in the previous --detail example. The -E or --examine option reads the md superblock from an array member and displays the information found there. The --detail option, in contrast, looks at the array as a whole. --examine is used to query individual member disks. However, since you can combine arrays into larger arrays (such as RAID-10), the member disk that is displayed by the --examine option could actually be an array in its own right, instead of an individual disk. While much of the information provide by --detail and --examine overlaps, you can see that there are some pieces of information that are unique to each option.

Magic shows the magic number[4] used by the kernel RAID subsystem to mark the beginning of a RAID superblock. This hexadecimal number (a92b4efc) is a constant defined in the Linux kernel. Every md superblock stores Checksum information about itself. When mdadm examines a component disk, it computes the Checksum for the superblock and compares it to the value already stored there. In this case, that computation matched the value found on the disk. If there had been a discrepancy, it would have been noted here. Immediately following is the event counter, which displays the number of Events in the array's history.

Combine the --brief option with --detail to generate array entries suitable for /etc/mdadm.conf. For instance, the following command generates an entry for /dev/md0. You might find it convenient to redirect the output to /etc/mdadm.conf/.

# mdadm --detail --brief /dev/md0

ARRAY /dev/md0 level=raid5 num-devices=4 UUID=41d0ebc5:befadd9f:cfab6144:dfa13287

Stop the array at /dev/md0:

# mdadm --stop /dev/md0

Stop the arrays at /dev/md0, /dev/md1, and /dev/md2 using the short form of --stop:

# mdadm -S /dev/md0 /dev/md1 /dev/md2

Run an array that was partially assembled, but not activated, because a missing disk would have started it in degraded mode:

# mdadm --run /dev/md0

Mark /dev/md0 as --readonly using the short form:

#mdadm -o /dev/md0.

Mark /dev/md0 as --readwrite using the short form:

# mdadm -w /dev/md0.

Erase the RAID superblock from /dev/sda1. This option has no short form.

# mdadm --zero-superblock /dev/sda1

The --zero-superblock option also works on multiple disks:

# mdadm --zero-superblock /dev/sd{a,b,c,d,e,f}1

* * *

[4] Magic numbers have a few different definitions in computer programming. In

Return Main Page Previous Page Next Page

®Online Book Reader