Does disklabel not like my hard drive, or is drive bad?

Does disklabel not like my hard drive, or is drive bad?

Post by Geoffrey C. Speiche » Sun, 25 Oct 1998 04:00:00



I have a Micropolis 4GB Wide SCSI drive, and I'm having trouble getting
a disklabel on it.  I have 2 other drives that labeled fine.  This drive
(model 3243W) is documented as having 3,956 cylinders, variable sectors
per track.  Here's how FreeBSD sees it:

da2: <MICROP 3243-19   1128RV 28RV> Fixed Direct Access SCSI2 device
da2: 20.0MB/s transfers (10.0MHz, offset 8, 16bit), Tagged Queueing
Enabled
da2: 4095MB (8388315 512 byte sectors: 255H 63S/T 522C)

I'm now using CAM in 3.0-RELEASE, but the same problem existed under
pre-CAM 3.0-CURRENT.  fdisk works fine (after I adjusted the geometry to
match what the kernel reported).  Geometry shouldn't be a problem
because the disk is dedicated to FreeBSD.  Here's what the partition
table looks like:

# fdisk da2
******* Working on device /dev/rda2 *******
parameters extracted from in-core disklabel are:
cylinders=522 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=522 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 63, size 8385867 (4094 Meg), flag 80 (active)
        beg: cyl 0/ sector 1/ head 1;
        end: cyl 521/ sector 63/ head 254
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
#

I have absolutely no luck labeling the slice, as witnessed below:

# disklabel da2s1
disklabel: ioctl DIOCGDINFO: Invalid argument
# disklabel -w -r da2s1 auto
disklabel: ioctl DIOCGDINFO: Invalid argument
disklabel: auto: unknown disk type
#

I can view the drive label on da2 (no slice), but here's what happens
when I try to modify it:

# disklabel -e sd2
<edit disklabel in vi>
disklabel: Operation not supported by device
re-edit the label? [y]: n
# disklabel -e -r da2
<edit disklabel in vi>
disklabel: ioctl DIOCWLABEL: Operation not supported by device
#

The really strange part about this is that up until very recently, the
drive held Win95 and WinNT on two partitions.  I scrapped them in favor
of more BSD disk space, but it's apparently still sick from the
Microsoft OSes, even after the low-level format.  Maybe the drive needs
some chicken soup?

I was originally under the impression that the drive had silently gone
bad on me, but now I'm not so sure.  The da0 and da1 labels are in-core,
and their slices are on-disk.  The da2 (the drive in question) label is
on-disk, and the slice label won't go anywhere.  Does this have anything
to do with the real problem?

Thanks,
Geoff

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by J Wuns » Wed, 28 Oct 1998 04:00:00



Quote:>   Geometry shouldn't be a problem
> because the disk is dedicated to FreeBSD.

          ^^^^^^^^^^^^^^^^^^^^^

Quote:> # fdisk da2
...
> sysid 165,(FreeBSD/NetBSD/386BSD)
>     start 63, size 8385867 (4094 Meg), flag 80 (active)
>         beg: cyl 0/ sector 1/ head 1;

               ^^^^^^^^^^^^^^^^^^^^^^^^ (indeed)

Quote:>         end: cyl 521/ sector 63/ head 254
> I have absolutely no luck labeling the slice, as witnessed below:

> # disklabel da2s1
> disklabel: ioctl DIOCGDINFO: Invalid argument
> # disklabel -w -r da2s1 auto
> disklabel: ioctl DIOCGDINFO: Invalid argument
> disklabel: auto: unknown disk type

`auto' doesn't work for sliced disks (or at least, sometimes it
doesn't work, i never bothered to figure out since i don't have sliced
disks).  But wait!, you don't have a sliced disk.

Did you ever try

  disklabel -Brw da2 auto

That's supposed to work.  Don't forget to create the /dev nodes for
da2 first!  (Strange results will happen if you forget this.)

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Geoffrey C. Speiche » Wed, 28 Oct 1998 04:00:00



> `auto' doesn't work for sliced disks (or at least, sometimes it
> doesn't work, i never bothered to figure out since i don't have sliced
> disks).  But wait!, you don't have a sliced disk.

> Did you ever try

>   disklabel -Brw da2 auto

> That's supposed to work.  Don't forget to create the /dev nodes for
> da2 first!  (Strange results will happen if you forget this.)

Oooh, check this out.  Here's what I get (yes, /dev/{,r}da2* are all
there, and I even remade them fresh just in case!):

# disklabel -Brw da2 auto
disklabel: ioctl DIOCWLABEL: Operation not supported by device
#

That's annoying for several reasons, primarily because there's already a
label on the media.  The really exciting part is that the failed
disklabel attempt fudges my partition table, making it look like this:

# fdisk da2
******* Working on device /dev/rda2 *******
parameters extracted from in-core disklabel are:
cylinders=522 heads=255 sectors/track=63 (16065 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=522 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
<UNUSED>
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 0, size 50000 (24 Meg), flag 80 (active)
        beg: cyl 0/ sector 1/ head 0;
        end: cyl 1023/ sector 63/ head 255
#

Don't that beat all?  The fdisk table is only (or rather, always)
corrupted when -B is used with disklabel.

Is there something peculiar about the disk?  It appears to be in good
shape.  Though the primary defect list is rather lengthy (thank you,
Micropolis), it hasn't grown any known defects:

# camcontrol defects -u 2 -G -f block
Got 0 defects.
#

But then again, my "good" drives won't even tell me that much:

# camcontrol defects -u 1 -G -f block
camcontrol: Error returned from read defect data command
# camcontrol defects -u 0 -G -f block
camcontrol: Error returned from read defect data command

I'd just as soon use the drive as a bookend than wrestle with it
anymore, but it seems a terrible waste of 4 fast Wide-SCSI gigabytes...
though it would look good on the shelf opposite the 40MB Seagate I've
got there now. :)

I DEFY YOU ALL TO FIND A SOLUTION!!  KREEGAH!  BUNDALO!

(That statement works much better if you picture Dogbert saying it.)

Geoff

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Geoffrey C. Speiche » Thu, 29 Oct 1998 04:00:00



> I have a Micropolis 4GB Wide SCSI drive, and I'm having trouble getting
> a disklabel on it.  I have 2 other drives that labeled fine.  This drive
> (model 3243W) is documented as having 3,956 cylinders, variable sectors
> per track.  Here's how FreeBSD sees it:

For anyone else baffled by this problem, worry no more. The drive just
finally failed a media check, and it's been added to my collection of
decorative bookends.  Thanks anyway!

Geoff

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Ted Mittelstaed » Fri, 30 Oct 1998 04:00:00





> For anyone else baffled by this problem, worry no more. The drive just
> finally failed a media check, and it's been added to my collection of
> decorative bookends.  Thanks anyway!

This is very common with SCSI drives, as many times the drive receives a
command or two during it's lifetime that happens to turn off sector
remapping in the drive.

The solution is to boot the system and assuming your using a reasonable PCI
scsi card you press Cntl-B or Cntl-A at the BIOS prompt during the BIOS
code execution, you will call up a configuration menu on the SCSI card.
This will allow you to issue FORMAT MEDIA commands to the drive which will
force it to reset it's block mapping electronics, verify it's entire disk
surface, and lock out the bad sectors, thus restoring it to it's ideal of
perfection

Of course doing this utterly destroys every s*of data on the disk.

Ted

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Geoffrey C. Speiche » Fri, 30 Oct 1998 04:00:00



> card. This will allow you to issue FORMAT MEDIA commands to the drive
> which will force it to reset it's block mapping electronics, verify it's
> entire disk surface, and lock out the bad sectors, thus restoring it to

Exactly.  It was my (AHA-2940UW) SCSI BIOS "verify media" that failed.
That was immediately after a low-level format of said defunct Micropolis
drive.  I settled for the Micropolis a few years ago when the Seagate UW
equivalent was backordered.  I should have waited.  :)

He's dead, Jim.

On a mildly related note, does anyone know what CAM command replaces
scsiformat(8)?

Geoff

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Steven G. Kar » Fri, 30 Oct 1998 04:00:00




Quote:

> On a mildly related note, does anyone know what CAM command replaces
> scsiformat(8)?

camcontrol(8)

--
Steve


http://troutmask.apl.washington.edu/~clesceri/kargl.html

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by J Wuns » Fri, 30 Oct 1998 04:00:00



Quote:> Oooh, check this out.  Here's what I get (yes, /dev/{,r}da2* are all
> there, and I even remade them fresh just in case!):

> # disklabel -Brw da2 auto
> disklabel: ioctl DIOCWLABEL: Operation not supported by device

I recently checked, since a friend had the same problem.  It was
really that one of the /dev entries was missing (i think /dev/rda2c).
Well, this was still with the old names in /dev (sd something), i
wouldn't assume the naming makes a difference?

`Operation not supported by device' is something like `your program
attempted to use the wrong device node to do this'.

Quote:> That's annoying for several reasons, primarily because there's already a
> label on the media.  The really exciting part is that the failed
> disklabel attempt fudges my partition table, making it look like this:

> # fdisk da2
> The data for partition 4 is:
> sysid 165,(FreeBSD/NetBSD/386BSD)
>     start 0, size 50000 (24 Meg), flag 80 (active)
>         beg: cyl 0/ sector 1/ head 0;
>         end: cyl 1023/ sector 63/ head 255

That's the `dummy' table that's written inside the BSD bootstrap.  If
this disk is really meant to be BSD-only, this is nothing to worry.

After it wrote that table, did you try booting again?  This fdisk
table should be understood as `magic' by the slice code, so it would
drop any and all ideas about slices for this disk (which is basically
what you want for a fully dedicated drive).

The occasions where disklabel -B trashes the fdisk table are mentioned
in the man page.

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Geoffrey C. Speiche » Sat, 31 Oct 1998 04:00:00



> > On a mildly related note, does anyone know what CAM command replaces
> > scsiformat(8)?

> camcontrol(8)

Let me rephrase:

Does anyone know how to use camcontrol to format a SCSI drive?  ;)

I assume you can do it with 'camcontrol -c <format command> ...' but I
don't know SCSI CDB's and am not that motivated to look them up right
now since the drive I wanted to format is dead!  I'd expect a 'format'
command for camcontrol (e.g. 'camcontrol format -u 2'), especially since
SCSI formatting deserved its own utility in the past.  It seemse silly
to make a user learn SCSI commands to format a drive (not that I'm
adverse to learning SCSI commands, mind you).

Geoff

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Geoffrey C. Speiche » Sat, 31 Oct 1998 04:00:00



> I recently checked, since a friend had the same problem.  It was
> really that one of the /dev entries was missing (i think /dev/rda2c).
> Well, this was still with the old names in /dev (sd something), i
> wouldn't assume the naming makes a difference?

It shouldn't, but actually in this case it does.  The sd? entries have a
corresponding control entry (e.g. sd2.ctl), which (I assume) are used
for calls to ioctl().  The new da? entries have no such control file.
So disklabel needs both sd?.ctl and sd?, or just da?.

The catch?  The CAM 3.0 /dev/MAKEDEV script doesn't build sd?.ctl nodes
and I don't have one.

Quote:> After it wrote that table, did you try booting again?  This fdisk
> table should be understood as `magic' by the slice code, so it would
> drop any and all ideas about slices for this disk (which is basically
> what you want for a fully dedicated drive).

Hmmmmm...  now you're tempting me to go fetch the new bookend and give
it another whirl.  Maybe I could use it for /usr/obj and /tmp .  I
wonder how long until the whole drive dies??  :)

Geoff

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by Steven G. Kar » Sat, 31 Oct 1998 04:00:00





>> > On a mildly related note, does anyone know what CAM command replaces
>> > scsiformat(8)?

>> camcontrol(8)

> Let me rephrase:

> Does anyone know how to use camcontrol to format a SCSI drive?  ;)

> I assume you can do it with 'camcontrol -c <format command> ...' but I
> don't know SCSI CDB's and am not that motivated to look them up right
> now since the drive I wanted to format is dead!  I'd expect a 'format'
> command for camcontrol (e.g. 'camcontrol format -u 2'), especially since
> SCSI formatting deserved its own utility in the past.  It seemse silly
> to make a user learn SCSI commands to format a drive (not that I'm
> adverse to learning SCSI commands, mind you).

If you want to try a low level format of the harddrive, then report
your machine.  During the POST hit <ctl>-A (or equivalent) to drop into
the BIOS routines for your scsi control.  You should be able to
do a low level format from there.

If you want to do it with camcontrol, you'll have to be more movitated.

--
Steve


http://troutmask.apl.washington.edu/~clesceri/kargl.html

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by J Wuns » Sat, 31 Oct 1998 04:00:00



Quote:>> On a mildly related note, does anyone know what CAM command replaces
>> scsiformat(8)?

> camcontrol(8)

More specifically,

  camcontrol cmd -u <unit #> -c '4 0 0 0 0 0'

Probably you also have to bump the timeout, some drives take more than
an hour to complete formatting.

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

Does disklabel not like my hard drive, or is drive bad?

Post by J Wuns » Mon, 02 Nov 1998 04:00:00



Quote:> It shouldn't, but actually in this case it does.  The sd? entries have a
> corresponding control entry (e.g. sd2.ctl), which (I assume) are used
> for calls to ioctl().  The new da? entries have no such control file.
> So disklabel needs both sd?.ctl and sd?, or just da?.

They were only needed to pass ioctl()'s down to the SCSI layers (so
you could bypass normal open() checks for regular devices).  CAM has
eliminated them by the SCSI passthrough device abstraction.

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

1. Does Inode with bad node inevitably mean a bad hard drive?

Hi,

I was simultaneously doing a bunch of stuff (word-processing in
StarOffice, burning a CDRW while the image was still mounted to
/mnt/cdrom) when things just kind of stopped working and froze up.
When I went to reboot, a file check was forced and I was brought to
the following message:

Inode 149285 (/usr/share/config/klpqrc) has a bad mode (075472).

The message says to run fsck w/out any options. When I give root
password, I'm popped into bash but everything is read only. I'm
putzing around with fsck but not really sure what to do with it.

Other postings lead me to believe that the drive is hosed, but I want
to confirm before I break the news to the Mrs.

I hadn't really gotten that far with this system so there wasn't much
data to speak of other than the precious modules.conf (configuring
network card and CDRW was time-consuming), and I was able to copy that
to floppy.

ANy advice greatly appreciated.

Many thanks!

Regards,

Phil Glaser

2. how can I fix: 0516-1147 lv 'may be partially mirrored' ?

3. copying hard drive to hard drive

4. I don't know how to set up my sound board under Red Hat !

5. Can SUSE 7.2 be installed from a local hard drive to a local hard drive

6. locale-sensitive logging for Sol2.4 by non-root process

7. How to merge two hard drive into one logical hard drive for Linux

8. kdeadmin-2.0 will not compile :(

9. Hard Drive to Hard Drive Copy

10. Large IDE Hard Drive as a Second Hard Drive

11. Two hard drives to a single hard drive

12. Disk Druid , mount hard drive, partitioning hard drive

13. Once a Linux Hard Drive ALWAYS a Linus Hard Drive???