On Sat, Jun 20, 2015 at 11:05:31AM -0400, Zack Weinberg wrote:
>
> e2fsck successfully repairs both the skeleton image and the complete
> partition image when they are on a known-good disk.
OK, so this is a storage device issue. I'd be taking a very jaundiced
look at the reliability/correctness of your drives.
It could be that they have a firmware bug in how they handle 512e
emulation. (See below.) Or maybe one or more is starting to go bad.
(Not all drive failures are predicted by S.M.A.R.T. In fact, only
about 50-66% of drive failures are predicted by SMART. Think about
that the next time you are tempted to skimp on backups. :-)
> Here's some more detail about the partition. The "Partition does not
> start on physical sector boundary" thing might be relevant. (I can't
> say I understand how that can even happen, though.)
Modern hard drives either are have 512e or 4k sectors. 512 byte
emulation is provided for backwards compatibility for Windows XP.
This means that they have a logical sector size of 512, and a physical
sector size of 4069. This means that it's *allowed* for you to send
writes which are multiple of 512, but which are not aligned on the
4096 byte boundary or not a multiple of 4096 bytes. However, the
drive will do a read-modify-write cycle, which is not the most
efficient thing in the world. If the partition is not aligned on a 4k
boundary, then *all* writes will be subject to a read-modify-write
cycle, which will of course trash your write performance.
For drives with a physical and logical sector size of 4k, then in
fact, the LBA numbers sent to the hard drive is in units of 4k. So a
drive LBA of 2 represents the physical sector which is 8192 bytes from
the beginning of the disk. However, Linux internal always uses sector
numbers which are in units of 512 bytes, so when you see terms like
LBA thrown around, you need to be careful about whether you are
talking about LBA's from the POV of the Linux kernel, or LBA's from
the SATA/SCSI specification's point of view.
In Linux, the device driver will take a request to read LBA #12 with a
sector count of 8 and turn that into a SATA command requesting read of
2 drive sectors starting at drive LBA #3. Hence, on a sector with 4k
logical/physical sectors, it is *impossible* to send misaligned reads
or writes; we talk to the drive in units of 4k.
> Device Boot Start End Sectors Size Id Type
> /dev/md127p1 63 128005919 128005857 61G 83 Linux
> /dev/md127p2 128005920 1113433019 985427100 469.9G 83 Linux
>
> Partition 1 does not start on physical sector boundary.
> Partition 2 does not start on physical sector boundary.
> Remaining 7236 unallocated 512-byte sectors.
Yeah, that's not good. Congratulation, whatever software set up your
RAID configuration is as intelligent (or as obsolete) as Windows XP.
Which explains why hard drive vendors are still selling 512e drives,
although they devoutly wish they could stop.
It took them a decade longer to introduce native 4k sector drives than
they had originally wished, and most of this can be blamed on the
failure of Windows Vista and the fact that enterprises stuck with
Windows XP for much longer than anyone (including Microsoft) would
have wanted.
- Ted
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]