Running DietPi from ISCSI with SD card for initial boot

Hi Everyone,

Apologies if this doesn’t really work or make sense.

I’m looking to see if there is an easy way that I can achieve the following: run the main DietPi OS from a connected ISCSI device rather than from the SD card.

I’ve found quite a few articles on doing a completely diskless boot using tftp/PXE etc. and this is a bit beyond my comfort/effort levels right now.

Right now I have my DietPi installed on an SD card on a Pi4, I’ve connected to an ISCSI target using open-iscsi and everything is working fine, I can move certain files etc. there which is alright. But I am hoping that I can move the main operating system there as well.

From what I can tell the SD Card setup has two partitions, a boot partition and then the main partition. Since I am not looking to necessarily remove the SD card completely, I am find having one that does the bootloader side to hopefully simplify things, but I’m not really sure what this entails as I presume whatever is there today under /boot does not have the ability to natively connect to an iscsi target before the main OS has actually booted and started services like open-iscsi.

Is this possible in a relatively straightforward way? I’m wondering if I need a different, more specialized bootloader to pull this off that was designed for ISCSI booting, or perhaps the only real answer is to look into the full network booting options via DHCP/PXE/TFTP that are designed to solve this problem?

Thanks in advance.

It isn’t a real DietPi question. More if a RPI device can boot. Probably a question to be raised on RPI forum. I guess these guys are more expert’s on such things. Because at the end DietPi is nothing else than a very slim/diet version of Raspberry Pi OS. Booting from ISCSI might be a challenge if it requires additional driver that might need to be loaded first. As an alternative, you could using USB boot capabilities of RPi device to boot of a SSS/HDD/pen stick connected via USB.

Thanks for your reply, totally understand, I was a bit confused about how dietpi/linux/debian handled booting.

I was actually returning to say, I found the following tutorial by ejolson on the Raspberry Pi forum and it took me the last 6 or so hours but I was able to follow it and have it boot from ISCSI on the first attempt. I’m relatively new to Linux in general, so well done to the author for creating a very detailed explanation of what needed to be done.

The TL;DR; for the tutorial is - custom ramfs that we load from the boot partition initially that allows us to load open-iscsi so the Pi can connect to the ISCSI target before attempting to boot from the root FS.

good you found a solution. Your system is using bootFS on SD card still, but rootFS is provided by ISCSI now? Correct?

Yep precisely, which is just fine for me without having to delve into network booting.

I played around with PXE boot in the past. It was not that difficult but I was not satisfied with NFS speed. Most probably something on my Synology but I was not able to find out why NFS was so fu***** slow. :sunglasses: