Re: LS-120 Formatting?

Paul Flinders (paul@dawa.demon.co.uk)
Sat, 19 Dec 1998 18:56:50 GMT


Alex Butcher writes:
> On 19 Dec 1998, Paul Flinders wrote:
>
> > "Alex Butcher(linkern)" <linkern@cocoa.demon.co.uk> writes:
> > >
> > > My guess is that seeing as the LS-120 is an ATAPI device, you probably want
> > > to modify a low-level SCSI formatter to do the job for you. Once you've
> > > LL formatted it, just chuck a filesystem on it, be it FAT or ext2fs.
> >
> > It is ATAPI. I tried the SCSI emulator and my LS120 doesn't appear to
> > work under it - this may warrent more investigation.
>
> Hmmm. I would have expected that it would show up as a /dev/sd? device. If
> that was the case you (sh|w)ould be able to use scsifmt unchanged.

It worked in the sense that it appeared as /dev/sda but I couldn't actually
use it as a drive - I didn't try scsifmt on it via the emulator (but see
the end of the message).

>
> > > Look for scsifmt.lsm and you'll find my low-level SCSI formatter that I
> > > wrote for Zip drives. I believe that ATAPI even uses the same command
> > > numbers, but failing that, you could always try using the ide-scsi emulation
> > > in the kernel... :)
> >
> > Ok, that could be very useful. At the moment I'm hoping that the LS120
> > supports "FORMAT_UNIT" which should make it very easy.
>
> >From drivers/block/ide-floppy.c:
>
> /*
> * ATAPI floppy drive packet commands
> */
> #define IDEFLOPPY_FORMAT_UNIT_CMD 0x04
>
> Coincidence that it's 0x04, the same as SCSI's FORMAT_UNIT command?

I hadn't noticed until your message that the command bytes are listed
in ide-floppy.c but it isn't a coincidence as ATAPI commands are based
on SCSI commands.

Since it's quite easy to construct a packet command within the kernel I
just added an ioctl command to ide-floppy which sends a FORMAT_UNIT to the
drive. It doesn't work and I get the following error

ide-floppy: hdb: I/O error, pc = 4, key = 5, asc = 24, ascq = 0

however this is actually encouraging because sense key 5/asc 24 means
that there was an error in the command parameter block but the command
_was_ recognised (you get asc=20 back for an invalid command).

I had sent a parameter block of all zeros which is what scsifmt does
so I'm not sure that using the scsi emulation and scsifmt would be
more successful. I don't know if the format command follows the SCSI
standard - I do have some details for a SCSI disk but playing with the
most likely values (interleave mainly) doesn't seem to produce a
result.

So it's back to the drawing board for the moment.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/