mdadm auto-read-only
If you’ve used mdadm for a while, you may have come across a situation where your array’s status says auto-read-only. If you see this, there’s a very easy way to fix it.
Linux, Home Servers, BASH, Photography, and Ruby on Rails
If you’ve used mdadm for a while, you may have come across a situation where your array’s status says auto-read-only. If you see this, there’s a very easy way to fix it.
I was asked the other day on the Ubuntu Forums for a lean music player that would autorun on startup and automatically play a shuffled playlist .
mdadm makes raid management, even tasks that seem like they could be very complicated very easy. The following demonstrates setting up a (5) disk RAID5 array, and then migrating to a (10) disk RAID6 array.
We have a number of HP Servers at work, and I’ve been less than impressed with their slow throughput with stock parameters. One of our DL580’s has (10) 72GB 15K SAS drives attached to an HP Smart Array controller and could only do around 40 MB/s with the stock configuration. Here’s what I did to speed it up.
The following is how to setup a RAID50 array in mdadm. I would suggest using a RAID6 array in it’s place, but this is for demonstration purposes.
If you lose more disks than you have parity to protect you from data loss, then you’re array is gone. But, quite often you get a temporary failure of several disks at once (bad cable, or failed HBA); afterwards the RAID superblocks are out of sync and you can no longer start your RAID array. Here’s a couple ways to try to get it working again.
One of the advantages of software RAID is the flexibility it gives you, that would normally only be available from high end (expensive) RAID cards. This includes the ability to grow an existing array (only for certain RAID levels), which means if you run out of space you can easily plug in a new drive and keep going.
If you already have smartmontools installed, it is fairly straightforward to write a Bash script that finds each disk in your computer, checks it’s temperature, and then shutdown the system if the temperature is at a critical level.
If you have a big RAID array, that last thing you want to be doing is always checking your available disk space. Let’s setup a quick script to monitor our shares for us daily and to send an alert when it gets over 90% used.
SMART monitoring is a good tool to identify a potentially failing disk before it has failed or if it’s behaving strangely.