Discussion:
gpart and sector size
(too old to reply)
Alexey Tarasov
2010-04-08 13:06:55 UTC
Permalink
Hello.

There is only one possibility to change sector size of physical disk (gnop -S 4096 ...).
May be it is possible to add such possibility to gpart? e.g. gpart create -S 4096 -t gpt ad0?
It will help all unlucky WD Advanced Format disks users. :-D

--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Dag-Erling Smørgrav
2010-04-08 13:36:37 UTC
Permalink
Post by Alexey Tarasov
There is only one possibility to change sector size of physical disk
(gnop -S 4096 ...). May be it is possible to add such possibility to
gpart? e.g. gpart create -S 4096 -t gpt ad0?
I don't quite see how that would work - do you mean gpart should
configure a gnop? AFAIK there is no "gnop label", so you can't set up a
persistent gnop; you have to set it up manually at boot time every time,
and there's a risk that the fs (or other layers higher up) will taste
the underlying device instead of the gnop.

DES
--
Dag-Erling Smørgrav - ***@des.no
Alexey Tarasov
2010-04-08 13:44:00 UTC
Permalink
No, no.
I mean that gpart should act like gnop presenting another sector size to user.
I that possible at all?
Post by Dag-Erling Smørgrav
I don't quite see how that would work - do you mean gpart should
configure a gnop? AFAIK there is no "gnop label", so you can't set up a
persistent gnop; you have to set it up manually at boot time every time,
and there's a risk that the fs (or other layers higher up) will taste
the underlying device instead of the gnop.
--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Alexey Tarasov
2010-04-08 14:12:22 UTC
Permalink
Ok, in case of GPT? :-)
GPT implementation can be the simplest solution to this problem compared to implementing additional ATA commands to determine if disk is in Advanced Format.
Post by Alexey Tarasov
I mean that gpart should act like gnop presenting another sector size
to user. I that possible at all?
That depends on the underlying partition scheme. My guess is "no".
(it all boils down to whether the desired logical sector size can
somehow be recorded on-disk)
--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Alexey Tarasov
2010-04-08 14:26:41 UTC
Permalink
1) There is already an ATA command to report both physical and logical
sector sizes, but the disk lies - it always reports 512/512.
Advanced Format disks reports 512, but there is another command in ATA standard which can tell us if it uses 4k sector.
2) The disk may have already been formatted on a system that doesn't
support 4k sectors, and may contain unaligned partitions and file
systems, which won't be visible if we forcibly and unconditionally
use 4k sectors.
I mean that when I create *NEW* GPT scheme I can set up sector size emulation.
It will never touch existing unaligned partitions.

--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Dag-Erling Smørgrav
2010-04-08 14:35:18 UTC
Permalink
Post by Alexey Tarasov
Advanced Format disks reports 512, but there is another command in ATA
standard which can tell us if it uses 4k sector.
Send me one and I'll look into it :)

DES
--
Dag-Erling Smørgrav - ***@des.no
Alexey Tarasov
2010-04-08 14:40:50 UTC
Permalink
http://www.wdc.com/wdproducts/library/WhitePapers/ENG/2579-771430.pdf
References
The ATA8-ACS and SBC-3 standards have provisions for a disk drive to report Advanced Format sector sizes and other performance optimization information. These standards are used for SATA, SAS, USB, and IEEE 1394 based interface technologies.
Post by Alexey Tarasov
Advanced Format disks reports 512, but there is another command in ATA
standard which can tell us if it uses 4k sector.
Send me one and I'll look into it :)
DES
--
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-current
--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Gary Jennejohn
2010-04-08 15:24:21 UTC
Permalink
On Thu, 8 Apr 2010 18:40:50 +0400
Post by Alexey Tarasov
http://www.wdc.com/wdproducts/library/WhitePapers/ENG/2579-771430.pdf
References
The ATA8-ACS and SBC-3 standards have provisions for a disk drive to report Advanced Format sector sizes and other performance optimization information. These standards are used for SATA, SAS, USB, and IEEE 1394 based interface technologies.
This is apparently the Long Physical Sector features set. The question is
whether it's been implemented.

--
Gary Jennejohn
Dimitry Andric
2010-04-08 15:35:47 UTC
Permalink
Post by Gary Jennejohn
References
The ATA8-ACS and SBC-3 standards have provisions for a disk drive to report Advanced Format sector sizes and other performance optimization information. These standards are used for SATA, SAS, USB, and IEEE 1394 based interface technologies.
This is apparently the Long Physical Sector features set. The question is
whether it's been implemented.
Isn't this already done? At least it looks like it:

http://svn.freebsd.org/viewvc/base?view=revision&revision=198897

It might even have been MFC'd... :)
Alexey Tarasov
2010-04-08 19:34:07 UTC
Permalink
Hello.

Thank you for the information.
In 8-STABLE snapshot 201002 diskinfo shows 512k sector size yet.
I will try CURRENT tomorrow.
Post by Dimitry Andric
Post by Gary Jennejohn
References
The ATA8-ACS and SBC-3 standards have provisions for a disk drive to report Advanced Format sector sizes and other performance optimization information. These standards are used for SATA, SAS, USB, and IEEE 1394 based interface technologies.
This is apparently the Long Physical Sector features set. The question is
whether it's been implemented.
http://svn.freebsd.org/viewvc/base?view=revision&revision=198897
It might even have been MFC'd... :)
_______________________________________________
http://lists.freebsd.org/mailman/listinfo/freebsd-current
--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Dimitry Andric
2010-04-08 20:44:34 UTC
Permalink
Post by Alexey Tarasov
Thank you for the information.
In 8-STABLE snapshot 201002 diskinfo shows 512k sector size yet.
I will try CURRENT tomorrow.
It looks like the code was MFC'd to stable/8 in r199443. However, even
in -CURRENT, the sector size you see in diskinfo will also be 512B.

For ada(4) disks, it seems the d_sectorsize field of geom_disk's struct
disk is initialized using the _logical_ sector size, not the physical
sector size (which may be a multiple of the logical sector size).

That said, if the physical sector size is larger than the logical
sector size, the d_stripesize field is initialized with it. So if you
run "diskinfo -v" on the disk, what is the output for stripesize?
Alexey Tarasov
2010-04-09 11:27:09 UTC
Permalink
Or the disk doesn't actually report 4096 anywhere anyhow... Have you considered
that? If yes, can you verify using any tools of any OS that the disk reports 4K
in any way?
In the previous discussion we found that the disk reports 512 sector size, but there are additional ATA commands to determine if it has real sector size larger than 4k.
I will try to confirm this.
P.S. DES's name looks strange in headers :-)
Really. :-)
P.P.S.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Sorry, to few experience. =)

--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Andriy Gapon
2010-04-09 11:32:03 UTC
Permalink
Post by Alexey Tarasov
Or the disk doesn't actually report 4096 anywhere anyhow... Have you
considered that? If yes, can you verify using any tools of any OS that the
disk reports 4K in any way?
In the previous discussion we found that the disk reports 512 sector size, but
there are additional ATA commands to determine if it has real sector size
larger than 4k. I will try to confirm this.
Thank you. I think that this would be an interesting detail.
--
Andriy Gapon
Alexey Tarasov
2010-04-09 11:33:55 UTC
Permalink
Post by Andriy Gapon
Post by Alexey Tarasov
Or the disk doesn't actually report 4096 anywhere anyhow... Have you
considered that? If yes, can you verify using any tools of any OS that the
disk reports 4K in any way?
In the previous discussion we found that the disk reports 512 sector size, but
there are additional ATA commands to determine if it has real sector size
larger than 4k. I will try to confirm this.
Thank you. I think that this would be an interesting detail.
Here is the reference:

http://www.wdc.com/wdproducts/library/WhitePapers/ENG/2579-771430.pdf
Post by Andriy Gapon
References
The ATA8-ACS and SBC-3 standards have provisions for a disk drive to report Advanced Format sector sizes and other performance optimization information. These standards are used for SATA, SAS, USB, and IEEE 1394 based interface technologies.
--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Andriy Gapon
2010-04-09 11:41:09 UTC
Permalink
Post by Alexey Tarasov
Post by Andriy Gapon
Post by Alexey Tarasov
Or the disk doesn't actually report 4096 anywhere anyhow... Have you
considered that? If yes, can you verify using any tools of any OS that the
disk reports 4K in any way?
In the previous discussion we found that the disk reports 512 sector size, but
there are additional ATA commands to determine if it has real sector size
larger than 4k. I will try to confirm this.
Thank you. I think that this would be an interesting detail.
http://www.wdc.com/wdproducts/library/WhitePapers/ENG/2579-771430.pdf
I saw it, but I want to see what's reported in reality.
--
Andriy Gapon
Alexey Tarasov
2010-04-09 11:45:19 UTC
Permalink
Post by Andriy Gapon
I saw it, but I want to see what's reported in reality.
Installing Windows 7 now. How can OS installation be so long? :-)

--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")
Alexey Tarasov
2010-04-09 12:37:02 UTC
Permalink
No, the problem is that you must use the ada(4) driver instead of ad(4).
The new physical and logical sector support has only been implemented
for the newer AHCI-over-CAM stack.
pass0: Raw identify data:
0: 427a 3fff c837 0010 0000 0000 003f 0000
8: 0000 0000 2020 2020 2057 442d 574d 4156
16: 5531 3531 3235 3739 0000 0000 0032 3830
24: 2e30 3041 3830 5744 4320 5744 3135 4541
32: 5253 2d30 305a 3542 3120 2020 2020 2020
40: 2020 2020 2020 2020 2020 2020 2020 8010
48: 0000 2f00 4001 0000 0000 0007 3fff 0010
56: 003f fc10 00fb 0110 ffff 0fff 0000 0007
64: 0003 0078 0078 0078 0078 0000 0000 0000
72: 0000 0000 0000 001f 1706 0000 0044 0040
80: 01fe 0000 746b 7f61 4123 7469 bc41 4123
88: 407f 00ab 00ab 0000 fffe 0000 80fe 0000
96: 0000 0000 0000 0000 7b30 aea8 0000 0000
104: 0000 0000 0000 0000 5001 4ee0 5743 482f
112: 0000 0000 0000 0000 0000 0000 0000 4018
120: 4018 0000 0000 0000 0000 0000 0000 0000
128: 0021 0000 0000 0000 0000 16db 0000 0000
136: 0000 0000 0000 0000 0000 0000 0004 0000
144: 0000 0000 0000 0000 0000 0000 0000 0000
152: 0000 0000 0000 0000 0000 0000 0000 0000
160: 0000 0000 0000 0000 0000 0000 0000 0000
168: 0000 0000 0000 0000 0000 0000 0000 0000
176: 0000 0000 0000 0000 0000 0000 0000 0000
184: 0000 0000 0000 0000 0000 0000 0000 0000
192: 0000 0000 0000 0000 0000 0000 0000 0000
200: 0000 0000 0000 0000 0000 0000 3031 0000
208: 0000 0000 0000 0000 0000 0000 0000 0000
216: 0000 0000 0000 0000 0000 0000 101e 0000
224: 0000 0000 0000 0000 0000 0000 0000 0000
232: 0000 0000 0001 1000 0000 0000 0000 0000
240: 0000 0000 0000 0000 0000 0000 0000 0000
248: 0000 0000 0000 0000 0000 0000 0000 3aa5
pass0: <WDC WD15EARS-00Z5B1 80.00A80> ATA-8 SATA 2.x device
pass0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)

protocol ATA/ATAPI-8 SATA 2.x
device model WDC WD15EARS-00Z5B1
firmware revision 80.00A80
serial number WD-WMAVU1512579
WWN 50014ee05743482f
cylinders 16383
heads 16
sectors/track 63
sector size logical 512, physical 512, offset 0
LBA supported 268435455 sectors
LBA48 supported 2930277168 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA6

Feature Support Enable Value Vendor
read ahead yes yes
write cache yes yes
flush cache yes yes
overlap no
Tagged Command Queuing (TCQ) no no
Native Command Queuing (NCQ) yes 32 tags
SMART yes yes
microcode download yes yes
security yes no
power management yes yes
advanced power management no no 0/0x00
automatic acoustic management yes no 254/0xFE 128/0x80
media status notification no no
power-up in Standby yes no
write-read-verify no no 0/0x0
unload no no
free-fall no no
data set management (TRIM) no

Seems that the only possible way to use this disks is adding permanent (not like gnop) sector size emulation to some part of GEOM.

--
Alexey Tarasov

(\__/)
(='.'=)
E[: | | | | :]З
(")_(")

Dag-Erling Smørgrav
2010-04-08 14:24:12 UTC
Permalink
Post by Alexey Tarasov
Ok, in case of GPT? :-)
I doubt it, but I don't know for sure.
Post by Alexey Tarasov
GPT implementation can be the simplest solution to this problem
compared to implementing additional ATA commands to determine if disk
is in Advanced Format.
There are two issues:

1) There is already an ATA command to report both physical and logical
sector sizes, but the disk lies - it always reports 512/512.

2) The disk may have already been formatted on a system that doesn't
support 4k sectors, and may contain unaligned partitions and file
systems, which won't be visible if we forcibly and unconditionally
use 4k sectors.

DES
--
Dag-Erling Smørgrav - ***@des.no
Dag-Erling Smørgrav
2010-04-08 14:09:24 UTC
Permalink
Post by Alexey Tarasov
I mean that gpart should act like gnop presenting another sector size
to user. I that possible at all?
That depends on the underlying partition scheme. My guess is "no".

(it all boils down to whether the desired logical sector size can
somehow be recorded on-disk)

DES
--
Dag-Erling Smørgrav - ***@des.no
Marcel Moolenaar
2010-04-08 19:30:01 UTC
Permalink
Post by Alexey Tarasov
Hello.
There is only one possibility to change sector size of physical disk (gnop -S 4096 ...).
May be it is possible to add such possibility to gpart? e.g. gpart create -S 4096 -t gpt ad0?
It will help all unlucky WD Advanced Format disks users. :-D
A better approach is to have tunables for geom_disk to do this. This should absolutely
not be part of a partitioning tool. It violates everything there is to violate AFAICT.
FYI,
--
Marcel Moolenaar
***@mac.com
Loading...