Thread (3 messages) 3 messages, 3 authors, 2014-03-14

Re: mapping disk sectors to files

From: Phil Turmel <hidden>
Date: 2014-03-14 12:13:05

Good morning Thorsten,

On 03/14/2014 02:23 AM, Thorsten von Eicken wrote:
I've just had a disk in a raid1 mirror set die and that exposed some bad
block on the remaining drive -- ooops! I'd now like to map the bad
blocks to files so I can restore the affected files from backups, but I
can't figure out the mapping. What I've done:
[trim /]
The GPT is:
Disk /dev/sda: 3907029168 sectors, 1.8 TiB
   3          935936      3907029134   1.8 TiB     FD00  Linux RAID
The md device says:
# mdadm --examine /dev/sda3
/dev/sda3:
          Magic : a92b4efc
        Version : 1.2
     Raid Level : raid1

    Data Offset : 2048 sectors
These key pieces of info tell you that the blocks in /dev/md0 start at
sector 2048 in /dev/sda3, which itself starts at sector 935936 of the
disk as a whole.  As a raid1, the blocks are 1:1 linear from there.

So all you've missed in your calculations is the 2048 sector offset of
the md data area.  Add that to your partition start value and you'll be
golden.

HTH,

Phil
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help