# Formatting a 4k sector hard drive [unsolved]

## jonfr

I have been trying to find a good information on how to partition a 1TB WD Green hard drive. This hard drive has 4096-bytes sectors (4K). The current versions of cfdisk or fdisk don't support this by default. But I have to re-setup the hard drive to properly use the 4K sectors.

Information about the hard drive.

```
sd 2:0:0:0: [sdb] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)

sd 2:0:0:0: [sdb] Write Protect is off

sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00

sd 2:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

 sdb:

```

Thanks for the help.

----------

## Hu

I believe you can use sfdisk to set the right values.  I found it simplest to make partitions that were approximately right, then use sfdisk -d to print the table, edit it to be exactly correct, then reload it from the modified output.

----------

## floppymaster

From fdisk(8):

```
       -b sectorsize

              Specify the sector size of the disk. Valid values are  512,  1024,  2048  or

              4096.  (Recent kernels know the sector size. Use this only on old kernels or

              to override the kernel's ideas.) Since util-linux-ng 2.17 fdisk  differenti‐

              ates between logical and physical sector size. This option changes both sec‐

              tor sizes to sectorsize.
```

----------

## krinn

check

https://forums.gentoo.org/viewtopic-p-6354995-highlight-green.html#6354995

----------

## jonfr

I did format the hard drive using information from this web site. How can I check if the format is 4K cluster size ?

----------

## augury

Do you want the "low-level" formating?

I've used "sformat" to reformat 520 blocks (some OS's use these, SUN)   into 512 blocks on fibre channel (the disappointing way to connect a hard drive -- or ten in a series)  connected scsi drives.  The reason: linux won't read those blocks.  They are actually 512 blocks but there is some anti-corruption hash data in the other 8k.  Linux won't work with that sort of crap on the lowlevel.  What makes no sense to you at all ..?.. hmmm ..?..  They run a 2.4 kernel.  The nfs is buffered with an ata posted off of the shelf.

You could use sformat, I would assume, to create blocks of any size.  Getting linux to function/mount/fdisk them -- IDK.

It takes a little while.  The drives controllers will need to be able to function with these new blocks.  They are written to areas of the disk that will not be returned as data that has not been read.  I would assume it is a nonissue.

----------

## augury

Debian has an sformat sformat_3.5-1.2_i386.deb  at http://packages.debian.org/sid/i386/sformat/download

To unpack the binaries you need  #emerge deb2targz

The sformat is good at finding and probing the luns.

I have a disk that is offline and I will have to unplug/replug with the power on before it will reset again.  (this is my boot drive).  It clicks when its "out".  And I can't boot up.  The system doesn't have any info for it.

It is in a raid 0 with "scsibus1 1,0,0"

```

sformat: No such file or directory. Can't open '/opt/schily/etc/sformat.dat'.

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) *

        0,3,0     3) *

        0,4,0     4) *

        0,5,0     5) *

        0,6,0     6) *

        0,7,0     7) *

scsibus1:

        1,0,0   100) 'ATA     ' 'ST380817AS      ' '3.42' Disk

        1,1,0   101) *

        1,2,0   102) *

        1,3,0   103) *

        1,4,0   104) *

        1,5,0   105) *

        1,6,0   106) *

        1,7,0   107) *

scsibus2:

        2,0,0   200) 'ATA     ' 'WDC WD1200JD-00G' '02.0' Disk

        2,1,0   201) *

        2,2,0   202) *

        2,3,0   203) *

        2,4,0   204) *

        2,5,0   205) *

        2,6,0   206) *

        2,7,0   207) *

scsibus3:

        3,0,0   300) 'ATA     ' 'ST3200822AS     ' '3.01' Disk

        3,1,0   301) *

        3,2,0   302) *

        3,3,0   303) *

        3,4,0   304) *

        3,5,0   305) *

        3,6,0   306) *

        3,7,0   307) *

Select target -1 (100 - 300)/<cr>:
```

----------

## jonfr

If your drive "clicks" it is time to replace it. There is nothing that you can do for it. Just save your data to a new hard drive.

----------

## augury

Not just my HD's, my memory is a failure and my processor is running on half time.

I bought 3 Seagate nearlines 400G (refubished) for $84.  Should be here soon.

The disc is definitely unsuitable for operating.  I have this error at .... oh shit, IDK, I've filled dmesg up with garbly-goop.  I was able to get my data off of the 0 array alright.  It is somewhere around 5G that I can no longer write to the disk and it is a major point of fuzzy logic to the system.

Those disks won't do 4096.  I tried.  sformat will write what it can.  Works for FC discs though.  It's really no matter, just as long as I get my bits in space of time we've all come to expect.   :Razz: 

I'm going to pick up my server.  Play with it. 

Still have my CRT  :Wink: 

----------

