Apr 29

Off topic, not technical, but we’re celebrating. We just got our login date for our adoption. We’re that much closer to growing our family. w00t!

Apr 28

This tip assumes that you have two disks that have equal sized free partitions that can be used.
RAID 1 is commonly referred to as mirroring. Every bit that is written to disk 1 is also written to disk 2, so in the event of a failure of disk 1, disk 2 has a complete mirror of all data and you can keep right on going. To create a RAID 1 mirror of two partitions, run the following

mdadm –create –verbose /dev/md0 –level=1 –raid-devices=2 /dev/$DISK1 /dev/$DISK2

Where $DISK1 is the first partition (sda1 for example) and $DISK2 is the second partition (sdb1)
To verify that worked, cat /proc/mdstat

Apr 26

[jason@firefly ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md1              2.3T  1.2G  2.1T   1% /
/dev/md0               99M   11M   83M  12% /boot
tmpfs                1005M     0 1005M   0% /dev/shm

Apr 25

The file /proc/mdstat will tell you most of what you need to know when you are working with a software RAID array in linux.

cat /proc/mdstat

Returns this on my file server at home

Personalities : [raid6] [raid5] [raid4] [raid1]
md0 : active raid1 sda1[0] sdb1[1] sdc1[2](S) sdd1[3](S) sde1[4](S) sdf1[5](S)
104320 blocks [2/2] [UU]
resync=DELAYED

md1 : active raid5 sdf2[6] sde2[4] sdd2[3] sdc2[2] sdb2[1] sda2[0]
2441396480 blocks level 5, 256k chunk, algorithm 2 [6/5] [UUUUU_]
[========>............] recovery = 43.8% (213871868/488279296) finish=88.4min speed=51686K/sec

unused devices: <none>

The first line of interest is the personalities. This tells you what RAID levels the box supports.

Next is the array name (md0) Whether it’s active or not, it’s RAID level (1) and the devices and partitions that make up this array (sda2-f2). Notice that 4 of the disks have an S behind them to indicate they are spare drives.

The next line is the number of blocks the array has (this can be translated into size) and a section in square brackets. The first number in the brackets is the number of drives that are configured to be active in this array, the next number is the number of drives that actually are active. In my case, 2 are configured and 2 are active, so 2/2. The last box tells us what state those drives are in, U for Up.

Looking at the md1 line, we see a few differences. The immediate difference is the additional information about chunk size and algorithms. this is a RAID 5 set, so that information makes sense, but I’ll let you research it on your own. We can see on this array, 6 drives are configured but only 5 are active. That’s because the array is rebuilding so one of the drives is out of sync. When the rebuild is complete, all of the drive spaces will be U’s. Note that the out of sync drive is flagged as “_” which means the drive isn’t failed, it’s just building.

Apr 24

To view the config that is currently being used on a cisco router or switch, simply run

show run

« Previous Entries