![]() |
Welcome to ftp.vim.org,
Hosted by ftp.nluug.nl Current directory: /ftp/os/BSD/NetBSD/misc/quick-hacks/sdremap/ |
Contents of README:This program can be used to issue a REASSIGN BLOCKS command to a direct-access SCSI device, such as a disk, to map out a bad block. The comment header from the top of the source file is appended below for reference. See it for usage, how to build, etc. This program is provided in the hope that it will be useful, and provide and example of how to use NetBSD's SCIOCCOMMAND ioctl, which provides a mechanism for user-level processes to send raw SCSI commands to a device. The author of this program is Jason R. Thorpe. He may be contacted by sending e-mail to thorpej@NetBSD.ORG. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----- snip ----- /* * sdremap <dev> <blkno> - tell a SCSI disk to remap the bad block * specified on the command line. * * Compile this on your favorite NetBSD 1.1 system with: * * cc -I/sys -DOLD_SCSI_BYTES -o sdremap sdremap.c * * or on newer NetBSD systems with: * * cc -I/sys -o sdremap sdremap.c * * It will be pretty obvious if you need to add or remove the OLD_SCSI_BYTES * define; this program won't compile if the setting is incorrect. * * When you use this program, make sure the disk you're mucking with * has no mounted filesystems (unless that's just not possible, in which * case, make sure they're mounted read-only, and you're in single-user * mode). You must use the "raw partition" of the disk. On an i386, this * is `d', and everywhere else `c'. * * I.e.: * ./sdremap /dev/rsd1d 356642 * * Written by Jason R. Thorpe <thorpej@NetBSD.ORG>. * This program is in the public domain. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * TODO: * Handle multiple blocks with a single command. I'm just lazy. */ |
Name Last modified Size
Parent Directory -
README 13-Jun-1996 00:56 3.0K
sdremap.c 13-Jun-1996 00:54 4.2K
NLUUG - Open Systems. Open Standards
Become a member
and get discounts on conferences and more, see the NLUUG website!