[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hard drive bad sector warning



On 10/09/11 18:22, yudi v wrote:

    Use GPD instead of DOS partition types, *and* use parted instead of
    fdisk.


I used fdisk to partition the disk before installing the OS.

d-i uses parted (partman).
I know the first release of Squeeze failed to properly align 4K sectors with partitions - but using the udeb from Wheezy fixed that for me - it could be fixed in a previous point release, and, it could be just a DOS partition table issue (what I used in that instance). I could have manually aligned partitions but I'm lazy.

NOTE: neither fdisk or parted is the cause of your original problem...

Just to
make sure all the partitions started on the physical sector boundaries.
The fdisk output posted above looks fine, doesn't it? I followed this
article http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/

Roderick W. Smith writes very much like an Ubuntu poster called srs5694...

Note that the author doesn't say you *must* use fdisk (it's just his preference) or that you should use it prior to installing to the same drive - he's just writing (re-phrasing) information on why failing to align partitions to sectors on newer, larger sector, hard drives stops performance loss. His article is *not* wrong, except that he compares an old version of parted with a new version of fdisk [*1]

The Debian installer does *not* suffer from these failing. Note also that while he says to use u (CLI -u) option with fdisk[*2],

[quote]you can, however, align partitions properly with any version of fdisk. To do this, you should change the default units from cylinders to sectors by typing u at the main menu.[/quote]

he then makes using a similar option with parted sound like a parted failing...

[quote]Through version 2.1[*1], the text-mode GNU Parted program (command name parted) provides little support for aligning on anything but cylinder boundaries. The best approach may be to type unit s to change the default unit to sectors
[/quote]

The article is mostly about performance, it's dated as few 4096B drives had been released at the time, and support was patchy:- http://rhn.redhat.com/errata/RHBA-2011-0699.html is when more support began upstream.

[*1]relevant only to Lenny and earlier
[*2]you *should also use the c flag, *unless* you want to actually install DOS.

Except for the sda4 all the other partitions start on sector that's a
multiple of 8. I don't see any problem there.

That's a partition alignment issue (performance and redundant given that d-i automagically does the same thing).
Sector size is a separate issue, hence your error message:-

[quote]
Warning: The driver descriptor says the physical block size is 512 bytes, but Linux says it is 2048 bytes.
[/quote]

Which seems to indicate a problem with the driver - and the kernel.

Check that your kernel supports larger sectors - see further in this post - if it does, file a bug report on the driver.

Also see http://lwn.net/Articles/377895/ for an overview of the problems.

could you please elaborate on your preference for parted over fdisk.

It'd be easier if you asked me for reasons to use fdisk over parted (eg. support for brain-damaged partitions, DOS, etc).

Current version of fdisk (man fdisk):-
"-b sectorsize
Specify the sector size of the disk. Valid values are 512, 1024, or 2048. (Recent kernels know the sector size. Use this only on old kernels or to override the kernel's ideas.)"

No work-a-round for that... (unless thunk type layers are considered valid work-a-rounds, which tends to lead to the sort of performance losses you get from not aligning 4K sectors with partitions).

parted supports scripting better than fdisk, and much of GNU linux is built around parted libraries. parted recieves more development.

NOTE: most Debian kernels do support the larger sectors, but you can check with:-
cat /sys/block/<drive_eg_sda>/queue/physical_block_size

parted is very strict about partitions, fdisk is far more tolerant. Opinions vary as to which is better (sloppy or strict).

If you are going to use fdisk:-
don't use DOS-compatible mode (for backward compatibility this mode is enable by default, you have to use command 'c' or '-c' command line option to disable DOS mode. Note that for the next major release the DOS mode will be disable by default.)
use sectors as display units (command 'u' or '-u' command line option)
all default sizes/offsets are aligned to the physical block boundary (e.g. "First sector" dialog always provides aligned default) use +size{M,G} convention to specify "Last sector" (e.g. +5G to create 5GiB partition) then fdiskl aligns the size to physical block boundary don't forget that fdisk(8) always follows your wishes -- it means that if you explicitly define first/last sector number then the partition could be misaligned

GPT and parted are like UTF and HTML tables - people will stick with what they know in a changed environment simply because it's what they know, and it's worked in the past.


Is it GPT?� If it's GPT, I cannot use it as my 5yr old laptop does not
support it.

How so (eg. what error message do you get)??

Isn't� EFI/UEFI needed to use GPT?

No. It's part of Intel's EFI specs, which I presume is where that conclusion comes from (EFI is *not* needed to support GPD).

In a DOS type partition table the starting offset and the size of each partition is as an absolute number of sectors (given in 32 bits).Thats OK (with 512-byte sectors) but that limits partitions to 2 TB.

The merits of GPT have been covered exhaustively in other threads on this list - by people better at succinct explantation than me.


    The good news it that there's most likely nothing wrong with your drive.


Hope so.

The retailer not taking responsibility for damaged drives is standard - it's why support contracts are popular :-/



--
Kind regards,
Yudi


NOTES:
if you ever need to fix misaligned partitions try testdisk.

Early WD 4096B drives didn't announce themselves as 4096B sectors which caused problems (not that WD is evil, they simply released the first large sector drives).

many of the complaints about parted are based on 2009 experiences.

gnu-fdisk pretty much *is* parted



Cheers

Refs:-
http://en.wikipedia.org/wiki/GUID_Partition_Table
http://en.wikipedia.org/wiki/Advanced_format
http://wdc.custhelp.com/app/answers/detail/a_id/5655/~/how-to-install-a-wd-advanced-format-drive-on-a-non-windows-operating-system
http://www.wdc.com/wdproducts/library/whitepapers/eng/2579-771430.pdf
http://people.redhat.com/msnitzer/docs/io-limits.txt

--
"It's really weird how your life changes. Tonight I'm drinking water. Four years ago? Opium. Night and day, you know?"
— Bill Hicks


Reply to: