summaryrefslogtreecommitdiffstats
path: root/sbin/atacontrol
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2002-03-03 15:41:57 +0000
committersos <sos@FreeBSD.org>2002-03-03 15:41:57 +0000
commita40226defb6e4f9176cb024076526485ba66fa5a (patch)
tree99dbe59fd220c7edc2697d6cd4409e1aa4de6a8c /sbin/atacontrol
parent8703cd1dab6dbe7f403e5b11f0d2933202c39460 (diff)
downloadFreeBSD-src-a40226defb6e4f9176cb024076526485ba66fa5a.zip
FreeBSD-src-a40226defb6e4f9176cb024076526485ba66fa5a.tar.gz
Add the RAID rebuild command.
Diffstat (limited to 'sbin/atacontrol')
-rw-r--r--sbin/atacontrol/atacontrol.88
-rw-r--r--sbin/atacontrol/atacontrol.c9
2 files changed, 14 insertions, 3 deletions
diff --git a/sbin/atacontrol/atacontrol.8 b/sbin/atacontrol/atacontrol.8
index e324b2b..99734ed 100644
--- a/sbin/atacontrol/atacontrol.8
+++ b/sbin/atacontrol/atacontrol.8
@@ -46,6 +46,9 @@
.Ic reinit
.Ar channel
.Nm
+.Ic rebuild
+.Ar raid
+.Nm
.Ic mode
.Ar channel
.Op Ar mastermode slavemode
@@ -86,8 +89,9 @@ Both devices on the channel are reset and
initialized to the parameters the ATA driver has stored internally.
Devices that has gone bad and no longer responds to the probe, or devices
that has physically been removed are removed from the kernel.
-Likewise
-are devices that show up during a reset, probed and attached.
+Likewise are devices that show up during a reset, probed and attached.
+.It Ic rebuild
+Rebuild a RAID1 array on a RAID capable ATA controller.
.It Ic mode
Without the two mode arguments the current transfer modes of both
devices are printed.
diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontrol.c
index 25d3798..3e15670 100644
--- a/sbin/atacontrol/atacontrol.c
+++ b/sbin/atacontrol/atacontrol.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2000,2001 Søren Schmidt
+ * Copyright (c) 2000,2001,2002 Søren Schmidt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -71,6 +71,8 @@ str2mode(char *str)
if (!strcasecmp(str, "UDMA66")) return ATA_UDMA4;
if (!strcasecmp(str, "UDMA5")) return ATA_UDMA5;
if (!strcasecmp(str, "UDMA100")) return ATA_UDMA5;
+ if (!strcasecmp(str, "UDMA6")) return ATA_UDMA6;
+ if (!strcasecmp(str, "UDMA133")) return ATA_UDMA6;
if (!strcasecmp(str, "BIOSDMA")) return ATA_DMA;
return -1;
}
@@ -274,6 +276,11 @@ main(int argc, char **argv)
warn("ioctl(ATAREINIT)");
info_print(fd, iocmd.channel, 0);
}
+ else if (!strcmp(argv[1], "rebuild") && argc == 3) {
+ iocmd.cmd = ATAREBUILD;
+ if (ioctl(fd, IOCATA, &iocmd) < 0)
+ warn("ioctl(ATAREBUILD)");
+ }
else if (!strcmp(argv[1], "mode") && (argc == 3 || argc == 5)) {
if (argc == 5) {
iocmd.cmd = ATASMODE;
OpenPOWER on IntegriCloud