[CentOS] 3TB non-system disk reports wrong size on Centos 6x86_64

Thu May 1 00:24:19 UTC 2014
Jason Pyeron <jpyeron at pdinc.us>

I took the drive out and partitioned it on windows 7 64bit.

Now parted crashes:

# parted /dev/sdb
GNU Parted 2.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Invalid argument during seek for read on /dev/sdb
Retry/Ignore/Cancel? i
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? ok
Backtrace has 8 calls on stack:
  8: /lib64/libparted-2.1.so.0(ped_assert+0x31) [0x3646812151]
  7: /lib64/libparted-2.1.so.0() [0x3646842b2d]
  6: /lib64/libparted-2.1.so.0(ped_disk_new+0x75) [0x3646819305]
  5: parted() [0x40692c]
  4: parted(interactive_mode+0xf3) [0x40da93]
  3: parted(main+0x8f) [0x40aacf]
  2: /lib64/libc.so.6(__libc_start_main+0xfd) [0x364501ed1d]
  1: parted() [0x404f49]


You found a bug in GNU Parted! Here's what you have to do:

Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:

Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:

        http://ftp.gnu.org/gnu/parted/

Please check this version prior to bug reporting.

If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:

        http://www.gnu.org/software/parted

for further information.

Your report should contain the version of this release (2.1)
along with the error message below, the output of

        parted DEVICE unit co print unit s print

and the following history of commands you entered.
Also include any additional information about your setup you
consider important.

Assertion (last_usable <= disk->dev->length) at gpt.c:733 in function
_parse_header() failed.

Aborted (core dumped)



Building the latest (parted-3.0.tar.gz md5:a94e84a9b9944715c4453f82ccc639bf
sha1:6e8f7a2b042ba6222e8ea245a05136669fccec7f)

root at five-72 /tmp/parted-3.0/parted
# ./parted /dev/sdb
GNU Parted 3.0
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Invalid argument during seek for read on /dev/sdb
Retry/Ignore/Cancel? i
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? ok
Backtrace has 8 calls on stack:
  8: /tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_assert+0x31)
[0x7f533a46a8c1]
  7: /tmp/parted-3.0/libparted/.libs/libparted.so.1(+0x24cdd) [0x7f533a482cdd]
  6: /tmp/parted-3.0/libparted/.libs/libparted.so.1(ped_disk_new+0x75)
[0x7f533a470c95]
  5: /tmp/parted-3.0/parted/.libs/lt-parted() [0x405d59]
  4: /tmp/parted-3.0/parted/.libs/lt-parted(interactive_mode+0xf3) [0x40b8d3]
  3: /tmp/parted-3.0/parted/.libs/lt-parted(main+0xd9f) [0x407e7f]
  2: /lib64/libc.so.6(__libc_start_main+0xfd) [0x364501ed1d]
  1: /tmp/parted-3.0/parted/.libs/lt-parted() [0x404b09]

...

Assertion (last_usable <= disk->dev->length) at gpt.c:727 in function
_parse_header() failed.

Aborted (core dumped)

> -----Original Message-----
> From: centos-bounces at centos.org 
> [mailto:centos-bounces at centos.org] On Behalf Of Jason Pyeron
> Sent: Wednesday, April 30, 2014 17:22
> To: 'CentOS mailing list'
> Subject: Re: [CentOS] 3TB non-system disk reports wrong size 
> on Centos 6x86_64
> 
> hdparm reports 4096.... (reading
> http://karelzak.blogspot.com/2010/05/4096-byte-sector-hard-dri
ves.html)
> 
> Now I am really going nuts.
> 
> root at five-72 ~
> # cat /sys/block/sdb/queue/physical_block_size
> 512
> 
> root at five-72 ~
> # cat /sys/block/sdb/queue/logical_block_size
> 512
> 
> root at five-72 ~
> # cat /sys/block/sdb/queue/optimal_io_size
> 0
> 
> root at five-72 ~
> # uname -a
> Linux five-72.internal.pdinc.us 2.6.32-431.11.2.el6.x86_64 #1 
> SMP Tue Mar 25
> 19:59:55 UTC 2014 x86_64 x86_64 x86_64 GNU/Linuxroot at five-72 ~
> 
> root at five-72 ~
> # hdparm -I /dev/sdb
> 
> /dev/sdb:
> 
> ATA device, with non-removable media
>         Model Number:       ST3000DM001-1CH166
>         Serial Number:      W1F2TPQT
>         Firmware Revision:  CC26
>         Transport:          Serial, SATA Rev 3.0
> Standards:
>         Used: unknown (minor revision code 0x0029)
>         Supported: 8 7 6 5
>         Likely used: 8
> Configuration:
>         Logical         max     current
>         cylinders       16383   16383
>         heads           16      16
>         sectors/track   63      63
>         --
>         CHS current addressable sectors:   16514064
>         LBA    user addressable sectors:  268435455
>         LBA48  user addressable sectors: 5860533168
>         Logical  Sector size:                   512 bytes
>         Physical Sector size:                  4096 bytes
>         Logical Sector-0 offset:                  0 bytes
>         device size with M = 1024*1024:     2861588 MBytes
>         device size with M = 1000*1000:     3000592 MBytes (3000 GB)
>         cache/buffer size  = unknown
>         Form Factor: 3.5 inch
>         Nominal Media Rotation Rate: 7200
> Capabilities:
>         LBA, IORDY(can be disabled)
>         Queue depth: 32
>         Standby timer values: spec'd by Standard, no device 
> specific minimum
>         R/W multiple sector transfer: Max = 16  Current = ?
>         Advanced power management level: 128
>         Recommended acoustic management value: 208, current value: 0
>         DMA: mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 
> udma5 *udma6
>              Cycle time: min=120ns recommended=120ns
>         PIO: pio0 pio1 pio2 pio3 pio4
>              Cycle time: no flow control=120ns  IORDY flow 
> control=120ns
> Commands/features:
>         Enabled Supported:
>            *    SMART feature set
>                 Security Mode feature set
>            *    Power Management feature set
>            *    Write cache
>            *    Look-ahead
>            *    Host Protected Area feature set
>            *    WRITE_BUFFER command
>            *    READ_BUFFER command
>            *    DOWNLOAD_MICROCODE
>            *    Advanced Power Management feature set
>                 SET_MAX security extension
>            *    48-bit Address feature set
>            *    Device Configuration Overlay feature set
>            *    Mandatory FLUSH_CACHE
>            *    FLUSH_CACHE_EXT
>            *    SMART error logging
>            *    SMART self-test
>            *    General Purpose Logging feature set
>            *    WRITE_{DMA|MULTIPLE}_FUA_EXT
>            *    64-bit World wide name
>                 Write-Read-Verify feature set
>            *    WRITE_UNCORRECTABLE_EXT command
>            *    {READ,WRITE}_DMA_EXT_GPL commands
>            *    Segmented DOWNLOAD_MICROCODE
>            *    Gen1 signaling speed (1.5Gb/s)
>            *    Gen2 signaling speed (3.0Gb/s)
>            *    Gen3 signaling speed (6.0Gb/s)
>            *    Native Command Queueing (NCQ)
>            *    Phy event counters
>            *    unknown 76[15]
>                 DMA Setup Auto-Activate optimization
>                 Device-initiated interface power management
>            *    Software settings preservation
>            *    SMART Command Transport (SCT) feature set
>            *    SCT Write Same (AC2)
>                 unknown 206[7]
>                 unknown 206[12] (vendor specific)
>                 unknown 206[13] (vendor specific)
> Security:
>         Master password revision code = 65534
>                 supported
>         not     enabled
>         not     locked
>         not     frozen
>         not     expired: security count
>                 supported: enhanced erase
>         318min for SECURITY ERASE UNIT. 318min for ENHANCED 
> SECURITY ERASE UNIT.
> Logical Unit WWN Device Identifier: 5000c50061172c81
>         NAA             : 5
>         IEEE OUI        : 000c50
>         Unique ID       : 061172c81
> Checksum: correct
> 
> --
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> -                                                               -
> - Jason Pyeron                      PD Inc. http://www.pdinc.us -
> - Principal Consultant              10 West 24th Street #100    -
> - +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
> -                                                               -
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> This message is copyright PD Inc, subject to license 20080407P00.
> 
>  
> 
> > -----Original Message-----
> > From: centos-bounces at centos.org 
> > [mailto:centos-bounces at centos.org] On Behalf Of Jason Pyeron
> > Sent: Wednesday, April 30, 2014 16:47
> > To: 'CentOS mailing list'
> > Subject: [CentOS] 3TB non-system disk reports wrong size on 
> > Centos 6 x86_64
> > 
> > root at five-72 ~
> > # dd if=/dev/zero of=/dev/sdb bs=1M count=1000
> > 1000+0 records in
> > 1000+0 records out
> > 1048576000 bytes (1.0 GB) copied, 8.67101 s, 121 MB/s
> > 
> > root at five-72 ~
> > # parted /dev/sdb
> > GNU Parted 2.1
> > Using /dev/sdb
> > Welcome to GNU Parted! Type 'help' to view a list of commands.
> > (parted) mklabel gpt
> > (parted) print
> > Model: ATA ST3000DM001-1CH1 (scsi) -->
> > http://www.seagate.com/staticfiles/docs/pdf/datasheet/disc/bar
> > racuda-ds1737-1-11
> > 11us.pdf
> > Disk /dev/sdb: 2199GB
> > Sector size (logical/physical): 512B/512B
> > Partition Table: gpt
> > 
> > Number  Start  End  Size  File system  Name  Flags
> > 
> > (parted) q
> > Information: You may need to update /etc/fstab.
> > 
> > 
> > root at five-72 ~
> > # cat /sys/block/sdb/queue/physical_block_size
> > 512
> > 
> > 
> > But the drive says 4k sector size!
> > 
> > What am I doing wrong?
> > 
> > -Jason

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Principal Consultant              10 West 24th Street #100    -
- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is copyright PD Inc, subject to license 20080407P00.