Port-sparc64 archive

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

Re: Solved-Kludge: Netra T1 + RaidFrame boot problems



On Sun, 11 May 2008, Julian Coleman wrote:

> Hi,
> 
> >      NetBSD IEEE 1275 Bootblock
> >      .Inode not directory
> >      Fast Data Access MMU Miss
> 
> >                              My solution was to do this:
> 
> >      # dd if=/dev/rsd0c of=/dev/rsd1c bs=512 count=64
> > 
> > To replace the boot block on sd1 with the boot block from sd0
> 
> There is a bug in the first stage loader when a disk has been previously
> partitioned normally and later partitioned as part of a RAID 1 set.  Part
> of the original disklabel is still present and this confuses the loader.
> 
> The solution is to fix the boot loader.  A volunteer with forth knowledge
> would be appreciated.

Gee, I would have thought this was simple enough to be fixed by now.

By default filesystems start 8KB into the disk image to allow for a label
(1 512 byte sector) and bootblock (15 512 byte sectors or 7.5KB).  I 
believe RaidFrame adds an additional 64KB to the beginning of the 
partition.  (Why?  Let's not go there.)

The boot block starts with a zero "raid-offset".  It looks for a valid 
superblock at "sboff" which is what, 8KB into the image?  If it doesn't
see a valid UFS superblock there, it sets "raid-offset" to the value
of "rf_protected" and tries again at "rf_protected" * "dev_bsize" + 
"sboff".

You should be able to reverse the logic in "ufs-open" by first checking at 
"rf_protected" * "dev_bsize" + "sboff" and only looking at "sboff" if that 
fails.  

I never did that because I was concerned about what happens if you are not 
running RaidFrame but you happen to find a valid "fs_magic_value" at 
"rf_protected" * "dev_bsize" + "sboff".

Eduardo




Home | Main Index | Thread Index | Old Index