NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: disk geometry (i386/amd64)



    Date:        Mon, 10 Sep 2018 17:37:53 -0700
    From:        Don NetBSD <netbsd-embedded%gmx.com@localhost>
    Message-ID:  <c4a8624f-ba93-39ef-e81d-e37cb3f2ec03%gmx.com@localhost>


  | So, I can use the 'd' partition to access the medium (after unlocking the label
  | portion).  But, I can't count on anything else "displayed" by disklabel.  And,
  | I can't count on even the displayed values for the d partition if something
  | tinkers with the in-kernel label before I get a peek at it.

That's all correct.

  | > The raw partition allows this.
  |
  | Again, as long as nothing else tinkers with the in-kernel copy of the disklabel
  | before I look at it.

No, regardless of that.   Access to the raw partition ignores whatever is
in the label, always.   If not, there'd be no way to fix a badly broken label
(as in, if the label said that the size of the raw partition was 0 sectors.)


  | > - DIOCGDISKINFO (using proplib!)
  | > - fall back to DIOCGDINFO if that failed
  |
  | Why would it have failed?

if it were not implemented I think was the intent there.   That is, so the
code could work on various different versions of the system (be reasonably
portable) - and possibly also because (this I am not sure about) not all
drivers might implement the new method (yet).

  | [I also need to query the SMART structures and other disk parameters
  | but I can workaround that]

SMART (what a name for something so simplistic) is available too.   No idea how,
but there are commands that get at it (and make changes) so it is clearly possible.

  | I want the same sort of access -- but to the disk controller.

Disks are a little more more uniform and have a better structured command
set than the parallel port, so it is possible that there may be some
interference from the driver that simply knows that some things are
possible, and others are not - even if you disagree.

But just reading/writing arbitrary blocks on the drive should be possible.

kre



Home | Main Index | Thread Index | Old Index