summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2005-03-30 12:03:40 +0000
committersos <sos@FreeBSD.org>2005-03-30 12:03:40 +0000
commitf820cdfe2975b10fc33cce539d92cc867aad4576 (patch)
treed973712ac291429795c126539153aec43f4cd2c1 /sbin
parent20adbdefb7ad9134b3f40790a428eae30d071089 (diff)
downloadFreeBSD-src-f820cdfe2975b10fc33cce539d92cc867aad4576.zip
FreeBSD-src-f820cdfe2975b10fc33cce539d92cc867aad4576.tar.gz
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules. This means that on a modern system you just load "atapci and ata" to get the base support, and then one or more of the device subdrivers "atadisk atapicd atapifd atapist ataraid". All can be loaded/unloaded anytime, but for obvious reasons you dont want to unload atadisk when you have mounted filesystems. o The device identify part of the probe has been rewritten to fix the problems with odd devices the old had, and to try to remove so of the long delays some HW could provoke. Also probing is done without the need for interrupts, making earlier probing possible. o SATA devices can be hot inserted/removed and devices will be created/ removed in /dev accordingly. NOTE: only supported on controllers that has this feature: Promise and Silicon Image for now. On other controllers the usual atacontrol detach/attach dance is still needed. o Support for "atomic" composite ATA requests used for RAID. o ATA RAID support has been rewritten and and now supports these metadata formats: "Adaptec HostRAID" "Highpoint V2 RocketRAID" "Highpoint V3 RocketRAID" "Intel MatrixRAID" "Integrated Technology Express" "LSILogic V2 MegaRAID" "LSILogic V3 MegaRAID" "Promise FastTrak" "Silicon Image Medley" "FreeBSD PseudoRAID" o Update the ioctl API to match new RAID levels etc. o Update atacontrol to know about the new RAID levels etc NOTE: you need to recompile atacontrol with the new sys/ata.h, make world will take care of that. NOTE2: that rebuild is done differently from the old system as the rebuild is now done piggybacked on read requests to the array, so atacontrol simply starts a background "dd" to rebuild the array. o The reinit code has been worked over to be much more robust. o The timeout code has been overhauled for races. o Support of new chipsets. o Lots of fixes for bugs found while doing the modulerization and reviewing the old code. Missing or changed features from current ATA: o atapi-cd no longer has support for ATAPI changers. Todays its much cheaper and alot faster to copy those CD images to disk and serve them from there. Besides they dont seem to be made anymore, maybe for that exact reason. o ATA RAID can only read metadata from all the above metadata formats, not write all of them (Promise and Highpoint V2 so far). This means that arrays can be picked up from the BIOS, but they cannot be created from FreeBSD. There is more to it than just the missing write metadata support, those formats are not unique to a given controller like Promise and Highpoint formats, instead they exist for several types, and even worse, some controllers can have different formats and its impossible to tell which one. The outcome is that we cannot reliably create the metadata of those formats and be sure the controller BIOS will understand it. However write support is needed to update/fail/rebuild the arrays properly so it sits fairly high on the TODO list. o So far atapicam is not supported with these changes. When/if this will change is up to the maintainer of atapi-cam so go there for questions. HW donated by: Webveveriet AS HW donated by: Frode Nordahl HW donated by: Yahoo! HW donated by: Sentex Patience by: Vife and my boys (and even the cats)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/atacontrol/atacontrol.c48
1 files changed, 34 insertions, 14 deletions
diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontrol.c
index 4332299..4f1973a 100644
--- a/sbin/atacontrol/atacontrol.c
+++ b/sbin/atacontrol/atacontrol.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2000 - 2004 Søren Schmidt <sos@FreeBSD.org>
+ * Copyright (c) 2000 - 2005 Søren Schmidt <sos@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -373,17 +373,21 @@ main(int argc, char **argv)
iocmd.cmd = ATARAIDCREATE;
if (argc > 2) {
- if (!strcmp(argv[2], "RAID0") ||
- !strcmp(argv[2], "stripe"))
- iocmd.u.raid_setup.type = 1;
- if (!strcmp(argv[2], "RAID1") ||
- !strcmp(argv[2],"mirror"))
- iocmd.u.raid_setup.type = 2;
- if (!strcmp(argv[2], "RAID0+1"))
- iocmd.u.raid_setup.type = 3;
- if (!strcmp(argv[2], "SPAN") ||
- !strcmp(argv[2], "JBOD"))
- iocmd.u.raid_setup.type = 4;
+ if (!strcasecmp(argv[2], "RAID0") ||
+ !strcasecmp(argv[2], "stripe"))
+ iocmd.u.raid_setup.type = AR_RAID0;
+ if (!strcasecmp(argv[2], "RAID1") ||
+ !strcasecmp(argv[2],"mirror"))
+ iocmd.u.raid_setup.type = AR_RAID1;
+ if (!strcasecmp(argv[2], "RAID0+1") ||
+ !strcasecmp(argv[2],"RAID10"))
+ iocmd.u.raid_setup.type = AR_RAID01;
+ if (!strcasecmp(argv[2], "RAID5"))
+ iocmd.u.raid_setup.type = AR_RAID5;
+ if (!strcasecmp(argv[2], "SPAN"))
+ iocmd.u.raid_setup.type = AR_SPAN;
+ if (!strcasecmp(argv[2], "JBOD"))
+ iocmd.u.raid_setup.type = AR_JBOD;
}
if (!iocmd.u.raid_setup.type) {
fprintf(stderr, "atacontrol: Invalid RAID type\n");
@@ -393,7 +397,9 @@ main(int argc, char **argv)
exit(EX_USAGE);
}
- if (iocmd.u.raid_setup.type & 1) {
+ if (iocmd.u.raid_setup.type == AR_RAID0 ||
+ iocmd.u.raid_setup.type == AR_RAID01 ||
+ iocmd.u.raid_setup.type == AR_RAID5) {
if (argc < 4 ||
!sscanf(argv[3], "%d",
&iocmd.u.raid_setup.interleave) == 1) {
@@ -451,6 +457,14 @@ main(int argc, char **argv)
iocmd.cmd = ATARAIDREBUILD;
if (ioctl(fd, IOCATA, &iocmd) < 0)
warn("ioctl(ATARAIDREBUILD)");
+ else {
+ char buffer[128];
+ sprintf(buffer, "/usr/bin/nice -n 20 /bin/dd "
+ "if=/dev/ar%d of=/dev/null bs=1m &",
+ iocmd.channel);
+ if (system(buffer))
+ warn("background dd");
+ }
}
else if (!strcmp(argv[1], "status") && argc == 3) {
int i;
@@ -467,10 +481,16 @@ main(int argc, char **argv)
case AR_RAID1:
printf("RAID1");
break;
- case AR_RAID0 | AR_RAID1:
+ case AR_RAID01:
printf("RAID0+1 stripesize=%d",
iocmd.u.raid_status.interleave);
break;
+ case AR_RAID5:
+ printf("RAID5 stripesize=%d",
+ iocmd.u.raid_status.interleave);
+ break;
+ case AR_JBOD:
+ printf("JBOD");
case AR_SPAN:
printf("SPAN");
break;
OpenPOWER on IntegriCloud