Re: RAID superblock....

Neil Brown (neilb@cse.unsw.edu.au)
Mon, 11 Mar 2002 10:34:23 +1100 (EST)


On Sunday March 10, R.E.Wolff@BitWizard.nl wrote:
>
> Hi,
>
> The MD code I see doing:
>
>
> 488 sb_offset = calc_dev_sboffset(rdev->dev, rdev->mddev, 1);
> 489 rdev->sb_offset = sb_offset;
> 490 fsync_dev(dev);
> 491 set_blocksize (dev, MD_SB_BYTES);
> 492 bh = bread (dev, sb_offset / MD_SB_BLOCKS, MD_SB_BYTES);
>
>
> where sb_offset is calculated as:
>
> 290 if (blk_size[MAJOR(dev)])
> 291 size = blk_size[MAJOR(dev)][MINOR(dev)];

You missed:
if (persistent)
size = MD_NEW_SIZE_BLOCKS(size);

where MD_NEW_SIZE_BLOCKS is
#define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS)

and there you have your "-1".

> Anyway on the old machine, I still cannot find the raid superblock by
> hand, but the drives now mount, so the kernel must have been able to
> locate them somehow......

The superblock should be located between 64K and 128K from the end of
the device, on a 64K boundary.
>

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/