Date: Mon, 30 Nov 1998 18:05:08 -0700 (MST) From: "Kenneth D. Merry" <ken@plutotech.com> To: grog@lemis.com (Greg Lehey) Cc: freebsd-scsi@FreeBSD.ORG Subject: Re: Formatting disks under CAM Message-ID: <199812010105.SAA12477@panzer.plutotech.com> In-Reply-To: <19981130111418.D831@freebie.lemis.com> from Greg Lehey at "Nov 30, 98 11:14:18 am"
next in thread | previous in thread | raw e-mail | index | archive | help
Greg Lehey wrote... > I've got a disk which has developed a number of bad spots, and I want > to format it. I've tried scsiformat, but it hasn't been converted for > CAM. scsiformat uses the following command to perform the format: > > scsi -f /dev/rsd0.ctl -v -c 12 0 0 0 v 0 96 -i 96 s8 z8 z16 z4 > > I've tried: > > camcontrol cmd -n da -u 0 -c 12 0 0 0 v 0 96 -i 96 s8 z8 z16 z4 > > which appears to be the equivalent camcontrol command, but I only get > the error message > > camcontrol: error sending command Joerg already pointed out that that isn't the format command, but rather the inquiry command. The reason it doesn't work is because you need to quote things. This works: camcontrol cmd -n da -u 0 -c "12 0 0 0 v 0" 96 -i 96 "s8 z8 z16 z4" You've eliminated the quotes even from the command you copied out of scsiformat(8). Of course it's much easier to just type 'camcontrol inquiry'. I plan on adding a 'camcontrol format' subcommand that will provide better functionality than the old scsiformat utility. I also plan on getting Joerg Schilling's sformat utility to work with CAM. It appears to do far more formatting/remapping things than I plan on implementing within camcontrol. > I've ktraced camcontrol, and find that it calls a number of > CAMIOCOMMAND ioctls just before this message. All of the > CAMIOCOMMANDs are successful, so I assume it's the device returning > some error indication. Obviously I'm getting the command parameters > screwed up. Does camcontrol use scsi(3)? How do I specify this > command? The syntax is the same as the syntax described in scsi(3). With CAM, the man pages you want are cam(3) and cam_cdbparse(3). You can also reference those pages via the names of the functions they describe. (e.g., cam_open_btl(3), csio_build(3), etc.) The cam_cdbparse(3) man page is based on the old scsi(3) man page, since it describes a lot of the functionality that I ported from the old SCSI library. Ken -- Kenneth Merry ken@plutotech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812010105.SAA12477>