1.\" Copyright (c) 1985, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution.
| 1.\" Copyright (c) 1985, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution.
|
12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgment: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors.
| |
16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)badsect.8 8.1 (Berkeley) 6/5/93
| 12.\" 4. Neither the name of the University nor the names of its contributors 13.\" may be used to endorse or promote products derived from this software 14.\" without specific prior written permission. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.\" @(#)badsect.8 8.1 (Berkeley) 6/5/93
|
33.\" $FreeBSD: head/sbin/badsect/badsect.8 116034 2003-06-08 12:40:50Z charnier $
| 29.\" $FreeBSD: head/sbin/badsect/badsect.8 128073 2004-04-09 19:58:40Z markm $
|
34.\" 35.Dd June 5, 1993 36.Dt BADSECT 8 37.Os 38.Sh NAME 39.Nm badsect 40.Nd create files to contain bad sectors 41.Sh SYNOPSIS 42.Nm 43.Ar bbdir sector ... 44.Sh DESCRIPTION 45The 46.Nm 47utility makes a file to contain a bad sector. Normally, bad sectors 48are made inaccessible by the standard formatter, which provides 49a forwarding table for bad sectors to the driver. 50If a driver supports the bad blocking standard it is much preferable to 51use that method to isolate bad blocks, since the bad block forwarding 52makes the pack appear perfect, and such packs can then be copied with 53.Xr dd 1 . 54The technique used by this program is also less general than 55bad block forwarding, as 56.Nm 57can't make amends for 58bad blocks in the i-list of file systems or in swap areas. 59.Pp 60On some disks, 61adding a sector which is suddenly bad to the bad sector table 62currently requires the running of the standard 63.Tn DEC 64formatter. 65Thus to deal with a newly bad block 66or on disks where the drivers 67do not support the bad-blocking standard 68.Nm 69may be used to good effect. 70.Pp 71The 72.Nm 73utility is used on a quiet file system in the following way: 74First mount the file system, and change to its root directory. 75Make a directory 76.Li BAD 77there. 78Run 79.Nm 80giving as argument the 81.Ar BAD 82directory followed by 83all the bad sectors you wish to add. 84(The sector numbers must be relative to the beginning of 85the file system, but this is not hard as the system reports 86relative sector numbers in its console error messages.) 87Then change back to the root directory, unmount the file system 88and run 89.Xr fsck 8 90on the file system. The bad sectors should show up in two files 91or in the bad sector files and the free list. Have 92.Xr fsck 8 93remove files containing the offending bad sectors, but 94.Em do not 95have it remove the 96.Pa BAD/ Ns Em nnnnn 97files. 98This will leave the bad sectors in only the 99.Li BAD 100files. 101.Pp 102The 103.Nm 104utility works by giving the specified sector numbers in a 105.Xr mknod 2 106system call, 107creating an illegal file whose first block address is the block containing 108bad sector and whose name is the bad sector number. 109When it is discovered by 110.Xr fsck 8 111it will ask 112.Dq Li "HOLD BAD BLOCK \&?" . 113A positive response will cause 114.Xr fsck 8 115to convert the inode to a regular file containing the bad block. 116.Sh SEE ALSO 117.Xr fsck 8 118.Sh DIAGNOSTICS 119The 120.Nm 121utility refuses to attach a block that 122resides in a critical area or is out of range of the file system. 123A warning is issued if the block is already in use. 124.Sh BUGS 125If more than one sector which comprise a file system fragment are bad, 126you should specify only one of them to 127.Nm , 128as the blocks in the bad sector files actually cover all the sectors in a 129file system fragment. 130.Sh HISTORY 131The 132.Nm 133utility appeared in 134.Bx 4.1 .
| 30.\" 31.Dd June 5, 1993 32.Dt BADSECT 8 33.Os 34.Sh NAME 35.Nm badsect 36.Nd create files to contain bad sectors 37.Sh SYNOPSIS 38.Nm 39.Ar bbdir sector ... 40.Sh DESCRIPTION 41The 42.Nm 43utility makes a file to contain a bad sector. Normally, bad sectors 44are made inaccessible by the standard formatter, which provides 45a forwarding table for bad sectors to the driver. 46If a driver supports the bad blocking standard it is much preferable to 47use that method to isolate bad blocks, since the bad block forwarding 48makes the pack appear perfect, and such packs can then be copied with 49.Xr dd 1 . 50The technique used by this program is also less general than 51bad block forwarding, as 52.Nm 53can't make amends for 54bad blocks in the i-list of file systems or in swap areas. 55.Pp 56On some disks, 57adding a sector which is suddenly bad to the bad sector table 58currently requires the running of the standard 59.Tn DEC 60formatter. 61Thus to deal with a newly bad block 62or on disks where the drivers 63do not support the bad-blocking standard 64.Nm 65may be used to good effect. 66.Pp 67The 68.Nm 69utility is used on a quiet file system in the following way: 70First mount the file system, and change to its root directory. 71Make a directory 72.Li BAD 73there. 74Run 75.Nm 76giving as argument the 77.Ar BAD 78directory followed by 79all the bad sectors you wish to add. 80(The sector numbers must be relative to the beginning of 81the file system, but this is not hard as the system reports 82relative sector numbers in its console error messages.) 83Then change back to the root directory, unmount the file system 84and run 85.Xr fsck 8 86on the file system. The bad sectors should show up in two files 87or in the bad sector files and the free list. Have 88.Xr fsck 8 89remove files containing the offending bad sectors, but 90.Em do not 91have it remove the 92.Pa BAD/ Ns Em nnnnn 93files. 94This will leave the bad sectors in only the 95.Li BAD 96files. 97.Pp 98The 99.Nm 100utility works by giving the specified sector numbers in a 101.Xr mknod 2 102system call, 103creating an illegal file whose first block address is the block containing 104bad sector and whose name is the bad sector number. 105When it is discovered by 106.Xr fsck 8 107it will ask 108.Dq Li "HOLD BAD BLOCK \&?" . 109A positive response will cause 110.Xr fsck 8 111to convert the inode to a regular file containing the bad block. 112.Sh SEE ALSO 113.Xr fsck 8 114.Sh DIAGNOSTICS 115The 116.Nm 117utility refuses to attach a block that 118resides in a critical area or is out of range of the file system. 119A warning is issued if the block is already in use. 120.Sh BUGS 121If more than one sector which comprise a file system fragment are bad, 122you should specify only one of them to 123.Nm , 124as the blocks in the bad sector files actually cover all the sectors in a 125file system fragment. 126.Sh HISTORY 127The 128.Nm 129utility appeared in 130.Bx 4.1 .
|