emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#25103: closed (partition alignment)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#25103: closed (partition alignment)
Date: Wed, 19 Apr 2017 14:30:08 +0000

Your message dated Wed, 19 Apr 2017 10:30:45 -0400
with message-id <address@hidden>
and subject line Re: bug#25103: partition alignment
has caused the debbugs.gnu.org bug report #25103,
regarding partition alignment
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
25103: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25103
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: partition alignment Date: Sun, 04 Dec 2016 01:54:33 +0000
I'm not sure if this is a bug in parted (parted 3.2 on Ubuntu 16.04.1LTS x86-64), or a bug in my understanding of the concepts.  Either way I'd like to know.

I've got a new 8TB drive for which the "optimal" alignment calculated by parted doesn't satisfy the "minimal" alignment check. My understanding is the "minimal" check verifies the partition is aligned to physical blocks on the disk, so it seems impossible for an alignment that doesn't pass that check to truly be "optimal".  Indeed, the documentation specifies "optimal" is a aligned to a multiple of the physical block size.

For this drive, "--align opt" creates a partition starting at 65535s:

-- 8< --
$ sudo parted --align opt /dev/sdi mkpart 8tb ext4 0% 100% u s p free a min 1 a opt 1
Model: Seagate Expansion Desk (scsi)
Disk /dev/sdi: 15628053167s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start         End           Size          File system  Name  Flags
        34s           65534s        65501s        Free Space
 1      65535s        15628000379s  15627934845s  ext4         8tb
        15628000380s  15628053133s  52754s        Free Space

1 not aligned
1 aligned
-- 8< --

So, I fell back to how we used to do this, but the numbers are... weird:

-- 8< --
$ cat /sys/block/sdi/queue/optimal_io_size 
33553920
$ cat /sys/block/sdi/queue/minimum_io_size 
4096
$ cat /sys/block/sdi/queue/physical_block_size 
4096
$ cat /sys/block/sdi/queue/logical_block_size
512
$ cat /sys/block/sdi/alignment_offset 
0
-- 8< --

( 33553920 + 0 ) / 4096 = 8191.875, but that's not going to work. Using the logical block size instead gives the 65535s that parted suggested, but if my understanding is correct that's not actually a good alignment.

I can get a partition that satisfies both checks by scaling the 65535s out to align with a 4k block, and starting the partition at 524280s, at the cost of "wasting" ~300MiB of space:

-- 8< --
$ sudo parted --align opt /dev/sdi mkpart 8tb ext4 524280s 100% u s p free a min 1 a opt 1
Model: Seagate Expansion Desk (scsi)
Disk /dev/sdi: 15628053167s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start         End           Size          File system  Name  Flags
        34s           524279s       524246s       Free Space
 1      524280s       15628000379s  15627476100s  ext4         8tb
        15628000380s  15628053133s  52754s        Free Space

1 aligned
1 aligned
-- 8< --

~300MiB out of 7.3TiB isn't the end of the world, so that's what I've gone with for now, but I wonder if I'm not overthinking it.  Was parted's original optimal alignment actually fine and my understanding incorrect? If not, is there a better way than what I've done to calculate an alignment that is?

For the near-term there's no data on this device so I'm perfectly happy to burn it down for testing. 

Thanks,

 -V

-- 8< --
$ sudo parted /dev/sdi print unit s print unit chs print
Model: Seagate Expansion Desk (scsi)
Disk /dev/sdi: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End     Size    File system  Name  Flags
 1      268MB  8002GB  8001GB               8tb

Model: Seagate Expansion Desk (scsi)
Disk /dev/sdi: 15628053167s
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start    End           Size          File system  Name  Flags
 1      524280s  15628000379s  15627476100s               8tb

Model: Seagate Expansion Desk (scsi)
Disk /dev/sdi: 972801,80,61
Sector size (logical/physical): 512B/4096B
BIOS cylinder,head,sector geometry: 972801,255,63.  Each cylinder is 8225kB.
Partition Table: gpt
Disk Flags: 

Number  Start      End         File system  Name  Flags
 1      32,161,57  972798,8,5               8tb
-- 8< --

--- End Message ---
--- Begin Message --- Subject: Re: bug#25103: partition alignment Date: Wed, 19 Apr 2017 10:30:45 -0400 User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 12/4/2016 3:14 PM, Volta wrote:
> On 4 December 2016 at 01:55, Josep Lladonosa <address@hidden> wrote:
>> Maybe this value is not drive related but usb bus related. Is that a usb
>> drive? I guess so. Found similar cases. One of them:
>>
>> https://www.mail-archive.com/address@hidden&q=subject:%22Re%5C%3A+questions+about+uas%22&o=newest&f=1
> 
> Interesting! Yes, as you've guessed, it is a USB drive, using the uas
> driver. So, not a parted bug, and I've got a new avenue to read up on.

Interesting, but yes, parted is simply respecting the fubar optimal IO
size this drive is reporting, which appears to be one sector less than
32 mb.  Normal drives have an optimal IO size of 32 kb.




--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]