I am building a boot server with Alpine for my homeserver.
I'd like to use aoe (ATA over ethernet) for my SAN, to boot the distro from
the SAN directly, with iPXE.
I managed to make it work by adding the necessary files into the initram
(network modules, aoe modules, aoe utils), but the initramfs init script
always ends up to the emergency shell (, and I have to mount sysroot by
hand with three commands:
ifconfig eth0 up
/usr/sbin/aoe-discover
mount /dev/ethernet/e0.0p3 /sysroot
when I exit the emergency shell, the system boots regularly and everything
is fine.
I tried to modify the init script, but it looks fairly complex and hard to
understand in some parts, and I can't make it work as expected.
Can I get some hints on how to put those three commands into init ?
Thanks.
This sounds interesting. Guess I'd setup a VM acting as SAN and PXE
server to feed storage disks to other VM booting with AOE.
Then I could have a look into patching initramfs. Sounds like a plan.
On 7/23/20 8:51 AM, Vittorio Mori wrote:
> I am building a boot server with Alpine for my homeserver.> > I'd like to use aoe (ATA over ethernet) for my SAN, to boot the distro> from the SAN directly, with iPXE.> > I managed to make it work by adding the necessary files into the initram> (network modules, aoe modules, aoe utils), but the initramfs init script> always ends up to the emergency shell (, and I have to mount sysroot by> hand with three commands:> > ifconfig eth0 up> /usr/sbin/aoe-discover> mount /dev/ethernet/e0.0p3 /sysroot> > when I exit the emergency shell, the system boots regularly and> everything is fine.> > I tried to modify the init script, but it looks fairly complex and hard> to understand in some parts, and I can't make it work as expected.> > Can I get some hints on how to put those three commands into init ?> > Thanks.>
I actually hacked the init script by adding the following lines:
echo "AOE root mount"
ifconfig eth0 up
sleep 5
modprobe aoe
echo "AOE modprobed"
sleep 2
/usr/sbin/aoe-discover
echo "AOE discover"
sleep 2
/usr/sbin/aoe-discover
echo "AOE discover"
sleep 1
Just before the
mount ${rootfstype:+-t} ${rootfstype} \
-o ${KOPT_rootflags:-ro} \
${KOPT_root#ZFS=} $sysroot
stanza, leaving the init script basically untouched.
I also added the aoe.ko modules, and the ethernet card modules in the
initramfs-lts file.
I tried it with two physical machines (an old Fujitsu Celsius W380, and a
T1700 Dell Precision), and they boot flawlessly.
All it's rather fast for being just an ancient gigabit ethernet card.
It's a very very ugly hack: I need to rewrite it properly : i.e.: loop
until the /dev/etherd devices are created, then boot - and some error
checks of course.
Will do it today, maybe.
Il giorno ven 24 lug 2020 alle ore 12:46 Tuan Hoang <tmhoang@linux.ibm.com>
ha scritto:
> This sounds interesting. Guess I'd setup a VM acting as SAN and PXE> server to feed storage disks to other VM booting with AOE.>> Then I could have a look into patching initramfs. Sounds like a plan.>> On 7/23/20 8:51 AM, Vittorio Mori wrote:> > I am building a boot server with Alpine for my homeserver.> >> > I'd like to use aoe (ATA over ethernet) for my SAN, to boot the distro> > from the SAN directly, with iPXE.> >> > I managed to make it work by adding the necessary files into the initram> > (network modules, aoe modules, aoe utils), but the initramfs init script> > always ends up to the emergency shell (, and I have to mount sysroot by> > hand with three commands:> >> > ifconfig eth0 up> > /usr/sbin/aoe-discover> > mount /dev/ethernet/e0.0p3 /sysroot> >> > when I exit the emergency shell, the system boots regularly and> > everything is fine.> >> > I tried to modify the init script, but it looks fairly complex and hard> > to understand in some parts, and I can't make it work as expected.> >> > Can I get some hints on how to put those three commands into init ?> >> > Thanks.> >>
Here's a less hacky version for AoE mount into the init script into
initramfs:
echo "AoE root mount"
modprobe aoe
echo "AoE modprobed"
while [ ! -e "/dev/etherd/e0.0p3" ]
do
echo "eth0 up..."
ifconfig eth0 up
sleep 1
echo "AoE discover..."
/usr/sbin/aoe-discover
sleep 1
done
It gets the AoE block devices ready after 2/3 tries.
(put this before the
mount ${rootfstype:+-t} ${rootfstype} \
-o ${KOPT_rootflags:-ro} \
${KOPT_root#ZFS=} $sysroot
stanza)
Il giorno ven 24 lug 2020 alle ore 13:07 Vittorio Mori <
vittorio.mori@gmail.com> ha scritto:
> I actually hacked the init script by adding the following lines:>> echo "AOE root mount"> ifconfig eth0 up> sleep 5> modprobe aoe> echo "AOE modprobed"> sleep 2> /usr/sbin/aoe-discover> echo "AOE discover"> sleep 2> /usr/sbin/aoe-discover> echo "AOE discover"> sleep 1>> Just before the>> mount ${rootfstype:+-t} ${rootfstype} \> -o ${KOPT_rootflags:-ro} \> ${KOPT_root#ZFS=} $sysroot>> stanza, leaving the init script basically untouched.>> I also added the aoe.ko modules, and the ethernet card modules in the> initramfs-lts file.>> I tried it with two physical machines (an old Fujitsu Celsius W380, and a> T1700 Dell Precision), and they boot flawlessly.> All it's rather fast for being just an ancient gigabit ethernet card.>> It's a very very ugly hack: I need to rewrite it properly : i.e.: loop> until the /dev/etherd devices are created, then boot - and some error> checks of course.> Will do it today, maybe.>>>>>> Il giorno ven 24 lug 2020 alle ore 12:46 Tuan Hoang <tmhoang@linux.ibm.com>> ha scritto:>>> This sounds interesting. Guess I'd setup a VM acting as SAN and PXE>> server to feed storage disks to other VM booting with AOE.>>>> Then I could have a look into patching initramfs. Sounds like a plan.>>>> On 7/23/20 8:51 AM, Vittorio Mori wrote:>> > I am building a boot server with Alpine for my homeserver.>> >>> > I'd like to use aoe (ATA over ethernet) for my SAN, to boot the distro>> > from the SAN directly, with iPXE.>> >>> > I managed to make it work by adding the necessary files into the initram>> > (network modules, aoe modules, aoe utils), but the initramfs init script>> > always ends up to the emergency shell (, and I have to mount sysroot by>> > hand with three commands:>> >>> > ifconfig eth0 up>> > /usr/sbin/aoe-discover>> > mount /dev/ethernet/e0.0p3 /sysroot>> >>> > when I exit the emergency shell, the system boots regularly and>> > everything is fine.>> >>> > I tried to modify the init script, but it looks fairly complex and hard>> > to understand in some parts, and I can't make it work as expected.>> >>> > Can I get some hints on how to put those three commands into init ?>> >>> > Thanks.>> >>>>