CentOS7 Raspberry Pi4 PXE-boot root on iscsi

Issues related to hardware problems
Post Reply
ftimmers
Posts: 8
Joined: 2019/09/07 21:14:12

CentOS7 Raspberry Pi4 PXE-boot root on iscsi

Post by ftimmers » 2021/01/25 10:23:52

Hi,
I'm trying to boot my Pi4 without SD-card nor SSD. When using NFS-mounts for /boot and root all is working fine, but I prefer to use iscsi as that is much more faster....
My boot partition is on a NFS mount, that is working fine. I created a initramfs and added that to /boot/config.txt and /boot/cmdline.txt, that's working fine too. My root partition is on a iscsi-disk, that I cannot get working: at boot is says: Waiting for root device iscsi:........... And it hangs.

What I did so far:
On my nas I created a NFS-mount and a iscsi-disk. With Ubuntu 20.04 on the Pi4 I can boot with this NFS-mount with a initramfs on it and root on the iscsi-disk, so my nas is configured well. But with CentOS7 the Pi4 it will not boot.
My steps:
1) installed CentOS7 via a SD-card on the Pi4; booted well
2) installed iscsi-initiator-utils, connected iscsi-disk, created ext4 filesystem and mounted this on /mnt
3) rsync -avx / /mnt/
4) touch /mnt/.autorelabel
5) chroot to /mnt:
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /run /mnt/run
systemctl start multipathd.service
chroot /mnt
=> running lsblk says now that / is mounted to /dev/sda1 (the iscsi-disk)
6) added this /dev/sda1 as / to /etc/fstab
7) mount nfs to /boot and rsync all files/dirs from mmcblk0p1 to this new /boot
8) added this nfs /boot to /etc/fstab
9) added iscsi to dracut: /etc/dracut.conf.d/iscsi.conf: add_dracutmodules+="iscsi"
10) dracut -f -v /boot/initrd $(uname -r)
11) added to /boot/config.txt:
initramfs initrd 0x01f00000
12) changed in /boot/cmdline.txt:
root=/dev/mmcblk0p2 to root=iscsi:192.168.100.1::::iqn.2021-01.nl.domain.nas:lun1 initrd=0x01f00000
13) shutdown, remove SD-card and startup again.

Does anyone know what I am doing wrong or what steps are missing?

Many thanks in advance for input.

pgreco
Posts: 31
Joined: 2018/04/14 17:23:02

Re: CentOS7 Raspberry Pi4 PXE-boot root on iscsi

Post by pgreco » 2021/01/26 09:59:56

Well, I've never done anything like that, but I have a couple of suspicions/questions,
1) initramfs/dracut are not used to boot the rpi from the sd card or from ssd, so I'd start by testing that while still using the sd card.
2) Where is the rpi actually booting from? using what method?

Pablo

ftimmers
Posts: 8
Joined: 2019/09/07 21:14:12

Re: CentOS7 Raspberry Pi4 PXE-boot root on iscsi

Post by ftimmers » 2021/01/26 11:31:52

Hello Pablo,
Thank you for looking after this problem.
The rpi is booting from a nfs-mount on another rpi. I copied the complete mmcblk0p1 (including initrd) partition to this nfs-mount. This nfs-mount is served to the rpi via PXE tftpboot (dnsmasq).
I hope you can point me to a solution.

ftimmers
Posts: 8
Joined: 2019/09/07 21:14:12

Re: CentOS7 Raspberry Pi4 PXE-boot root on iscsi

Post by ftimmers » 2021/02/01 19:11:16

@pgreco

Hello Pablo,

Maybe related:
When the Pi4 boot's from SD-card or via PXE-boot it is not possible to mount the iscsi-disk in /etc/fstab.
At boot everything goes OK till: Reached target Local File Systems (Pre)
After that: A start job is running for dev-sda1.device (0s / 1min 30s) => ending in a timed out and system in maintenance mode.
(sda1 is the 1st partition on the iscsi-disk formatted with an ext4 filesystem)

When I deactivate (put a # in front of the row) the mount of the iscsi-disk in /etc/fstab, the Pi4 will boot fine.
After login I can activate (remove the # in front of the row) the mount of the iscsi-disk in /etc/fstab and when I use 'mount -a' it is mounted.

Hope to hear some suggestions from you. Thanks in advance.

ftimmers
Posts: 8
Joined: 2019/09/07 21:14:12

Re: CentOS7 Raspberry Pi4 PXE-boot root on iscsi

Post by ftimmers » 2021/02/02 13:24:45

It seems a missed some parameters in fstab:
/dev/sda1 /mnt ext4 _netdev,x-systemd.requires=iscsi.service 0 0
With the above parameters the Pi4 boots fine, and the scsi-disk is mounted at boot. Still I'm not able to boot from iscsi...

Post Reply