util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* does util-linux have a 'report sector size' util?
@ 2019-03-11 20:57 L A Walsh
  2019-03-11 21:21 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 7+ messages in thread
From: L A Walsh @ 2019-03-11 20:57 UTC (permalink / raw)
  To: util-linux


Trying to track down why my 4K drives no longer display 4K
in sysfs (/sys) and don't seem to show individual disk
drive information.  When I first got the drives, linux displayed
the correct physical disk size, but when I look now, I only
see 512. 

I just checked with MegaCLI, and it can still display all
the data (harddisk manuf. in each bah, and physical sector size).

So I'm wonder if util-linux has something in its blk library
about this?



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: does util-linux have a 'report sector size' util?
  2019-03-11 20:57 does util-linux have a 'report sector size' util? L A Walsh
@ 2019-03-11 21:21 ` Dr. David Alan Gilbert
  2019-03-11 21:34   ` L A Walsh
  0 siblings, 1 reply; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2019-03-11 21:21 UTC (permalink / raw)
  To: L A Walsh; +Cc: util-linux

* L A Walsh (lkml@tlinx.org) wrote:
> 
> Trying to track down why my 4K drives no longer display 4K
> in sysfs (/sys) and don't seem to show individual disk
> drive information.  When I first got the drives, linux displayed
> the correct physical disk size, but when I look now, I only
> see 512. 
> 
> I just checked with MegaCLI, and it can still display all
> the data (harddisk manuf. in each bah, and physical sector size).
> 
> So I'm wonder if util-linux has something in its blk library
> about this?

Is this one of the PHY-SEC or LOG-SEC fields that lsblk can print?

[dg@major ~]$ lsblk -o "NAME,PHY-SEC,LOG-SEC"
NAME                                            PHY-SEC LOG-SEC
sda                                                 512     512

Dave

> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: does util-linux have a 'report sector size' util?
  2019-03-11 21:21 ` Dr. David Alan Gilbert
@ 2019-03-11 21:34   ` L A Walsh
  2019-03-12  8:21     ` Karel Zak
  0 siblings, 1 reply; 7+ messages in thread
From: L A Walsh @ 2019-03-11 21:34 UTC (permalink / raw)
  To: Dr. David Alan Gilbert; +Cc: util-linux

On 3/11/2019 2:21 PM, Dr. David Alan Gilbert wrote:
> * L A Walsh (lkml@tlinx.org) wrote:
>> Trying to track down why my 4K drives no longer display 4K
>> in sysfs (/sys) and don't seem to show individual disk
>> drive information.  When I first got the drives, linux displayed
>> the correct physical disk size, but when I look now, I only
>> see 512.
>
> Is this one of the PHY-SEC or LOG-SEC fields that lsblk can print?
>
> [dg@major ~]$ lsblk -o "NAME,PHY-SEC,LOG-SEC"
> NAME                                            PHY-SEC LOG-SEC
> sda                                                 512     512
---
    It would be, if it was correct.  Megacli displays:

   Sector Size:  512
   Logical Sector Size:  512
   Physical Sector Size:  4096

But lsblk displays 512 for everything.  The disk says it uses a 512e format
with the 'e' meaning it emulates 512 even if not 512.

---
I'm also seeing the linkspeed, NCQ setting, drive temperature and
Manufacturers serial number -- all things I would expect out of the
kernel.  I thought I remembered seeing temps displayed in linux as
well.  Hmmmm.

Thanks for the pointer & response!

>
> Dave
>




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: does util-linux have a 'report sector size' util?
  2019-03-11 21:34   ` L A Walsh
@ 2019-03-12  8:21     ` Karel Zak
  2019-03-12 15:02       ` L A Walsh
  0 siblings, 1 reply; 7+ messages in thread
From: Karel Zak @ 2019-03-12  8:21 UTC (permalink / raw)
  To: L A Walsh; +Cc: Dr. David Alan Gilbert, util-linux

On Mon, Mar 11, 2019 at 02:34:46PM -0700, L A Walsh wrote:
> On 3/11/2019 2:21 PM, Dr. David Alan Gilbert wrote:
> > * L A Walsh (lkml@tlinx.org) wrote:
> >> Trying to track down why my 4K drives no longer display 4K
> >> in sysfs (/sys) and don't seem to show individual disk
> >> drive information.  When I first got the drives, linux displayed
> >> the correct physical disk size, but when I look now, I only
> >> see 512.
> >
> > Is this one of the PHY-SEC or LOG-SEC fields that lsblk can print?
> >
> > [dg@major ~]$ lsblk -o "NAME,PHY-SEC,LOG-SEC"
> > NAME                                            PHY-SEC LOG-SEC
> > sda                                                 512     512
> ---
>     It would be, if it was correct.  Megacli displays:
> 
>    Sector Size:  512
>    Logical Sector Size:  512
>    Physical Sector Size:  4096
> 
> But lsblk displays 512 for everything.  The disk says it uses a 512e format
> with the 'e' meaning it emulates 512 even if not 512.

lsblk, fdisk, blockdev, ... but all of the utils read the information
from kernel. So, it depends how the device reports topology to the
kernel.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: does util-linux have a 'report sector size' util?
  2019-03-12  8:21     ` Karel Zak
@ 2019-03-12 15:02       ` L A Walsh
  2019-03-12 18:11         ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 7+ messages in thread
From: L A Walsh @ 2019-03-12 15:02 UTC (permalink / raw)
  To: Karel Zak; +Cc: Dr. David Alan Gilbert, util-linux

On 3/12/2019 1:21 AM, Karel Zak wrote:
> On Mon, Mar 11, 2019 at 02:34:46PM -0700, L A Walsh wrote:
>   
>> On 3/11/2019 2:21 PM, Dr. David Alan Gilbert wrote:
>>     
>>> * L A Walsh (lkml@tlinx.org) wrote:
>>>       
>>>> Trying to track down why my 4K drives no longer display 4K
>>>> in sysfs (/sys) and don't seem to show individual disk
>>>> drive information.  When I first got the drives, linux displayed
>>>> the correct physical disk size, but when I look now, I only
>>>> see 512.
>>>>         
>>> Is this one of the PHY-SEC or LOG-SEC fields that lsblk can print?
>>>
>>> [dg@major ~]$ lsblk -o "NAME,PHY-SEC,LOG-SEC"
>>> NAME                                            PHY-SEC LOG-SEC
>>> sda                                                 512     512
>>>       
>> ---
>>     It would be, if it was correct.  Megacli displays:
>>
>>    Sector Size:  512
>>    Logical Sector Size:  512
>>    Physical Sector Size:  4096
>>
>> But lsblk displays 512 for everything.  The disk says it uses a 512e format
>> with the 'e' meaning it emulates 512 even if not 512.
>>     
>
> lsblk, fdisk, blockdev, ... but all of the utils read the information
> from kernel. So, it depends how the device reports topology to the
> kernel.
>   
Well, that's what I would think but I can't see why the device driver
would have been purposely changed to hide the actual physical size or
the temperature.  That said, megacli has to be reading those values
from somewhere -- and I'd tend to think it was accessing the driver as
well, but that begs the question -- where is it getting the temperature
and physical size from>?

It can even read the serial numbers off the disks.

I'm not sure if it is opensource or not.
*sigh*

>     Karel
>
>   


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: does util-linux have a 'report sector size' util?
  2019-03-12 15:02       ` L A Walsh
@ 2019-03-12 18:11         ` Dr. David Alan Gilbert
  2019-03-15 14:05           ` Re:why would 4k size for phys sector size read in kernel, go away? L A Walsh
  0 siblings, 1 reply; 7+ messages in thread
From: Dr. David Alan Gilbert @ 2019-03-12 18:11 UTC (permalink / raw)
  To: L A Walsh; +Cc: Karel Zak, Dr. David Alan Gilbert, util-linux

* L A Walsh (lkml@tlinx.org) wrote:
> On 3/12/2019 1:21 AM, Karel Zak wrote:
> > On Mon, Mar 11, 2019 at 02:34:46PM -0700, L A Walsh wrote:
> >   
> >> On 3/11/2019 2:21 PM, Dr. David Alan Gilbert wrote:
> >>     
> >>> * L A Walsh (lkml@tlinx.org) wrote:
> >>>       
> >>>> Trying to track down why my 4K drives no longer display 4K
> >>>> in sysfs (/sys) and don't seem to show individual disk
> >>>> drive information.  When I first got the drives, linux displayed
> >>>> the correct physical disk size, but when I look now, I only
> >>>> see 512.
> >>>>         
> >>> Is this one of the PHY-SEC or LOG-SEC fields that lsblk can print?
> >>>
> >>> [dg@major ~]$ lsblk -o "NAME,PHY-SEC,LOG-SEC"
> >>> NAME                                            PHY-SEC LOG-SEC
> >>> sda                                                 512     512
> >>>       
> >> ---
> >>     It would be, if it was correct.  Megacli displays:
> >>
> >>    Sector Size:  512
> >>    Logical Sector Size:  512
> >>    Physical Sector Size:  4096
> >>
> >> But lsblk displays 512 for everything.  The disk says it uses a 512e format
> >> with the 'e' meaning it emulates 512 even if not 512.
> >>     
> >
> > lsblk, fdisk, blockdev, ... but all of the utils read the information
> > from kernel. So, it depends how the device reports topology to the
> > kernel.
> >   
> Well, that's what I would think but I can't see why the device driver
> would have been purposely changed to hide the actual physical size or
> the temperature.  That said, megacli has to be reading those values
> from somewhere -- and I'd tend to think it was accessing the driver as
> well, but that begs the question -- where is it getting the temperature
> and physical size from>?
> 
> It can even read the serial numbers off the disks.

I think that's an easy one :-)

> I'm not sure if it is opensource or not.
> *sigh*

megacli is a special for LSI RAID controllers isn't it?
If so, then perhaps the RAID controller is hiding some info depending
on how it's configured and using a special to get the info from the controller.

How about trying one of the SCSI utils, like sginfo -a ?

Dave



> 
> >     Karel
> >
> >   
> 
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re:why would 4k size for phys sector size read in kernel, go away?
  2019-03-12 18:11         ` Dr. David Alan Gilbert
@ 2019-03-15 14:05           ` L A Walsh
  0 siblings, 0 replies; 7+ messages in thread
From: L A Walsh @ 2019-03-15 14:05 UTC (permalink / raw)
  To: Dr. David Alan Gilbert; +Cc: Karel Zak, util-linux

On 3/12/2019 11:11 AM, Dr. David Alan Gilbert wrote:
>
>
> megacli is a special for LSI RAID controllers isn't it?
> If so, then perhaps the RAID controller is hiding some info depending
> on how it's configured and using a special to get the info from the controller.
>
> How about trying one of the SCSI utils, like sginfo -a ?
>   
It didn't show anything about blocksize logical or physical.

The only thing I see Megacli doing s searching through
/sys/, it seems to find the name of the controller,

then opening (FD3)
"/dev/megaraid_sas_ioctl_node

then issuing a bunch of

ioctl(3, MCE_GET_RECORD_LEN or MEMGETINFO or MTRRIOC_SET_ENTRY, 0x7cb9e0)

calls after which it dumps all the info about the disks in the RAIDS.
Of note.. these are disks in external enclosures that are
connected via the LSI controller.

Also of note, I am certain that the physical size of the blocks
for the 4K blocks used to show 4096 bytes as I had written
scripts to pull this information.

I also am fairly sure I remember seeing the temperatures listed
somewhere, but I didn't write a supporting script to display
that info.

While megacli does seem to use an ioctl of the device,
(haven't looked at source of driver yet) that doesn't negate that
sysfs USED to display the correct blocksize.  My minor concern is that
if the kernel doesn't know the real size of the blocks, no way
disk utils will know and have concerns about something eventually
getting it off by 1 or such.  Depending on what disk it is, I might
not notice it until it was a large pain to reformat it correctly.

FWIW, I've been unable to find a source for megacli...






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-15 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 20:57 does util-linux have a 'report sector size' util? L A Walsh
2019-03-11 21:21 ` Dr. David Alan Gilbert
2019-03-11 21:34   ` L A Walsh
2019-03-12  8:21     ` Karel Zak
2019-03-12 15:02       ` L A Walsh
2019-03-12 18:11         ` Dr. David Alan Gilbert
2019-03-15 14:05           ` Re:why would 4k size for phys sector size read in kernel, go away? L A Walsh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).