<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Linux see LUN/disk bigger in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571359#M39434</link>
    <description>&lt;!--!*#--&gt;This is another consequence of confusion between 1000 vs 1024-based unit prefixes when measuring computer storage.&lt;BR /&gt;&lt;BR /&gt;With larger units, this can lead to significant display deviations:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://en.wikipedia.org/wiki/Binary_prefix#Deviation_between_binary_and_decimal_interpretations" target="_blank"&gt;http://en.wikipedia.org/wiki/Binary_prefix#Deviation_between_binary_and_decimal_interpretations&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If "inq" uses 1024-based prefixes, the LUN size would be 543 053 774 848 bytes.&lt;BR /&gt;&lt;BR /&gt;The fdisk interprets that value using 1000-based unit prefixes, resulting in 543 GB.&lt;BR /&gt;&lt;BR /&gt;You can verify this by running "fdisk -l &lt;LUN&gt;" on your LUN and reading the first non-blank line of the output. It should be something like:&lt;BR /&gt;&lt;BR /&gt;Disk /dev/sda: 160.0 GB, 160041885696 bytes&lt;BR /&gt;&lt;BR /&gt;To eliminate this confusion, a new set of unit prefixes was standardized in 2005 (see the wikipedia URL above).&lt;BR /&gt;&lt;BR /&gt;According to those standards, the inq tool should list the size as 530325952 KiB, not 530325952 KB.&lt;BR /&gt;&lt;BR /&gt;It might be useful if Linux fdisk would show the size of the disk in both ways. In your case, the LUN size might be indicated as 543.0 GB / 505.7 GiB.&lt;BR /&gt;&lt;BR /&gt;-------&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Jan 20 12:55:50 tneld67n kernel: SCSI device sdbt: 83886080 512-byte hdwr sectors (42950 MB)&lt;BR /&gt;&amp;gt; LUN Capacity(Megabytes): 40960&lt;BR /&gt;&amp;gt; LUN Capacity(Blocks): 83886080&lt;BR /&gt;&lt;BR /&gt;The size in sectors a.k.a. blocks is exactly the same, so the difference in megabyte values is a display problem only.&lt;BR /&gt;&lt;BR /&gt;83886080 sectors * 512 bytes/sector =&lt;BR /&gt;42949672960 bytes.&lt;BR /&gt;&lt;BR /&gt;In 1000-based units, this is:&lt;BR /&gt;42949672960 / 1000   = 42949672 KB&lt;BR /&gt;42949672960 / 1000^2 = 42950 MB (rounded up)&lt;BR /&gt;42949672960 / 1000^3 = 42.9 GB&lt;BR /&gt;&lt;BR /&gt;In 1024-based units, this is:&lt;BR /&gt;42949672960 / 1024   = 41943040 KiB&lt;BR /&gt;42949672960 / 1024^2 = 40960 MeB&lt;BR /&gt;42949672960 / 1024^3 = 40.0 GiB (exact)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; read failed after 0 of 4096 at 42949607424&lt;BR /&gt;&lt;BR /&gt;The read operation would have ended at byte location 42949607424 + 4096 = 42949611520.&lt;BR /&gt;&lt;BR /&gt;end of disk:           42949672960&lt;BR /&gt;end of read operation: 42949611520&lt;BR /&gt;----------------------------------&lt;BR /&gt;                             61440&lt;BR /&gt;&lt;BR /&gt;The difference is positive, so the access should have fit nicely within the LUN!&lt;BR /&gt;&lt;BR /&gt;Looks like the explanation given to you was... hasty. &lt;BR /&gt;&lt;BR /&gt;MK&lt;/LUN&gt;</description>
    <pubDate>Tue, 26 Jan 2010 13:58:12 GMT</pubDate>
    <dc:creator>Matti_Kurkela</dc:creator>
    <dc:date>2010-01-26T13:58:12Z</dc:date>
    <item>
      <title>Linux see LUN/disk bigger</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571358#M39433</link>
      <description>&lt;BR /&gt;Red Hat Enterprise Linux AS release 4 (Nahant Update 7)&lt;BR /&gt;&lt;BR /&gt; 2.6.9-78.0.24.0.1.ELsmp #1 SMP Tue Jun 2 16:02:43 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux&lt;BR /&gt;&lt;BR /&gt;Array EMC Clariion CX500&lt;BR /&gt;&lt;BR /&gt;LUN size is not matching with the size showing in the linux&lt;BR /&gt;kernel level ( This is happening across all the versions of RHEL AS linux).&lt;BR /&gt;&lt;BR /&gt;ALU#  Raid Grp#        Raid Type     Size/MB's  Host(fdisk) Host(INQ)KB  &lt;BR /&gt;25       RG0           Raid 5        517896       543.0 GB   530325952 &lt;BR /&gt;&lt;BR /&gt;As you can see the array/inq reports the "right" size, but the fdisk report a higer size.It is true for all the LUNs we checked. &lt;BR /&gt;&lt;BR /&gt;HERE IS why asking the above question. I had the follwoing error "/dev/emcpowerx: read failed after 0 of 4096 at 42949607424: Input/output error" and it was explained as BELOW.&lt;BR /&gt;&lt;BR /&gt;sometimes Linux kernel doesn't pick up a correct size of the detected devices, which apparently was the case here:&lt;BR /&gt; &lt;BR /&gt;---&lt;BR /&gt;ONLINE SCAN:&lt;BR /&gt; &lt;BR /&gt;Jan 20 12:54:25 tneld67n kernel: qla2400 0000:10:00.0: Scheduling rescan for new luns...&lt;BR /&gt;Jan 20 12:54:25 tneld67n kernel: qla2400 0000:07:00.0: Scheduling rescan for new luns...&lt;BR /&gt;Jan 20 12:54:56 tneld67n kernel: qla2400 0000:07:00.0: Scheduling rescan for new luns...&lt;BR /&gt;Jan 20 12:54:56 tneld67n kernel: qla2400 0000:10:00.0: Scheduling rescan for new luns...&lt;BR /&gt;Jan 20 12:55:50 tneld67n kernel: SCSI device sdbt: 83886080 512-byte hdwr sectors (42950 MB)&lt;BR /&gt;Jan 20 12:55:50 tneld67n kernel: SCSI device sdbt: drive cache: write through&lt;BR /&gt;Jan 20 12:55:50 tneld67n kernel:  sdbt: unknown partition table&lt;BR /&gt;Jan 20 12:55:50 tneld67n kernel: SCSI device sdbr: 83886080 512-byte hdwr sectors (42950 MB)&lt;BR /&gt;Jan 20 12:55:50 tneld67n kernel: SCSI device sdbr: drive cache: write through&lt;BR /&gt;Jan 20 12:55:50 tneld67n kernel:  sdbr: unknown partition table&lt;BR /&gt;Jan 20 12:55:50 tneld67n kernel:  emcpowerx: unknown partition table&lt;BR /&gt; &lt;BR /&gt;REAL SIZE OF THE LUN (navicli getall):&lt;BR /&gt; &lt;BR /&gt;LOGICAL UNIT NUMBER 467&lt;BR /&gt;Name                        LUN 467&lt;BR /&gt;UID:                        60:06:01:60:68:CF:1A:00:20:BE:04:D6:EC:05:DF:11&lt;BR /&gt;(...)&lt;BR /&gt;LUN Capacity(Megabytes):    40960&lt;BR /&gt;LUN Capacity(Blocks):       83886080&lt;BR /&gt;---&lt;BR /&gt; &lt;BR /&gt;So it looks like Linux 'thought' that the LUN is 2G bigger than it was in reality. There will be no problem unless OS is actually trying to write something after the physical boundary of the device, so it may happen that the host is running for weeks without issues. And the reboot fixed the issue.&lt;BR /&gt;&lt;BR /&gt;Question how LINUX/fdisk  calculates the size.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Jan 2010 10:55:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571358#M39433</guid>
      <dc:creator>skt_skt</dc:creator>
      <dc:date>2010-01-26T10:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Linux see LUN/disk bigger</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571359#M39434</link>
      <description>&lt;!--!*#--&gt;This is another consequence of confusion between 1000 vs 1024-based unit prefixes when measuring computer storage.&lt;BR /&gt;&lt;BR /&gt;With larger units, this can lead to significant display deviations:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://en.wikipedia.org/wiki/Binary_prefix#Deviation_between_binary_and_decimal_interpretations" target="_blank"&gt;http://en.wikipedia.org/wiki/Binary_prefix#Deviation_between_binary_and_decimal_interpretations&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If "inq" uses 1024-based prefixes, the LUN size would be 543 053 774 848 bytes.&lt;BR /&gt;&lt;BR /&gt;The fdisk interprets that value using 1000-based unit prefixes, resulting in 543 GB.&lt;BR /&gt;&lt;BR /&gt;You can verify this by running "fdisk -l &lt;LUN&gt;" on your LUN and reading the first non-blank line of the output. It should be something like:&lt;BR /&gt;&lt;BR /&gt;Disk /dev/sda: 160.0 GB, 160041885696 bytes&lt;BR /&gt;&lt;BR /&gt;To eliminate this confusion, a new set of unit prefixes was standardized in 2005 (see the wikipedia URL above).&lt;BR /&gt;&lt;BR /&gt;According to those standards, the inq tool should list the size as 530325952 KiB, not 530325952 KB.&lt;BR /&gt;&lt;BR /&gt;It might be useful if Linux fdisk would show the size of the disk in both ways. In your case, the LUN size might be indicated as 543.0 GB / 505.7 GiB.&lt;BR /&gt;&lt;BR /&gt;-------&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Jan 20 12:55:50 tneld67n kernel: SCSI device sdbt: 83886080 512-byte hdwr sectors (42950 MB)&lt;BR /&gt;&amp;gt; LUN Capacity(Megabytes): 40960&lt;BR /&gt;&amp;gt; LUN Capacity(Blocks): 83886080&lt;BR /&gt;&lt;BR /&gt;The size in sectors a.k.a. blocks is exactly the same, so the difference in megabyte values is a display problem only.&lt;BR /&gt;&lt;BR /&gt;83886080 sectors * 512 bytes/sector =&lt;BR /&gt;42949672960 bytes.&lt;BR /&gt;&lt;BR /&gt;In 1000-based units, this is:&lt;BR /&gt;42949672960 / 1000   = 42949672 KB&lt;BR /&gt;42949672960 / 1000^2 = 42950 MB (rounded up)&lt;BR /&gt;42949672960 / 1000^3 = 42.9 GB&lt;BR /&gt;&lt;BR /&gt;In 1024-based units, this is:&lt;BR /&gt;42949672960 / 1024   = 41943040 KiB&lt;BR /&gt;42949672960 / 1024^2 = 40960 MeB&lt;BR /&gt;42949672960 / 1024^3 = 40.0 GiB (exact)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; read failed after 0 of 4096 at 42949607424&lt;BR /&gt;&lt;BR /&gt;The read operation would have ended at byte location 42949607424 + 4096 = 42949611520.&lt;BR /&gt;&lt;BR /&gt;end of disk:           42949672960&lt;BR /&gt;end of read operation: 42949611520&lt;BR /&gt;----------------------------------&lt;BR /&gt;                             61440&lt;BR /&gt;&lt;BR /&gt;The difference is positive, so the access should have fit nicely within the LUN!&lt;BR /&gt;&lt;BR /&gt;Looks like the explanation given to you was... hasty. &lt;BR /&gt;&lt;BR /&gt;MK&lt;/LUN&gt;</description>
      <pubDate>Tue, 26 Jan 2010 13:58:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571359#M39434</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-01-26T13:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Linux see LUN/disk bigger</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571360#M39435</link>
      <description>that was very good explanation. What is the theory of adding 4096 to the byte location.</description>
      <pubDate>Wed, 27 Jan 2010 07:26:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571360#M39435</guid>
      <dc:creator>skt_skt</dc:creator>
      <dc:date>2010-01-27T07:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Linux see LUN/disk bigger</title>
      <link>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571361#M39436</link>
      <description>The error message was: "/dev/emcpowerx: read failed after 0 of 4096 at 42949607424: Input/output error"&lt;BR /&gt;&lt;BR /&gt;My interpretation: the program is trying to read a 4096 byte block ("... of 4096") starting from byte 42949607424. The read operation was completely unsuccessful: no part of data was returned ("0 of 4096").&lt;BR /&gt;&lt;BR /&gt;The start location of the read operation is obviously within the LUN size, but I wanted to explicitly prove that the end point of the read operation is also within the LUN size.&lt;BR /&gt;&lt;BR /&gt;If the block had been partly outside the LUN size, that might have explained the error (maybe a sanity check stops any attempts to access beyond end of device?) but this does not seem to be the case.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Wed, 27 Jan 2010 07:44:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/linux-see-lun-disk-bigger/m-p/4571361#M39436</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2010-01-27T07:44:18Z</dc:date>
    </item>
  </channel>
</rss>

