07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Filesystem label=<br />

OS type: Linux<br />

Block size=4096 (log=2)<br />

Fragment size=4096 (log=2)<br />

Stride=0 blocks, Stripe width=0 blocks<br />

524288 inodes, 2097152 blocks<br />

104857 blocks (5.00%) reserved for the super user<br />

First data block=0<br />

Maximum filesystem blocks=2147483648<br />

55 block groups<br />

32768 blocks per group, 32768 fragments per group<br />

8160 inodes per group<br />

Superblock backups stored on blocks:<br />

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632<br />

Writing inode tables: done<br />

Creating journal (32768 blocks): done<br />

Writing superblocks and filesystem accounting information: done<br />

This filesystem will be automatically checked every 26 mounts or<br />

180 days, whichever comes first. Use tune2fs -c or -i to override.<br />

# mkdir /srv/raid-0<br />

# mount /dev/md0 /srv/raid-0<br />

# df -h /srv/raid-0<br />

Filesystem Size Used Avail Use% Mounted on<br />

/dev/md0 8.0G 249M 7.4G 4% /srv/raid-0<br />

The mdadm --create command requires several parameters: the name of the volume to create<br />

(/dev/md*, with MD standing for Multiple Device), the RAID level, the number of disks (which<br />

is compulsory despite being mostly meaningful only with RAID-1 and above), and the physical<br />

drives to use. Once the device is created, we can use it like we'd use a normal partition, create a<br />

filesystem on it, mount that filesystem, and so on. Note that our creation of a RAID-0 volume on<br />

md0 is nothing but coincidence, and the numbering of the array doesn't need to be correlated<br />

to the chosen amount of redundancy.<br />

Creation of a RAID-1 follows a similar fashion, the differences only being noticeable after the<br />

creation:<br />

# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdg2 /dev/sdh<br />

mdadm: largest drive (/dev/sdg2) exceed size (4194240K) by more than 1%<br />

Continue creating array? y<br />

mdadm: array /dev/md1 started.<br />

# mdadm --query /dev/md1<br />

/dev/md1: 4.00GiB raid1 2 devices, 0 spares. Use mdadm --detail for more<br />

➥ detail.<br />

Chapter 12 — Advanced Administration<br />

303

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

Saved successfully!

Ooh no, something went wrong!