Discussion:
Booting on raid1 rootfs
BERTRAND Joël
2014-02-23 16:24:30 UTC
Permalink
Hello,

I'm trying to install NetBSD on a SS20. I have built a raid1 system as
I have done on several sparc64 without any trouble. Now, system is on
NetBSD/sparc Secondary Boot, Revision 1.15
.....
Booting netbsd
: trying netbsd.gz
Booting netbsd.gz
: trying netbsd.old
....

I have seen that sparc supports raid1 rootfs, but how can I install
bootblock ? I have tried in /dev/rsd1a and in /dev/rsd1c without any
success.

Any idea ? I have only found old articles that don't give any solution.

Regards,

JKB
Martin Husemann
2014-02-23 20:23:48 UTC
Permalink
Post by BERTRAND Joël
I have seen that sparc supports raid1 rootfs, but how can I install
bootblock ? I have tried in /dev/rsd1a and in /dev/rsd1c without any
success.
Dim memory says I installed them to rsd0c and rsd1c (or whatever disks
make up your raid0). Maybe installboot should be smarter?

Martin
BERTRAND Joël
2014-02-24 12:44:41 UTC
Permalink
Post by Martin Husemann
Post by BERTRAND Joël
I have seen that sparc supports raid1 rootfs, but how can I install
bootblock ? I have tried in /dev/rsd1a and in /dev/rsd1c without any
success.
Dim memory says I installed them to rsd0c and rsd1c (or whatever disks
make up your raid0). Maybe installboot should be smarter?
Martin
Original NetBSD installation was done on /dev/sd0a. I have created a
raid1 array with /dev/sd1a and one absent disk.

I have tried to install bootblock with :
# installboot -v /dev/rsd1a /usr/mdec/bootxx /boot
and
# installboot -v /dev/rsd1c /usr/mdec/bootxx /boot

I can send installblock output this evening.

Installboot does not return any error. Some time ago, I have seen the
same trouble on sparc64 and I have fixed it by installing bootblock on
raid array instead of whole disk.

OBP can find boot block with boot disk1 or boot disk1:a, but is unable
to find kernel on raid array.

Best regards,

JB
Brian Buhrow
2014-02-24 19:01:28 UTC
Permalink
Hello. I'm not sure if the Sparc port is the same, but on I386 and
Amd64, you need to insure the ffs filesystem on the raid set begins 64
sectors from the beginning of the partition from which you're booting. The
secondary boot block is getting loaded, as evidenced by your output, and
it's looking for the kernel either on the ffs partition beginning at the
end of the disklabel for the partition you're booting from or 64 sectors
into the partition you're booting from. 64 sectors may not correspond to a
cylinder boundary with your disk's geometry and if you aligned your
filesystems on cylinder boundaries, that may be your problem. Normally,
raidctl(8) takes care of the alignment for you, but perhaps because of a
geometry confusion, it didn't.
-Brian

On Feb 24, 1:44pm, =?UTF-8?Q?BERTRAND_Jo=C3=ABl?= wrote:
} Subject: Re: Booting on raid1 rootfs
} Le 23.02.2014 21:23, Martin Husemann a =C3=A9crit=C2=A0:
} > On Sun, Feb 23, 2014 at 05:24:30PM +0100, BERTRAND Jo=C3=ABl wrote:
} >> I have seen that sparc supports raid1 rootfs, but how can I install
} >> bootblock ? I have tried in /dev/rsd1a and in /dev/rsd1c without any
} >> success.
} >=20
} > Dim memory says I installed them to rsd0c and rsd1c (or whatever disks
} > make up your raid0). Maybe installboot should be smarter?
} >=20
} > Martin
}
} Original NetBSD installation was done on /dev/sd0a. I have created a=20
} raid1 array with /dev/sd1a and one absent disk.
}
} I have tried to install bootblock with :
} # installboot -v /dev/rsd1a /usr/mdec/bootxx /boot
} and
} # installboot -v /dev/rsd1c /usr/mdec/bootxx /boot
}
} I can send installblock output this evening.
}
} Installboot does not return any error. Some time ago, I have seen the=20
} same trouble on sparc64 and I have fixed it by installing bootblock on=20
} raid array instead of whole disk.
}
} OBP can find boot block with boot disk1 or boot disk1:a, but is unable=20
} to find kernel on raid array.
}
} Best regards,
}
} JB
-- End of excerpt from =?UTF-8?Q?BERTRAND_Jo=C3=ABl?=
Eduardo Horvath
2014-02-24 17:00:25 UTC
Permalink
Post by BERTRAND Joël
Hello,
I'm trying to install NetBSD on a SS20. I have built a raid1 system as
I have done on several sparc64 without any trouble. Now, system is on raid0a
NetBSD/sparc Secondary Boot, Revision 1.15
.....
Booting netbsd
: trying netbsd.gz
Booting netbsd.gz
: trying netbsd.old
....
I have seen that sparc supports raid1 rootfs, but how can I install
bootblock ? I have tried in /dev/rsd1a and in /dev/rsd1c without any success.
Any idea ? I have only found old articles that don't give any
solution.
Based on this output, the machine found the bootblock and second level
bootloader, but the second level bootloader wasn't able to find the
kernel.

On sparc64, the first level boot block is written in forth and walks the
filesystem structures to find the second level bootloader. The second
level bootloader then walks the filesystem structures to find the kernel.
(In theory we could load the kernel directly from the first level
bootblock, but we do some fancy stuff in the ELF loader to make sure text
and data pages are physically contiguous.)

On sparc32 (unless someone has changed things over the years) the first
level bootblock is a SPARC C+assembly language executable that has the
disk blocks containing the second level bootloader encoded in it. It just
reads those disk blocks and jumps to the program it loaded.

The second level boot loader then walks the filesystem structures to find
the kernel. It's this step that's failing. My guess is that the sparc
bootloader is missing some bits from libsa that jump over the 64KB empty
space that raidframe leaves when looking for the ufs superblock.

Eduardo
Julian Coleman
2014-02-24 19:30:09 UTC
Permalink
Hi,
Post by Eduardo Horvath
Based on this output, the machine found the bootblock and second level
bootloader, but the second level bootloader wasn't able to find the
kernel.
On sparc32 (unless someone has changed things over the years) the first
level bootblock is a SPARC C+assembly language executable that has the
disk blocks containing the second level bootloader encoded in it. It just
reads those disk blocks and jumps to the program it loaded.
The second level boot loader then walks the filesystem structures to find
the kernel. It's this step that's failing. My guess is that the sparc
bootloader is missing some bits from libsa that jump over the 64KB empty
space that raidframe leaves when looking for the ufs superblock.
This used to work OK on sun4, sun4c and sun4m [*]. As you point out, the
first level boot loader is working OK, and is loading the second level
boot loader. Questions that come to mind are:

how large is the RAID 1 boot partition and where does it start on the disk
(see man boot for some PROM size limitations)?

is the kernel at the start of this partition (if it's larger than 1, 2, or
4GB)?

did this disk previously contain a disklabel for a non-RAID installation
(the previous disklabel might be confusing things)?

Thanks,

J

[*] Originally committed in 2006:

http://mail-index.NetBSD.org/port-sparc/2006/06/20/0015.html
--
NetBSD: simple; works; documented / Sailing at Newbiggin
http://www.netbsd.org/ / http://www.newbigginsailingclub.org/
BERTRAND Joël
2014-03-04 20:34:06 UTC
Permalink
Post by Julian Coleman
Hi,
Hello,

Sorry for the delay, but I have had to fix some hardware issues before
retrying to build this raid1 volume. One of my dual HyperSPARC module
was defective.
Post by Julian Coleman
Post by Eduardo Horvath
Based on this output, the machine found the bootblock and second level
bootloader, but the second level bootloader wasn't able to find the
kernel.
On sparc32 (unless someone has changed things over the years) the first
level bootblock is a SPARC C+assembly language executable that has the
disk blocks containing the second level bootloader encoded in it. It just
reads those disk blocks and jumps to the program it loaded.
The second level boot loader then walks the filesystem structures to find
the kernel. It's this step that's failing. My guess is that the sparc
bootloader is missing some bits from libsa that jump over the 64KB empty
space that raidframe leaves when looking for the ufs superblock.
This used to work OK on sun4, sun4c and sun4m [*]. As you point out, the
first level boot loader is working OK, and is loading the second level
how large is the RAID 1 boot partition and where does it start on the disk
(see man boot for some PROM size limitations).
I know this kind of limitations.
Post by Julian Coleman
is the kernel at the start of this partition (if it's larger than 1, 2, or
4GB)?
Yes, of course.
Post by Julian Coleman
did this disk previously contain a disklabel for a non-RAID installation
(the previous disklabel might be confusing things)?
I have erased previous disklabel with dd.

I have recreated raid1 volume from scratch and reinstalled bootblock on
sd0c and sd1c. I don't understand where was my mistake, but now,
bootblock can find netbsd kernel on rootfs.

Best regards,

JKB

Loading...