Powering up eSATA drives on the fly, can software RAID cope?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Powering up eSATA drives on the fly, can software RAID cope?
I'm running a Gentoo server system with a few hundred gigs of storage spread over several HDs. I've got all my system files and the home directories on two software-mirrored disks (for /, /usr and /var, three LVM2 volumes on top of an md RAID 1 volume on two physical disks, built using EVMS, although as a "compatibility volume", not a native EVMS volume; for /boot, a simple LVM-less md RAID 1 setup over the two disks is used).
The main storage disks, however, are JBOD, not RAIDed in any way. While the data on them isn't exactly critical, I'd like to see it get backed up every now and then.
Tape backup for several hundred gigs is obviously too cumbersome and costly for a home setup, so I'm thinking of getting an external SATA (eSATA) enclosure for two or three disks, running either RAID 1 or 5.
For various reasons, mainly cost, I've settled on a software RAID solution for these external drives as well. This means I can buy (or hack together) what is basically just a drive cage for 2-4 drives with its own power supply, a silent fan and a SATA->eSATA backplane, and equip the server with a cheap RAIDless SATA controller card with 2-4 eSATA ports.
The backups would be done roughly on a weekly basis, so there'd be no point in running the drives 24/7, but instead turning them on when needed, mounting them and proceeding with the backup operation, unmounting and turning the power off.
This finally brings me to my actual question.
The disks are brought up first with a genkernel-created initrd for accessing root, then again before mounting all the partitions during init. Simple enough, as all the disks this process applies to are internal and thus powered and connected constantly. But how does one achieve a software RAID for external drives using md/lvm2/evms, when these drives are powered up after the system has already booted and is running?
Say I connect the eSATA cables and turn on the power to the HD enclosure.
1. Does this trigger some automatic process (which one could monitor with dmesg | tail, for example) that causes the disks to be seen by the system (maybe with fdisk -l)? If not, how would one get the system to find the disks?
2. When the disks are seen, how do you bring up the md RAID 1/5, then the LVM2 volume on top of that? evms_activate may hold the key, but I just don't know for sure. Wouldn't the disks have to be present in some internal database or config file of EVMS for evms_activate to work, and wouldn't this cause EVMS to barf each time the machine is booted without the external disks powered on? Or is it smart enough to avoid this?
3. Assuming you get through items 1 and 2, great, then it's just a matter of mounting the damn things and backing up. But take the same process in reverse: how do you, after unmounting, selectively bring the EVMS/LVM2 volume and then the underlying md volume down for ONLY the external disks, making it safe to disconnect them and power them down?
You are going through all these gyrations, and for what? Software RAID is no backup medium for data integrity. Either cough up 100 bucks for a 3ware dual port card with 2 large drives, or get equal data integrity to your proposed setup with a single external usb hard drive.
I would assume that your data isn't critical, but you are focusing on backups- so perhaps it is. In which case transportable and persistent redundancy is it's function. Neither of which software RAID provides. You may not understand why I'm saying this. But you will when one drive fails on your software RAID array- or better yet, your boot partition. Oops. To see the beginning, you have to see the end. And that is my insight into the terrain in which you are currently deployed. Unpimp dir komputer.
Valid point. But even with hardware RAID (I've looked at a 4-port 3ware card in the past), I'd be using external drives since I have no more room in the server case. With 3ware, this would mean a 4-port SATA->eSATA adapter into the backplane of the server case. No problem there, these are widely available.
But the question about powering up the array remains. Is the 3ware (or some other hw RAID) card able to cope with the array being powered up (and down) after bootup? My gut feeling is that this would be even harder to achieve than with software RAID. Why not just run it 24/7 then, you might ask? Well, needless power consumption and decreased life of the backup drives, mostly (meaning that the drives will likely last longer if powered up once per week for several hours than if kept running 24/7).
Either way, I may have to rethink this one. To counter one of your points: I'm not looking for transportability (as in having an off-site backup) - while the backup is nice to have, it's not that critical. Also, how is software RAID less persistent than hardware RAID? Even if the server explodes, the data would still be accessible on two drives (assuming RAID 1). If the "source" disk inside the server dies simultaneously with one of the externally RAIDed drives, the data still exists in one external drive. What more would I need in terms of persistence, or am I misunderstanding your use of the word?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.