1

Topic: Number of sectors off by two?

Hi,

I have used GParted 0.8.0 (from a SystemRescueCD 2.1.0) to partition a 3 TB Seagate Constellation ES.2 ST33000650NS hard disk.

SeaTools for DOS 2.23 tells me about this drive

Max Native Address 5860533167
Device is 48 Bit Addressed - Number of LBAs 5860533167 ( 3000.593 GB )

But according to Partition > Information in GParted, the unallocated area stretches from sector 0 to sector 5860533168 for a total auf 5860533169 sectors. That's 2 more than the number of LBAs.

Here's the log of creating a sole partition (with a GPT disk label):

GParted 0.8.0

Libparted 2.3
Create Primary Partition #1 (ext3, 2.73 TiB) on /dev/sdb  00:12:55    ( SUCCESS )
         
    create empty partition  00:00:01    ( SUCCESS )
         
        path: /dev/sdb1
        start: 2048
        end: 5860532223
        size: 5860530176 (2.73 TiB)

    set partition type on /dev/sdb1  00:00:00    ( SUCCESS )
         
        new partition type: ext3

    create new ext3 file system  00:12:54    ( SUCCESS )
         
        mkfs.ext3 -L "video" /dev/sdb1
         
            Filesystem label=video
            OS type: Linux
            Block size=4096 (log=2)
            Fragment size=4096 (log=2)
            Stride=0 blocks, Stripe width=0 blocks
            183148544 inodes, 732566272 blocks
            36628313 blocks (5.00%) reserved for the super user
            First data block=0
            Maximum filesystem blocks=0
            22357 block groups
            32768 blocks per group, 32768 fragments per group
            8192 inodes per group
            Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
            102400000, 214990848, 512000000, 550731776, 644972544
...

Can number of sectors and number of LBAs differ? Should I worry about it?

Thanks,
Malte

2

Re: Number of sectors off by two?

GParted uses the libparted library from the parted project to work with partitions.

To diagnose this anomaly further would you be able to provide the output from the following two commands?

fdisk -l -u

where one of the options is a lower case "L" and not the number one.

parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

3

Re: Number of sectors off by two?

Sure, this is the output of the two commands, first fdisk

root@gyro /root % fdisk -l -u /dev/sdc

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 3000.6 GB, 3000592982016 bytes
255 heads, 63 sectors/track, 364801 cylinders, total 5860533168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  4294967295  2147483647+  ee  GPT

and then parted

root@gyro /root % parted /dev/sdc unit s print
Model: ATA ST33000650NS (scsi)
Disk /dev/sdc: 5860533168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End          Size         File system  Name  Flags
 1      2048s  5860532223s  5860530176s  ext3

The disk is in an external case now, thus the change from /dev/sdb to /dev/sdc.

Thanks for your help!

4

Re: Number of sectors off by two?

It appears that you are using a GUID partition table.  As such I should have recommended you use "gdisk" instead of "fdisk".

Regardless, it would appear that both "fdisk" and "parted" see the disk device as having 5,860,533,168 sectors.

The value reported by SeaTools, which I am not familiar with, is 5,860,533,167.  This is one sector less, but might include sector 0 as a valid LBA.  Either way I do not think you need to worry about this discrepancy.

5

Re: Number of sectors off by two?

You are probably right. I might be a little overcautious: This is my first 3 TB disk, and the mainboard is little older.

As the output of gdisk show, the sole partition does not include the last couple of sectors anyway:

root@gyro /root % gdisk /dev/sdc
GPT fdisk (gdisk) version 0.7.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdc: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 63C30E54-3155-49AC-8D57-74998A78971C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      5860532223   2.7 TiB     0700

May be there are two "off by one" errors here. One could stem from SeaTools, reporting 5,860,533,167 instead of 5,860,533,168 sectors. I'll ask Seagate about it. But the GParted info dialog suggests even one more sector for a "total" of 5860533169 sectors.

6

Re: Number of sectors off by two?

Addendum: Seagate Support has just told me that the number of LBAs reported by SeaTools is correct.

7

Re: Number of sectors off by two?

Interesting.  Unfortunately I do not know the reason for the difference reported between Seagate and the GNU/Linux tools.

Since the three GNU/Linux tools (fdisk, gdisk, and parted) all report the same value, I have a tendency to believe these three tools, but this does not mean that these are necessarily correct.  On the plus side, the source code is available so one can investigate to learn how the total number of sectors is calculated.

Of direct concern to me, is that you see GParted as reporting one sector more than the three GNU/Linux tools.  I have checked my drives (largest is 1 Terabyte) and the GParted values agree with the other three GNU/Linux tools.

Would you be able to post a link to a screen shot with GParted and the parted output so that I can see the problem for myself?

8

Re: Number of sectors off by two?

gedakc wrote:

Would you be able to post a link to a screen shot with GParted and the parted output so that I can see the problem for myself?

Sure. I have uploaded a screenshot to http://img717.imageshack.us/i/gpartedin … about.png/.

As far as Seagate Support is concerned: I have found a product manual for the drive at http://www.seagate.com/www/en-us/produc … tion-es-2/. And, guess what: According to the Drive specifications summary on page 4, the drive has 5,860,533,168 guaranteed sectors... I'll ask them again smile.

9

Re: Number of sectors off by two?

Thanks for the updated information and screen shot.   It would appear that you have found a bug in what GParted reports for the unallocated partition size.

Would you be able to check what "View --> Device Information" reports as the size of the drive?

10

Re: Number of sectors off by two?

This is the information displayed by "View --> Device Information":

Heads: 255
Sectors/track: 63
Cylinders: 364801
Total sectors: 5860533168
Sector size: 512

Sector size and number of sectors are in accordance with the product manual.

11

Re: Number of sectors off by two?

Thanks for this additional information and again for reporting this problem.

If you have a chance, please feel free to open a new bug report for this problem and perhaps provide a link back to this post.  That will help minimize the chance of losing track of this problem.
http://gparted.org/bugs.php

12

Re: Number of sectors off by two?

I filed a bug report, see https://bugzilla.gnome.org/show_bug.cgi?id=649444.

Addendum II: Seagate Support now tells me that SeaTools is wrong, i.e. off by one. But they argue that the error is less than 10 E-9 and that the tool can only work within the technically feasible limits. I wonder what that is supposed to mean  smile .

13

Re: Number of sectors off by two?

Thank you for filing the bug report and the updated info from Seagate.

I plan to investigate a fix for this problem soon.

14

Re: Number of sectors off by two?

Thank you for taking care of GParted!

15

Re: Number of sectors off by two?

A fix for this problem has been developed and committed to the git repository for inclusion in the next release of GParted.
Bug 649444 - Partition information reports wrong sector count