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

Re: disk partitioners vs disk with 2048 byte phusical sectors



On Wednesday 27 September 2017 09:09:26 Pascal Hambourg wrote:

> Le 27/09/2017 à 14:42, Gene Heskett a écrit :
> > [ 2404.664052] sd 0:0:0:0: [sda] 1953525167 512-byte logical blocks:
> > (1.00 TB/932 GiB)
> > [ 2404.676277] sd 0:0:0:0: [sda] 2048-byte physical blocks
> >
> > But I've now spent several hours trying to put the 1st of 3
> > partitions on it with figures that satisfy parted's align-check,
> > including calculation of values that result in mod(2048)=0. Nothing
> > seems to satisfy parted.
>
> Can you elaborate ? You description is vague, and we cannot see what's
> on your screen.
>
> Don't bother with alignment. Modern partitioners' default alignement
> is suitable for all drives.

Oh? The last time I used fdisk I wound up with writes under 15 
megs/second, and read of about 21 megs/second. Fixed it so it was 
aligned, and its now around 120 megs/second both ways.

You said you can't see, so here's an attempt to use byte values that are 
all mod(2048)=0

root@rock64:~# parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: Seagate BUP Slim BK (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

(parted) mkpart primary fat32                                             
Start? 163,840B                                                           
End? 167,772,160B                                                         
Error: The maximum head value is 254.

WTH? I didn't tell it heads, I gave it bytes and each value was a power 
of 2 multiple of 2048, which should have made a fat32 partition of 
around 167 megabytes.

   
So what sort of figures does it need to be happy?
The help screen does not define UNITS, but the manpage does, sorta.

 unit unit
                     Set unit as the unit to use when displaying 
locations and sizes, and for interpreting those given by the user when 
not suffixed with an
                     explicit unit.  unit can be one of "s" 
(sectors), "B" (bytes), "kB", "MB", "MiB", "GB", "GiB", "TB", "TiB", "%" 
(percentage  of  device
                     size), "cyl" (cylinders), "chs" (cylinders, heads, 
sectors), or "compact" (megabytes for input, and a human-friendly form 
for output).

confusing, ain't it? call it up, attempt to set units gets help screen. 
enter units at prompt, accepts MiB.

So next attempt:
(parted) mkpart primary fat32 8MiB 210MiB
Warning: The resulting partition is not properly aligned for best 
performance.
Ignore/Cancel? c                                                          
(parted) mkpart primary fat32 8MiB 192MiB                                 
Warning: The resulting partition is not properly aligned for best 
performance.
Ignore/Cancel? c                                                          
(parted) mkpart primary fat32 4MiB 192MiB                                 
Warning: The resulting partition is not properly aligned for best 
performance.
Ignore/Cancel? c                                                          
(parted) mkpart primary fat32 4MB 192MB                                 
Warning: The resulting partition is not properly aligned for best 
performance.
Ignore/Cancel? c                                                          
(parted) mkpart primary fat32 2MiB 192MiB                                 
Warning: The resulting partition is not properly aligned for best 
performance.

Its an endless loop.  How can I make a broken for a 2048 byte sector 
partitioner actually work?

Looking at fdisks initial screen, it claims the physical sector is 4096?
Command (m for help): p
Disk /dev/sda: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x892f63c8

Now I am truly confused. But I see fdisk has grown some more knobs too, 
so I'll play a bit.

Applicable hints appreciated, Pascal, thanks.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: