* RE: convert 520 byte sector disk to 512 byte sector?
@ 2003-06-10 18:32 Cress, Andrew R
2003-06-18 20:52 ` Grant Grundler
0 siblings, 1 reply; 10+ messages in thread
From: Cress, Andrew R @ 2003-06-10 18:32 UTC (permalink / raw)
To: 'Grant Grundler', Douglas Gilbert; +Cc: Patrick Mansfield, linux-scsi
Grant,
You can set the block descriptor as part of the mode page file using sgmode
from
http://scsirastools.sourceforge.net
You must do a SCSI format of the disk after changing the block size, of
course.
Andy
-----Original Message-----
From: Grant Grundler [mailto:iod00d@hp.com]
Sent: Tuesday, June 10, 2003 1:24 PM
To: Douglas Gilbert
Cc: Patrick Mansfield; linux-scsi@vger.kernel.org
Subject: Re: convert 520 byte sector disk to 512 byte sector?
On Tue, Jun 10, 2003 at 11:53:56AM +1000, Douglas Gilbert wrote:
> www.seagate.com have a tool called "seatool" that may
> do the trick for you.
Doug,
thanks - but last time I checked, it's an x86 binary only driver.
I guess I could try it anyway and see if the IOCTLs have
32-bit compat support in ia64 kernel.
thanks,
grant
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-10 18:32 convert 520 byte sector disk to 512 byte sector? Cress, Andrew R
@ 2003-06-18 20:52 ` Grant Grundler
0 siblings, 0 replies; 10+ messages in thread
From: Grant Grundler @ 2003-06-18 20:52 UTC (permalink / raw)
To: Cress, Andrew R; +Cc: Douglas Gilbert, Patrick Mansfield, linux-scsi
On Tue, Jun 10, 2003 at 11:32:33AM -0700, Cress, Andrew R wrote:
> You can set the block descriptor as part of the mode page file using sgmode
> from
> http://scsirastools.sourceforge.net
Andrew,
no - this won't work for many of the Seagate drives.
The "mask" for format mode page is mostly zeros.
See my blk512-linux.c at:
ftp://gsyprf10.external.hp.com/pub/scsi/blk512
(older code is at .../blk512_old)
thanks,
grant
^ permalink raw reply [flat|nested] 10+ messages in thread
* convert 520 byte sector disk to 512 byte sector?
@ 2003-06-09 17:46 Grant Grundler
2003-06-09 19:29 ` Patrick Mansfield
0 siblings, 1 reply; 10+ messages in thread
From: Grant Grundler @ 2003-06-09 17:46 UTC (permalink / raw)
To: linux-scsi
Hi,
I've got several ST336753FC and ST336704FC disks which came out
of a VA7100 RAID enclosure. The VA7100 is able to reformat those
disks from 512 to 520 bytes per sector. I'd like to convert them
back to 512 byte/sector for use as "regular" disks.
Anyone know the trick to do that?
I once wrote a program to use scsi-pass thru (aka scsi generic)
under HPUX to do exactly that for regular parallel SCSI disks.
I dug that up, dusted it off and ported it to linux.
Source code is on http://gsyprf11.external.hp.com/blk512/
I haven't tried blk512-linux with parallel SCSI under linux,
but I know it's not working with the above FC disks when run
on an ia64-linux box. The format mode page "current" values
aren't changing using the "trick" that worked for the parallel
SCSI disks. And the "writeable" indicates none of the formt mode
page parameters are allowed to be changed (clearly a lie).
The default format mode page clearly shows the drive was 512 byte/sector.
I'd just like to get them back to that for the some performance testing.
thanks,
grant
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-09 17:46 Grant Grundler
@ 2003-06-09 19:29 ` Patrick Mansfield
2003-06-09 22:39 ` Grant Grundler
2003-06-10 0:36 ` Grant Grundler
0 siblings, 2 replies; 10+ messages in thread
From: Patrick Mansfield @ 2003-06-09 19:29 UTC (permalink / raw)
To: Grant Grundler; +Cc: linux-scsi
On Mon, Jun 09, 2003 at 10:46:47AM -0700, Grant Grundler wrote:
> Hi,
>
> I've got several ST336753FC and ST336704FC disks which came out
> of a VA7100 RAID enclosure. The VA7100 is able to reformat those
> disks from 512 to 520 bytes per sector. I'd like to convert them
> back to 512 byte/sector for use as "regular" disks.
> Anyone know the trick to do that?
> I haven't tried blk512-linux with parallel SCSI under linux,
> but I know it's not working with the above FC disks when run
> on an ia64-linux box. The format mode page "current" values
> aren't changing using the "trick" that worked for the parallel
> SCSI disks. And the "writeable" indicates none of the formt mode
> page parameters are allowed to be changed (clearly a lie).
>
> The default format mode page clearly shows the drive was 512 byte/sector.
> I'd just like to get them back to that for the some performance testing.
I did this for some Seagate FC drives (don't have the exact model numbers
handly), but don't have my hacks, and can't find details of my results. I
used the same thing you have in your code - set the "direct access device
mode paramter block descriptor"'s block length (versus the more obvious
data bytes per physical page), and then formatted the drive.
Did you try setting the data bytes per physical page?
So the MODE SENSE format device page (0x3) "data bytes per physical
sector" does _not_ show 512 bytes after you send the MODE SELECT format
device page? That is what I (eventually) saw.
Did you format the drive after changing the block size?
Are you sure the mode select is really working in your code? I suppose
there are no other format page values you can change.
I can't remember when the MODE SENSE format page showed the modified block
size for me - I believe it was after the MODE SELECT format page, rather
than after the FORMAT command itself.
-- Patrick Mansfield
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-09 19:29 ` Patrick Mansfield
@ 2003-06-09 22:39 ` Grant Grundler
2003-06-10 1:53 ` Douglas Gilbert
2003-06-10 0:36 ` Grant Grundler
1 sibling, 1 reply; 10+ messages in thread
From: Grant Grundler @ 2003-06-09 22:39 UTC (permalink / raw)
To: Patrick Mansfield; +Cc: linux-scsi
On Mon, Jun 09, 2003 at 12:29:07PM -0700, Patrick Mansfield wrote:
> I did this for some Seagate FC drives (don't have the exact model numbers
> handly), but don't have my hacks, and can't find details of my results. I
> used the same thing you have in your code - set the "direct access device
> mode paramter block descriptor"'s block length (versus the more obvious
> data bytes per physical page), and then formatted the drive.
thanks - that's good to know that at least I'm banging my head
bloody against the right wall. I suspect the data isn't going
out to the device like it's supposed too. But I'm not seeing
the problem with the code.
> Did you try setting the data bytes per physical page?
I think so. But I recall checking the "Mask" data for the format mode
page and it shows nothing on the page can be modified.
Here's the blk512-linux output for that device:
iota:/home/grundler/Src# ./blk512-linux -MS -c 71132960 /dev/sg15
Mode Sense Mask:
0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 00 00
0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0020: 00 00 00 00
Mode Sense Saved:
0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 24 54
0x0010: 00 00 00 14 00 00 02 31 02 08 00 01 00 88 00 60
0x0020: 40 00 00 00
Mode Sense Current:
0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 24 54
0x0010: 00 00 00 14 00 00 02 31 02 08 00 01 00 88 00 60
0x0020: 40 00 00 00
Mode Sense Default:
0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 24 54
0x0010: 00 00 00 14 00 00 02 3d 02 00 00 01 00 88 00 60
0x0020: 40 00 00 00
Mode Select Data:
0x0000: 00 00 00 08 04 3d 67 20 00 00 02 00
mlen 0xc resid 0x0 duration 0 info 0x0
Done setting /dev/sg15 to 71132960 blocks/512 bytes_per_block
iota:/home/grundler/Src#
> So the MODE SENSE format device page (0x3) "data bytes per physical
> sector" does _not_ show 512 bytes after you send the MODE SELECT format
> device page? That is what I (eventually) saw.
correct. I was expecting it show "02 00" in the "current" page if I run
the command a second time or run "scsiinfo -f".
> Did you format the drive after changing the block size?
No. I will When the MODE SENSE for page 3 shows 512 bytes/block.
> Are you sure the mode select is really working in your code?
I have no way of knowing other then device/driver return codes.
And since I don't have a FC protocol analyzer, i need help
to figure out if it's just something silly I'm doing wrong.
It's quite possible the qlogic driver is mangling the command
and/or return values. I'm using qla2300 v6.04.00 with qla2312 chip.
I think the current code is sending "default" page data
for the MODE SELECT. I might try updating the MODE SELECT data
and verify no extra bits are set in the "descriptor" header.
> I suppose there are no other format page values you can change.
The device claims there are none.
> I can't remember when the MODE SENSE format page showed the modified block
> size for me - I believe it was after the MODE SELECT format page, rather
> than after the FORMAT command itself.
yes - that's what I'm expecting. The format command should use the
settings in the "current" page. ergo one should be able to read/write the
contents of the page before issuing format command.
thanks,
grant
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-09 22:39 ` Grant Grundler
@ 2003-06-10 1:53 ` Douglas Gilbert
2003-06-10 17:24 ` Grant Grundler
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Douglas Gilbert @ 2003-06-10 1:53 UTC (permalink / raw)
To: Grant Grundler; +Cc: Patrick Mansfield, linux-scsi
Grant Grundler wrote:
> On Mon, Jun 09, 2003 at 12:29:07PM -0700, Patrick Mansfield wrote:
>
>>I did this for some Seagate FC drives (don't have the exact model numbers
>>handly), but don't have my hacks, and can't find details of my results. I
>>used the same thing you have in your code - set the "direct access device
>>mode paramter block descriptor"'s block length (versus the more obvious
>>data bytes per physical page), and then formatted the drive.
>
>
> thanks - that's good to know that at least I'm banging my head
> bloody against the right wall. I suspect the data isn't going
> out to the device like it's supposed too. But I'm not seeing
> the problem with the code.
>
>
>>Did you try setting the data bytes per physical page?
>
>
> I think so. But I recall checking the "Mask" data for the format mode
> page and it shows nothing on the page can be modified.
> Here's the blk512-linux output for that device:
>
> iota:/home/grundler/Src# ./blk512-linux -MS -c 71132960 /dev/sg15
>
> Mode Sense Mask:
>
> 0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 00 00
> 0x0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> 0x0020: 00 00 00 00
>
> Mode Sense Saved:
>
> 0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 24 54
> 0x0010: 00 00 00 14 00 00 02 31 02 08 00 01 00 88 00 60
> 0x0020: 40 00 00 00
>
> Mode Sense Current:
>
> 0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 24 54
> 0x0010: 00 00 00 14 00 00 02 31 02 08 00 01 00 88 00 60
> 0x0020: 40 00 00 00
>
> Mode Sense Default:
>
> 0x0000: 23 00 10 08 04 2c 1d 80 00 00 02 08 83 16 24 54
> 0x0010: 00 00 00 14 00 00 02 3d 02 00 00 01 00 88 00 60
> 0x0020: 40 00 00 00
>
> Mode Select Data:
>
> 0x0000: 00 00 00 08 04 3d 67 20 00 00 02 00
> mlen 0xc resid 0x0 duration 0 info 0x0
> Done setting /dev/sg15 to 71132960 blocks/512 bytes_per_block
> iota:/home/grundler/Src#
>
>
>
>>So the MODE SENSE format device page (0x3) "data bytes per physical
>>sector" does _not_ show 512 bytes after you send the MODE SELECT format
>>device page? That is what I (eventually) saw.
>
>
> correct. I was expecting it show "02 00" in the "current" page if I run
> the command a second time or run "scsiinfo -f".
>
>
>
>>Did you format the drive after changing the block size?
>
>
> No. I will When the MODE SENSE for page 3 shows 512 bytes/block.
>
>
>
>>Are you sure the mode select is really working in your code?
>
>
> I have no way of knowing other then device/driver return codes.
> And since I don't have a FC protocol analyzer, i need help
> to figure out if it's just something silly I'm doing wrong.
>
> It's quite possible the qlogic driver is mangling the command
> and/or return values. I'm using qla2300 v6.04.00 with qla2312 chip.
>
> I think the current code is sending "default" page data
> for the MODE SELECT. I might try updating the MODE SELECT data
> and verify no extra bits are set in the "descriptor" header.
>
>
>>I suppose there are no other format page values you can change.
>
>
> The device claims there are none.
>
>
>
>>I can't remember when the MODE SENSE format page showed the modified block
>>size for me - I believe it was after the MODE SELECT format page, rather
>>than after the FORMAT command itself.
>
>
> yes - that's what I'm expecting. The format command should use the
> settings in the "current" page. ergo one should be able to read/write the
> contents of the page before issuing format command.
Grant,
www.seagate.com have a tool called "seatool" that may
do the trick for you.
Doug Gilbert
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-10 1:53 ` Douglas Gilbert
@ 2003-06-10 17:24 ` Grant Grundler
2003-06-10 20:54 ` Grant Grundler
2003-06-18 20:19 ` Grant Grundler
2 siblings, 0 replies; 10+ messages in thread
From: Grant Grundler @ 2003-06-10 17:24 UTC (permalink / raw)
To: Douglas Gilbert; +Cc: Patrick Mansfield, linux-scsi
On Tue, Jun 10, 2003 at 11:53:56AM +1000, Douglas Gilbert wrote:
> www.seagate.com have a tool called "seatool" that may
> do the trick for you.
Doug,
thanks - but last time I checked, it's an x86 binary only driver.
I guess I could try it anyway and see if the IOCTLs have
32-bit compat support in ia64 kernel.
thanks,
grant
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-10 1:53 ` Douglas Gilbert
2003-06-10 17:24 ` Grant Grundler
@ 2003-06-10 20:54 ` Grant Grundler
2003-06-18 20:19 ` Grant Grundler
2 siblings, 0 replies; 10+ messages in thread
From: Grant Grundler @ 2003-06-10 20:54 UTC (permalink / raw)
To: Douglas Gilbert; +Cc: Patrick Mansfield, linux-scsi
On Tue, Jun 10, 2003 at 11:53:56AM +1000, Douglas Gilbert wrote:
> www.seagate.com have a tool called "seatool" that may do the trick for you.
http://seatool.seagate.com/
It in fact did for at least one of the mechs (ST318304FC).
I'll iterate through the others.
But "st" can not query the status of the format it kicks off...
and thus it will never terminate properly on an ia64-linux machine:
...
read_capacity (SG_IO) error: Bad address
FORMAT on drive /dev/sg24 is 0 % complete . . .
...
I ^C 'd the program after 2 hours and all was well.
I suspect the format doesn't take the long though
(40 minutes for 9G 10K rpm was previous experience).
I'll run "strace -o st.out st -B 512 ..." on the next round and see
what magic the program is doing. That might give me enough clues to
get my own code working.
thanks,
grant
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-10 1:53 ` Douglas Gilbert
2003-06-10 17:24 ` Grant Grundler
2003-06-10 20:54 ` Grant Grundler
@ 2003-06-18 20:19 ` Grant Grundler
2 siblings, 0 replies; 10+ messages in thread
From: Grant Grundler @ 2003-06-18 20:19 UTC (permalink / raw)
To: Douglas Gilbert; +Cc: Patrick Mansfield, linux-scsi
[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]
On Tue, Jun 10, 2003 at 11:53:56AM +1000, Douglas Gilbert wrote:
> www.seagate.com have a tool called "seatool" that may
> do the trick for you.
Douglas,
I don't recall if I followed up - "st" in fact did work on ia64.
The FC drives are now 512 byte sector. The "read_capacity" call
to monitor FORMAT_UNIT progress fails even though the FORMAT_UNIT
seems to complete successfully.
I also wrote a script (attached) to identify the block size of each
"sg" device.
In the interest of writing a "generic" tool, can someone decode the
SG command below?
I'm using the 2.4 SG interface and still haven't found any decent
description how the 2.2 SG kernel interface works.
open("/dev/sg26", O_RDWR) = 7
write(7, "\x00\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x00\x15\x11\x00\x00\x0c\x00\x00\x00\x00\x08\x04\x2c\x1d\x80\x00\x00\x02\x00", 54) = 54
read(7, "\x24\x00\x00\x00\x24\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 36) = 36
(After logging the entry in stlog.txt, "st" sends a FORMAT_UNIT.)
thanks,
grant
[-- Attachment #2: list_sg --]
[-- Type: text/plain, Size: 246 bytes --]
for i in 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
do echo -n "sg$i "
scsiinfo -i /dev/sg$i | gawk '/Product/ {printf $2 "\t"}'
scsiinfo -f /dev/sg$i | gawk '/Bytes per sector/ {print $4}'
done
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: convert 520 byte sector disk to 512 byte sector?
2003-06-09 19:29 ` Patrick Mansfield
2003-06-09 22:39 ` Grant Grundler
@ 2003-06-10 0:36 ` Grant Grundler
1 sibling, 0 replies; 10+ messages in thread
From: Grant Grundler @ 2003-06-10 0:36 UTC (permalink / raw)
To: Patrick Mansfield; +Cc: linux-scsi
On Mon, Jun 09, 2003 at 12:29:07PM -0700, Patrick Mansfield wrote:
> Are you sure the mode select is really working in your code?
Short answer, i don't think so.
I found a SCSI IBM "DGHS09Y CLAR09" still formatted to 520 byte.
I've twiddled the code a bit so the output isn't identical to
previous FC runs. But my main goal is to show the format mode
page "Mask" isn't all zero's for this drive and blk512-linux.c
doesn't work for a "regular" SCSI drive either.
The DGHS09Y drive is behind 53c1030 (built-in) using mpt v2.03.00 driver.
thanks,
grant
iota:/home/grundler/Src/blk512# scsiinfo -i /dev/sg0
Inquiry command
---------------
Relative Address 0
Wide bus 32 0
Wide bus 16 1
Synchronous neg. 1
Linked Commands 1
Command Queueing 1
SftRe 0
Device Type 0
Peripheral Qualifier 0
Removable? 0
Device Type Modifier 0
ISO Version 0
ECMA Version 0
ANSI Version 3
AENC 0
TrmIOP 0
Response Data Format 2
Vendor: IBM
Product: DGHS09Y CLAR09
Revision level: HP1A68007236GAGSPDH01A DG11802742000
iota:/home/grundler/Src/blk512# ./blk512-linux -s 512 -c 17916240 /dev/sg0
Mode Sense Current:
0x0000: 23 00 10 08 00 ff ff ff 00 00 02 08 83 16 00 0a
0x0010: 00 02 00 00 00 00 01 13 02 08 00 01 00 1c 00 47
0x0020: 40 00 00 00
Mode Sense Default:
0x0000: 23 00 10 08 00 ff ff ff 00 00 02 08 83 16 00 0a
0x0010: 00 02 00 00 00 00 01 13 02 08 00 01 00 1c 00 47
0x0020: 40 00 00 00
Mode Select Data:
0x0000: 00 00 00 08 01 11 61 50 00 00 02 00
mlen 0xc resid 0xb duration 0 info 0x0
Done setting /dev/sg0 to 17916240 blocks/512 bytes_per_block
iota:/home/grundler/Src/blk512# scsiinfo -f /dev/sg0
Data from Format Device Page
----------------------------
Removable Medium 0
Supports Hard Sectoring 1
Supports Soft Sectoring 0
Addresses assigned by surface 0
Tracks per Zone 10
Alternate sectors per zone 2
Alternate tracks per zone 0
Alternate tracks per lun 0
Sectors per track 275
Bytes per sector 520
Interleave 1
Track skew factor 28
Cylinder skew factor 71
iota:/home/grundler/Src/blk512# ./blk512-linux -M -s 512 -c 17916240 /dev/sg0
Mode Sense Mask:
0x0000: 23 00 10 08 00 ff ff ff 00 00 02 08 83 16 ff ff
0x0010: ff ff 00 00 00 00 00 00 ff ff ff ff 00 00 00 00
0x0020: 00 00 00 00
Mode Sense Current:
0x0000: 23 00 10 08 00 ff ff ff 00 00 02 08 83 16 00 0a
0x0010: 00 02 00 00 00 00 01 13 02 08 00 01 00 1c 00 47
0x0020: 40 00 00 00
Mode Sense Default:
0x0000: 23 00 10 08 00 ff ff ff 00 00 02 08 83 16 00 0a
0x0010: 00 02 00 00 00 00 01 13 02 08 00 01 00 1c 00 47
0x0020: 40 00 00 00
Mode Select Data:
0x0000: 00 00 00 08 01 11 61 50 00 00 02 00 03 16 00 0a
0x0010: 00 02 00 00 00 00 01 13 02 00 00 01 00 1c 00 47
0x0020: 40 00 00 00
mlen 0x24 resid 0x23 duration 0 info 0x0
Done setting /dev/sg0 to 17916240 blocks/512 bytes_per_block
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2003-06-18 20:38 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-10 18:32 convert 520 byte sector disk to 512 byte sector? Cress, Andrew R
2003-06-18 20:52 ` Grant Grundler
-- strict thread matches above, loose matches on Subject: below --
2003-06-09 17:46 Grant Grundler
2003-06-09 19:29 ` Patrick Mansfield
2003-06-09 22:39 ` Grant Grundler
2003-06-10 1:53 ` Douglas Gilbert
2003-06-10 17:24 ` Grant Grundler
2003-06-10 20:54 ` Grant Grundler
2003-06-18 20:19 ` Grant Grundler
2003-06-10 0:36 ` Grant Grundler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox