~alpine/users

3 2

SAN boot/aoe support for init script (initramfs)

Details
Message ID
<CAD4qdYBF8zg5y+tWdDWPpSyCAgDL75ywTMeCSmS14pndX+DufQ@mail.gmail.com>
DKIM signature
missing
Download raw message
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.
Details
Message ID
<8c8b1000-11f2-3f98-0037-6983f6d70b88@linux.ibm.com>
In-Reply-To
<CAD4qdYBF8zg5y+tWdDWPpSyCAgDL75ywTMeCSmS14pndX+DufQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
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.
> 
Details
Message ID
<CAD4qdYAbhk86in4dP_e4P41_y-PM=PLt3OFT5iJDqnhui9i-wQ@mail.gmail.com>
In-Reply-To
<8c8b1000-11f2-3f98-0037-6983f6d70b88@linux.ibm.com> (view parent)
DKIM signature
missing
Download raw message
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.
> >
>
Details
Message ID
<CAD4qdYC+ggBoL3f=_MP-GJGsA-R-dCzjArsQNXveMT5Jy8wBQQ@mail.gmail.com>
In-Reply-To
<CAD4qdYAbhk86in4dP_e4P41_y-PM=PLt3OFT5iJDqnhui9i-wQ@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
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.
>> >
>>
>
Reply to thread Export thread (mbox)