Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Formatting a 4k sector hard drive [unsolved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jonfr
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1008
Location: Denmark

PostPosted: Fri Dec 17, 2010 1:48 am    Post subject: Formatting a 4k sector hard drive [unsolved] Reply with quote

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.

Code:
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.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23064

PostPosted: Fri Dec 17, 2010 4:04 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
floppymaster
Developer
Developer


Joined: 07 Jul 2010
Posts: 231
Location: Detroit, MI, USA

PostPosted: Fri Dec 17, 2010 4:11 am    Post subject: Reply with quote

From fdisk(8):
Code:
       -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.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Fri Dec 17, 2010 8:32 am    Post subject: Reply with quote

check
https://forums.gentoo.org/viewtopic-p-6354995-highlight-green.html#6354995
Back to top
View user's profile Send private message
jonfr
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1008
Location: Denmark

PostPosted: Fri Dec 17, 2010 9:17 am    Post subject: Reply with quote

I did format the hard drive using information from this web site. How can I check if the format is 4K cluster size ?
Back to top
View user's profile Send private message
augury
l33t
l33t


Joined: 22 May 2004
Posts: 722
Location: philadelphia

PostPosted: Mon Dec 20, 2010 12:25 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
augury
l33t
l33t


Joined: 22 May 2004
Posts: 722
Location: philadelphia

PostPosted: Mon Dec 20, 2010 1:42 am    Post subject: Reply with quote

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"
Code:

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>:
Back to top
View user's profile Send private message
jonfr
Veteran
Veteran


Joined: 20 Jul 2003
Posts: 1008
Location: Denmark

PostPosted: Mon Dec 20, 2010 1:49 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
augury
l33t
l33t


Joined: 22 May 2004
Posts: 722
Location: philadelphia

PostPosted: Thu Dec 23, 2010 3:48 am    Post subject: Reply with quote

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. :P

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

Still have my CRT :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum