From owner-freebsd-questions Fri Sep 8 13:04:28 1995 Return-Path: questions-owner Received: (from majordom@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA01830 for questions-outgoing; Fri, 8 Sep 1995 13:04:28 -0700 Received: from iworks.InterWorks.org (iworks.interworks.org [128.255.18.10]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id NAA01824 for ; Fri, 8 Sep 1995 13:04:26 -0700 Received: by iworks.InterWorks.org (1.37.109.8/16.2) id AA19961; Fri, 8 Sep 1995 14:58:42 -0500 Message-Id: <9509081958.AA19961@iworks.InterWorks.org> Date: Fri, 8 Sep 1995 14:58:42 -0500 From: "Daniel M. Eischen" To: kuku@gilberto.physik.rwth-aachen.de, questions@freebsd.org Subject: Re: in situ scsi formatting Sender: questions-owner@freebsd.org Precedence: bulk >Is there a way to low level format a SCSI drive under FreeBSD? >I have one drive that has a media error and I don't want to run >SCSICNTL.EXE from a DOS diskette. > >It would be nice to dismount the drive, send it the appropriate >scsi commands (scsi) and partition and disklabel it afterwards. >Has anyone done so? Can't you use the scsi(8) command to format the drive? bash$ man scsi SCSI(8) UNIX System Manager's Manual SCSI(8) NAME scsi - program to assist with scsi devices. SYNOPSIS Usage: scsi -f device -d debug_level # To set debug level scsi -f device [-v] -z seconds # To freeze bus scsi -f device -m page [-P pc] [-e] # To read mode pages scsi -f device -p [-b bus] [-l lun] # To probe all devices scsi -f device -r [-b bus] [-t targ] [-l lun] # To reprobe a device scsi -f device [-v] [-s seconds] -c cmd_fmt [arg0 ... argn] # A command... -o count out_fmt [arg0 ... argn] # EITHER (for data out) -i count in_fmt # OR (for data in) [...] BUGS This command wasn't ready for inclusion in 2.0R and so is missing in that release. Some devices respond to an inquiry for all LUNS. This will cause them to come on line to 8 times during reprobe to different logical units. The "-i" option to do an inquiry went away in 2.1. The new facilities provided by "-c" supercede that. Check your permissions carefully. "scsi -f /dev/rsd0c -c "4 0 0 0 0 0" permits anyone who can open /dev/rsd0c to format the disk drive. This must be changed to at least require write access to the drive. HISTORY The scsi command appeared in 386BSD 0.1.2.4/FreeBSD to support the new reprobe and user SCSI commands. 4th Berkeley Distribution October 11, 1993 3 I've tried to do this in the process of trying to fix a broken Quantum and it seemed like it was working (the drive was hosed and prevented the command from completing). Dan Eischen deischen@iworks.InterWorks.org