07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

again due to having been probed during the reboot. The kernel would then have three physical<br />

elements, each claiming to contain half of the same RAID volume. Another source of confusion<br />

can come when RAID volumes from two servers are consolidated onto one server only. If these<br />

arrays were running normally before the disks were moved, the kernel would be able to detect<br />

and reassemble the pairs properly; but if the moved disks had been aggregated into an md1 on<br />

the old server, and the new server already has an md1, one of the mirrors would be renamed.<br />

Backing up the configuration is therefore important, if only for reference. The standard way to<br />

do it is by editing the /etc/mdadm/mdadm.conf file, an example of which is listed here:<br />

# mdadm.conf<br />

#<br />

# Please refer to mdadm.conf(5) for information about this file.<br />

#<br />

# by default, scan all partitions (/proc/partitions) for MD superblocks.<br />

# alternatively, specify devices to scan, using wildcards if desired.<br />

DEVICE /dev/sd*<br />

# auto-create devices with Debian standard permissions<br />

CREATE owner=root group=disk mode=0660 auto=yes<br />

# automatically tag new arrays as belonging to the local system<br />

HOMEHOST <br />

# instruct the monitoring daemon where to send mail alerts<br />

MAILADDR root<br />

ARRAY /dev/md0 metadata=1.2 name=squeeze:0 UUID=6194b63f:69a40eb5:a79b7ad3:<br />

➥ c91f20ee<br />

ARRAY /dev/md1 metadata=1.2 name=squeeze:1 UUID=20a8419b:41612750:b9171cfe:00<br />

➥ d9a432<br />

Example 12.1<br />

mdadm configuration file<br />

One of the most useful details is the DEVICE option, which lists the devices where the system<br />

will automatically look for components of RAID volumes at start-up time. In our example, we<br />

replaced the default value, partitions, with an explicit list of device files, since we chose to use<br />

entire disks and not only partitions, for some volumes.<br />

The last two lines in our example are those allowing the kernel to safely pick which volume<br />

number to assign to which array. The metadata stored on the disks themselves are enough to<br />

re-assemble the volumes, but not to determine the volume number (and the matching /dev/md*<br />

device name).<br />

308 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!