Welcome to PCForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Guessing the CHS of a block device.

 
   Hardware Problem Solving Community! (Home) -> PC Storage RSS
Next:  Age of GA-M55Plus-S3G (?)  
Author Message
Seongsu Lee

External


Since: May 05, 2007
Posts: 1



(Msg. 1) Posted: Sat May 05, 2007 12:05 pm
Post subject: Guessing the CHS of a block device.
Archived from groups: comp>sys>ibm>pc>hardware>storage, others (more info?)

Hi,

Is there any way to detect the CHS information of a block device
by only a software in Linux? I think the analysis of elapse time of
reading a block which has various distance of each another.

Any comments or similar tries will be helpful. Thank you in advance.

 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Bill Todd

External


Since: Mar 26, 2005
Posts: 17



(Msg. 2) Posted: Sat May 05, 2007 4:16 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: comp>sys>ibm>pc>hardware>storage (more info?)

Seongsu Lee wrote:
> Hi,
>
> Is there any way to detect the CHS information of a block device
> by only a software in Linux? I think the analysis of elapse time of
> reading a block which has various distance of each another.
>
> Any comments or similar tries will be helpful. Thank you in advance.

Modern drives do not have a fixed CHS geometry, period. They do report
a fictitious CHS geometry, though (which may only represent a fraction
of their total size). Modern PC BIOSes use LBA rather than CHS access
for such drives; old BIOSes use the fictitious CHS figures.

Older drives (I'm SWAGging no later than mid-'90s) did have a real CHS
geometry, and IIRC reported it.

Still older drives (probably talking before 1990) had a real CHS
geometry and did not report it (or at least a PC BIOS of the same era
didn't understand any reporting that they did, and required that the
user enter the information manually).

- bill

 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Rod Speed

External


Since: Feb 01, 2006
Posts: 1570



(Msg. 3) Posted: Sat May 05, 2007 4:56 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Seongsu Lee <senux.TakeThisOut@senux.com> wrote:

> Is there any way to detect the CHS information
> of a block device by only a software in Linux?

Not really. The problem is that there isnt just one CHS value with
modern hard drives, the S varys in bands across the platter surface
and with other types of block devices like flash drives, there isnt even
any true equivalent to tracks, so there is nothing to detect timing wise.

> I think the analysis of elapse time of reading a
> block which has various distance of each another.

While true, the problem is that there isnt a true single CHS for modern hard drives.

> Any comments or similar tries will be helpful. Thank you in advance.
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Arno Wagner

External


Since: Nov 07, 2003
Posts: 1692



(Msg. 4) Posted: Sat May 05, 2007 4:56 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In comp.sys.ibm.pc.hardware.storage Seongsu Lee <senux RemoveThis @senux.com> wrote:
> Hi,

> Is there any way to detect the CHS information of a block device
> by only a software in Linux?

> I think the analysis of elapse time of
> reading a block which has various distance of each another.

> Any comments or similar tries will be helpful. Thank you in advance.

You want the physical data? With modern disks you can forget it.
Read-ahead, slim differences between trach-to-track and head-to-head,
diffrerent numbers of sectors in different tracks, different mapping
strategies to linear addresses and other things make measuring these
pretty impossible.

However you can easily get the data from the manufacturers datasheet.
Not that you really need it for anything I can think of. So the
real question is: Why do you want to do this?

Arno
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Folkert Rienstra

External


Since: Nov 10, 2003
Posts: 1690



(Msg. 5) Posted: Wed May 09, 2007 8:00 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Arno Wagner" <me.TakeThisOut@privacy.net> wrote in message news:5a472mF2nqu51U1@mid.individual.net
> In comp.sys.ibm.pc.hardware.storage Seongsu Lee <senux.TakeThisOut@senux.com> wrote:
> > Hi,

> > Is there any way to detect the CHS information of a block device
> > by only a software in Linux?

By saying 'block device' you're hinting at a logical device such as
portrayed by BIOS.
And since block structured devices have a habit of telling the bios
how their media have been organized you could just query the bios.

> > I think of analysis of elapsed time of reading blocks which have
> > various distance of each another.

So you are really hinting at mechanical block devices like harddrives.

Bingo.
Read 2 single sectors, a (potential) track length apart.
If both sectors are in the same track then to read both it will take exact-
ly the same time as when reading both sectors including those in between.
That is still the case if the second sector is on the next head and the first
sector on that track.
However, if it is the second sector on that track then it will be read imme-
diately as if it was the second sector on the previous head because tracks
are skewed such that all sectors can be read sequentially without any extra
delays. So if the time to read those 2 sectors drops below the time that is
necessary to read all sectors in between then you know they are not in the
same track. By adjusting the 2 sector distance you'll find the exact switch-
over point and voila, you have your track length in sectors. Btw, this still
goes if you start halfway or anywhere in a track and end in the next track
in the cylinder as long as you keep the distance a full track length.

Similarly you should be able to work out the number of platters/heads
by working out the different skews with different platter combinations:
Head switch time is typically several sectors going by before the new head
is ready to read again so you should be able to subtract several sectors if
you skip a head (i.e. double the distance) in your two sectors distance and
still not need an extra rev time to read that second sector. When the se-
quence of checking this for every (potential) head breaks -when a track
change becomes involved- then there you now have your number of heads.

Cylinders, now that is really tedious. You need to find every notch (band in
which the number of sectors per track is constant) change and convert the
number of sectors in every notch/band into cylinders for that notch/band
and add them all up in the end.

Btw, this is basic theory based on harddrive physical.
Converting this into practical program code involves reading more than
just 2 sectors in a track as that takes just takes 8ms (7200 rpm) to
4 ms (15k rpm) and spindle latency (time between issuing the reads and
the first sector actually coming by the head) can almost double that.
You probably also want to measure the MB/s and RPM of the drive to
calculate your sectors_per_track_test starting range.
You also need to figure out how to avoid cacheing and queueing since that
obviously interferes with how the whole physical scenario is to play out.

> > Any comments or similar tries will be helpful. Thank you in advance.

> You want the physical data? With modern disks you can forget it.

Nonsense.

> Read-ahead,

That's like saying you can't do benchmarks either. Obviously you can.
Cacheing is easy to avoid, as benchmark practice will show you.

> slim differences between trach-to-track and head-to-head,

For sectors per track they don't make a difference.
And as long as they aren't exactly the same they can be differen-
tiated between in number of sectors skewed and detected as such.

> diffrerent numbers of sectors in different tracks,

So you know you have to check the whole disk if you want the numbers
for the whole disk, so what.
Tedious, probably not practical, but doable.

> different mapping strategies to linear addresses

There aren't any, they are both linear.
The only pitfalls are the user reassigned bad sector replacements, so sing-
le address range tests are not advisable. For measuring accuracy you pro-
bably have to read several revolutions and cylinders at a time anyways.

> and other things

Other things huh, impressive.

> make measuring these pretty impossible.

Yet benchmarks manage to do access time pretty close too.
Some benchmarks/apps even manage to predict RPM very accurately.
So even with MB/s and the RPM you (approximately) have the sectors
per track calculated.

Babblebot, clueless as always.

>
> However you can easily get the data from the manufacturers datasheet.
> Not that you really need it for anything I can think of.

> So the real question is: Why do you want to do this?

Because he can, babblebot.

>
> Arno
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Folkert Rienstra

External


Since: Nov 10, 2003
Posts: 1690



(Msg. 6) Posted: Wed May 09, 2007 8:00 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bill Todd" <billtodd.TakeThisOut@metrocast.net> wrote in message news:m4-dnZca8NCWe6HbnZ2dnUVZ_j6dnZ2d@metrocastcablevision.com
> Seongsu Lee wrote:
> > Hi,
> >
> > Is there any way to detect the CHS information of a block device
> > by only a software in Linux? I think the analysis of elapse time of
> > reading a block which has various distance of each another.
> >
> > Any comments or similar tries will be helpful. Thank you in advance.
>
> Modern drives do not have a fixed CHS geometry, period. They do report
> a fictitious CHS geometry, though (which may only represent a fraction
> of their total size).

> Modern PC BIOSes use LBA rather than CHS access for such drives;

No, they don't. They offer newer services for applications and OSes
to use LBA mode. Those BIOSes still offer the older services too.
The applications and OSes decide what to use.

> old BIOSes use the fictitious CHS figures.

They don't *offer* the LBA addressing mode services.

>
> Older drives (I'm SWAGging no later than mid-'90s) did have a real CHS
> geometry, and IIRC reported it.

IDE.

>
> Still older drives (probably talking before 1990)

Before IDE and SCSI.

> had a real CHS geometry and did not report it (or at least a PC BIOS
> of the same era didn't understand any reporting that they did, and re-
> quired that the user enter the information manually).
>
> - bill
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Anton Rang

External


Since: May 15, 2007
Posts: 1



(Msg. 7) Posted: Tue May 15, 2007 11:45 am
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: comp>sys>ibm>pc>hardware>storage, others (more info?)

Seongsu Lee <senux RemoveThis @senux.com> writes:
> Is there any way to detect the CHS information of a block device
> by only a software in Linux? I think the analysis of elapse time of
> reading a block which has various distance of each another.

You could try this, but be aware that:

(a) Track-to-track seek times are smaller than rotational latency.
If you can't figure out how to deal with rotational latency,
you will have to do a very large number of reads to extract
any statistically significant measurement of what causes a seek.

(b) There's random variation in the disk introduced by such things
as temperature compensation. Again this means you'll need an
awful lot of sector reads to learn anything.

(c) Head switch times are too small to measure reliably.

(d) The number of sectors per track varies from point to point on
the drive.

What are you trying to figure out? This doesn't seem a useful thing
to do.

Anton
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Folkert Rienstra

External


Since: Nov 10, 2003
Posts: 1690



(Msg. 8) Posted: Tue May 15, 2007 8:58 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hey, is that you again, babblebot?

"Anton Rang" <rang DeleteThis @visi.com> wrote in message news:ybthcqedoj4.fsf@isis.visi.com
> Seongsu Lee <senux DeleteThis @senux.com> writes:
> > Is there any way to detect the CHS information of a block device
> > by only a software in Linux? I think the analysis of elapse time of
> > reading a block which has various distance of each another.
>
> You could try this, but be aware that:

> (a) Track-to-track seek times are smaller than rotational latency.
> If you can't figure out how to deal with rotational latency,
> you will have to do a very large number of reads to extract
> any statistically significant measurement of what causes a seek.

Uhuh. And this is helpful how exactly.
There are no seeks in sequential reading.

>
> (b) There's random variation in the disk introduced by such things
> as temperature compensation. Again this means you'll need an
> awful lot of sector reads to learn anything.

Learn what exactly.

>
> (c) Head switch times are too small to measure reliably.

Uhuh. And how does that differ from track (cylinder) switch times.

Like the babblebot you are providing problems to a solution, a solution that you don't even bother to describe.

And this has what to do with CHS, exactly?

>
> (d) The number of sectors per track varies from point to point on
> the drive.

Gee, now where did you learn that.

>
> What are you trying to figure out? This doesn't seem a useful thing
> to do.

Babblebot revisited.

>
> Anton
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Bill Todd

External


Since: Mar 26, 2005
Posts: 17



(Msg. 9) Posted: Tue May 15, 2007 8:58 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Folkert Rienstra wrote:
> Hey, is that you again, babblebot?

Shut up, Folkert. The S/N ratio in c.a.s. has been fairly decent
lately, until you crawled back out from under your rock.

Please crawl back in again.

- bill
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Buddy

External


Since: May 16, 2007
Posts: 2



(Msg. 10) Posted: Wed May 16, 2007 6:11 pm
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Bill Todd" <billtodd.RemoveThis@metrocast.net> wrote in message news:IeCdnUyqlZYxz9fbnZ2dnUVZ_uPinZ2d@metrocastcablevision.com
> Folkert Rienstra wrote:
> > Hey, is that you again, babblebot?

> Shut up, Folkert.

And you are?

> The S/N ratio in c.a.s. has been fairly decent lately,

No wonder, when no one in your group was actually able enough to
offer a solution to the OP. No one with even a glimpse of a clue.

Maybe you shut them up too?

> until you crawled back out from under your rock.
>
> Please crawl back in again.
>
> - bill
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Bill Todd

External


Since: Mar 26, 2005
Posts: 17



(Msg. 11) Posted: Thu May 17, 2007 2:50 am
Post subject: Re: Guessing the CHS of a block device. [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Buddy wrote:
> "Bill Todd" <billtodd.TakeThisOut@metrocast.net> wrote in message news:IeCdnUyqlZYxz9fbnZ2dnUVZ_uPinZ2d@metrocastcablevision.com
>> Folkert Rienstra wrote:
>>> Hey, is that you again, babblebot?
>
>> Shut up, Folkert.
>
> And you are?

Someone with a low tolerance for loud-mouthed morons.

>
>> The S/N ratio in c.a.s. has been fairly decent lately,
>
> No wonder, when no one in your group was actually able enough to
> offer a solution to the OP. No one with even a glimpse of a clue.

I addressed his apparent confusion about CHS nearly two weeks ago.
Perhaps you were snoozing and missed it. In any event, since you appear
to have nothing substantive to contribute yourself...

- bill
 >> Stay informed about: Guessing the CHS of a block device. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Bad Block - Hi, have a dell laptop (seagate 40gb hd) running win xp ntfs partition since yesterday i have two entries in my event viewer Event ID 7 The device \device\harddisk0\d has a bad block, went onto the seagate website ran the online tests, the results...

setting block mode on IBM LTO - I need some help on how I can check/set the block mode (fixed or variable) on an IBM 3582 LTO2 fibre channel tape library. The unit is posting errors mentioning that the drive is set to fixed mode whilst doing snap backups directly from a NetApp filer. ...

Abort: 15121, read bios parameter block, unknown fat type .. - Can't get Norton Ghost 2003 to run on 5100 Dell Inspiron Notebook - Abort: 15121, read bios parameter block, unknown fat type Ok Ghost worked the first time, but after that it stopped working. All I get is the following error message: An..

storage/mp3 device - Hi I have just purchased a new 256 MB MP3/storage device. When I connect to my PeeCee the plug n play kicks in but I then get the following error message: The file 'ACTDISK.sys' on USB Mass Storage Device is needed. Type the path where the file is..

device names on windows xp - here is my drive config ide0: 20gig maxtor - drive c ide0-secondary: 40gig WD drive d (windows installation) ide1: 40gig ibm - drive e (swap is on this drive) ide1-secondary - cd burner promise controller slot0: 80gig maxtor - drive j slot1: 120gig..
   Hardware Problem Solving Community! (Home) -> PC Storage All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]