Skip to contentSkip to conversation

Low-level reformat with different sector size: ?

DISCUSSION Matthias Urlichs 3 participants 6 messages Jun 29, 2007 – Jun 30, 2007 SCSI

lore
Share & tools
lore
#0 lore raw

Hello,

Yesterday I managed to buy a couple of SCA disks with a sector size of ... *drumroll* ... 524.

What's the easiest way to re-format these to use 512 bytes? Preferably without screwing up anything else on these things?

I tried sformat, which reported some rather broken data:

# sformat
sformat SCSI format/analysis/repair utilities
Release 3.4, Copyright J. Schilling

scsibus0:

        0,0,0     0) *
        0,1,0     1) *
        0,2,0     2) 'S330L  !' 'C0
                                  P' '' Disk
        0,3,0     3) *
        0,4,0     4) 'S330L  !' 'C0' 'P?' Disk
        0,5,0     5) 'S330L  !' 'C0`P#  ' '?' Disk
        0,6,0     6) *
        0,7,0     7) *
Select target -1 (2 - 5)/<cr>:2
scsibus0 target 2:
        0,2,0     0) 'S330L  !' 'C0
                                  P' '' Disk
        0,2,1     1) *
        0,2,2     2) *
        0,2,3     3) *
        0,2,4     4) *
        0,2,5     5) *
        0,2,6     6) *
        0,2,7     7) *

Select lun -1 (0 - 0)/<cr>:0
scsibus0 target 2 lun 0
Device type : Disk
Version : 7
Response Format: 1
Vendor_info : 'S330L !'
Identifikation : 'C0

                   P'

Revision : ''
Device seems to be: Generic CCS Disk.
sformat: PANIC Sectorsize.
#

... Oops?

Kernel: 2.6.22 (Ubuntu development)

Signature · 4 lines
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [email protected]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
I have seen the Great Pretender and he is not what he seems.
#1 lore raw
Quoted 5 lines · Matthias Urlichs

Yesterday I managed to buy a couple of SCA disks with a sector size of ... *drumroll* ... 524.

What's the easiest way to re-format these to use 512 bytes? Preferably without screwing up anything else on these things?

We use this program go reformat 520 sector size disks back to 512:

http://parisc-linux.org/~jejb/blk512-linux.c

It should work for your device as well. Beware it requires a complete low level format to achieve this, which can take a very long time.

James

#2 lore raw
Quoted 7 lines · James Bottomley
Quoted 5 lines · Matthias Urlichs

Yesterday I managed to buy a couple of SCA disks with a sector size of ... *drumroll* ... 524.

What's the easiest way to re-format these to use 512 bytes? Preferably without screwing up anything else on these things?

Quoted 6 lines

We use this program go reformat 520 sector size disks back to 512:

http://parisc-linux.org/~jejb/blk512-linux.c

It should work for your device as well. Beware it requires a complete low level format to achieve this, which can take a very long time.

I might mention at this point that sg_format is derived from blk512-linux.c . Both should be able to format recent SCSI disks (e.g. manufactured in this millennium). sformat is an older program. All of them invoke the SCSI FORMAT command. If the SCSI FORMAT command is examined in SCSI-2, SBC, SBC-2 and SBC-3 then it can be seen as quite complex. Over the 15 year period spanned by those standards (SBC-3 is still a draft) it has become more complex and changed somewhat.

The first terabyte SCSI disk was announced this week. I wonder how long it takes to format.

Doug Gilbert

#3 lore raw
In reply to Matthias Urlichs
Quoted 44 lines · Matthias Urlichs

Hello,

Yesterday I managed to buy a couple of SCA disks with a sector size of ... *drumroll* ... 524.

What's the easiest way to re-format these to use 512 bytes? Preferably without screwing up anything else on these things?

I tried sformat, which reported some rather broken data:

# sformat
sformat SCSI format/analysis/repair utilities
Release 3.4, Copyright J. Schilling

scsibus0:

        0,0,0     0) *
        0,1,0     1) *
        0,2,0     2) 'S330L  !' 'C0
                                  P' '' Disk
        0,3,0     3) *
        0,4,0     4) 'S330L  !' 'C0' 'P?' Disk
        0,5,0     5) 'S330L  !' 'C0`P#  ' '?' Disk
        0,6,0     6) *
        0,7,0     7) *
Select target -1 (2 - 5)/<cr>:2
scsibus0 target 2:
        0,2,0     0) 'S330L  !' 'C0
                                  P' '' Disk
        0,2,1     1) *
        0,2,2     2) *
        0,2,3     3) *
        0,2,4     4) *
        0,2,5     5) *
        0,2,6     6) *
        0,2,7     7) *

Select lun -1 (0 - 0)/<cr>:0
scsibus0 target 2 lun 0
Device type : Disk
Version : 7
Response Format: 1
Vendor_info : 'S330L !'
Identifikation : 'C0

                   P'
Quoted 8 lines

Revision : ''
Device seems to be: Generic CCS Disk.
sformat: PANIC Sectorsize.
#

... Oops?

Kernel: 2.6.22 (Ubuntu development)

Matthias,
Have a look at sg_format in the sg3_utils package.

Assuming you want to reformat /dev/sdc to 512 byte sector size the you could use:

    sg_format --format --size=512 /dev/sdc

See sg_format's man page for more information.

Doug Gilbert

#4 lore raw
In reply to Matthias Urlichs
Quoted 7 lines · Matthias Urlichs

Hello,

Yesterday I managed to buy a couple of SCA disks with a sector size of ... *drumroll* ... 524.

What's the easiest way to re-format these to use 512 bytes? Preferably without screwing up anything else on these things?

Umm, I hope you don't consider losing all the previous data on the disks when a re-format is performed as "screwing up"?

Doug Gilbert

#5 lore raw
Quoted 2 lines · Douglas Gilbert

Umm, I hope you don't consider losing all the previous data on the disks when a re-format is performed as "screwing up"?

*Giggle* As I just got the disk, have no idea what's on it, and can't read it in any case (OK, so I could use /dev/sg*...), that would be rather silly.

No, I consider "reformat it in such a way that the disk now reports 512 bytes instead of 70 GBytes, total" or "brick it" to be screw-ups. Anything else I can live with. If nothing else, German consumer code happily gives me 14-day return rights, so if nothing else works I can send the things back.

Right now, though, it looks like there's something else broken. *This* does not look normal at all:

# sg_format --format --size=512 --count=-1 --verbose /dev/sg1
    inquiry cdb: 12 00 00 00 24 00 
    inquiry: requested 36 bytes but got 18 bytes
    S330L  !  C0     peripheral_type: disk [0x0]
      PROTECT=1
      << supports 'protection information'>>
    mode sense (10) cdb: 5a 00 01 00 00 00 00 00 fc 00 
    mode sense (10): requested 252 bytes but got 14 bytes
Mode sense (block descriptor) data, prior to changes:
  Number of blocks=2177429504 [0x81c8f000]
  Block size=2615479 [0x27e8b7]
Need to perform MODE SELECT (to change number or blocks or block length)
but (single) block descriptor not found in earlier MODE SENSE
#

This happens on all three disks, so it seems that either the OS or the controller are screwing things up royally. :-/

Signature · 7 lines
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [email protected]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Accuracy:
	Exploded concept. Foolish, Platonic notion that we can get our facts
	straight.
		-- Fashionable Dictionary (www.butterfliesandwheels.com)