Live data from Hacker News

Diskless Linux boot using ZFS, iSCSI and PXE

aniket.foo

61–70 of 108 posts

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#61
post #28

Earlier quoted context omitted.

iSCSI seems intentionally obscure. One of the improvements I made to NBD was invent a simple, standardized URI format so that you can specify servers easily, eg: nbdinfo nbd://server nbdcopy nbd://server:2001/ nbd+unix:///?socket=/tmp/localsock https://github.com/NetworkBlockDevice/nbd/blob/master/doc/ur...

NBD looks pretty nice! I've been eyeing it from afar for a while. How well does it work in environments with noticeable network latency?

Requests and responses are pipelined so at least you're not serializing on round trips. However fundamentally if there is lots of latency, then you're going to be affected in some way. Usually we see problems where the OS accessing the remote drive times out which can sometimes be worked around by increasing timeouts, if you can work out how. (Latency is going to affect every block device protocol in about the same way)

You can actually see what happens quite easily if you've got an OS image handy. With a Fedora VM image:

  $ virt-builder fedora-42 --root-password=password:123456
  $ nbdkit file fedora-42.img --filter=delay rdelay=50ms \
           --run 'qemu-system-x86_64 -machine accel=kvm:tcg \
                     -cpu max -m 2048 \
                     -drive file="$uri",format=raw,if=virtio'
("$uri" expands to the NBD URI of the nbdkit server which qemu can parse natively)

Even that 1 second delay is painful since it turns out that booting is quite serialized. Edit: I turned down the latency to 50ms in the example which is a bit more realistic. Still painful.

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#62
post #44

Friends don't let friends use grub. rEFInd is _so_ much simpler: one efi entry, one text config file in the efi partition, nothing that needs to change when the kernel updates, and no massive pile of templating and moving parts to mysteriously break dumping you at an impenetrable grub “rescue” shell.

Or just use systemd-boot which uses BLS thus there are no config files.

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#63
post #44

Friends don't let friends use grub. rEFInd is _so_ much simpler: one efi entry, one text config file in the efi partition, nothing that needs to change when the kernel updates, and no massive pile of templating and moving parts to mysteriously break dumping you at an impenetrable grub “rescue” shell.

does refind support secure boot and measured boot? I loathe pretty much anything systemd but systemd-boot gives me this with zero effort, and it's legitimately useful

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#64
post #44

Friends don't let friends use grub. rEFInd is _so_ much simpler: one efi entry, one text config file in the efi partition, nothing that needs to change when the kernel updates, and no massive pile of templating and moving parts to mysteriously break dumping you at an impenetrable grub “rescue” shell.

> rEFInd is _so_ much simpler

TBH I've only used it for Hackintoshes and BSDs. I don't know why you'd want it.

But I am finding this hard to post on account of this big hairy grey thing with a long prehensile nose that's in the way...

They only work on UEFI. I don't like UEFI. I have kit in near-daily use that doesn't have UEFI at all.

GRUB works on BIOS, UEFI, x86, Arm, whatever. It boots Linux, all the BSDs, Haiku, whatever. So GRUB wins.

I hate GRUB for its hostility and unfriendliness and impenetrability... But it does the job on more kit than, well, any of the alternatives.

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#65
post #44

Friends don't let friends use grub. rEFInd is _so_ much simpler: one efi entry, one text config file in the efi partition, nothing that needs to change when the kernel updates, and no massive pile of templating and moving parts to mysteriously break dumping you at an impenetrable grub “rescue” shell.

does it support encrypted /boot though?

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#66
I like the concept, I don't like the presentation or the reasoning.

But this idea or ones much like it have been presented before...

"Hassle-free diskless Virtual Machines with Xen and Alpine Linux"

https://jonnytyers.wordpress.com/2016/08/16/hassle-free-disk...

"How to make a Diskless Virtual Machine (KVM)"

https://github.com/lispydev/diskless-kvm

And if you just want a dead easy PXE server for bare metal...

https://www.iventoy.com/en/index.html

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#68

"I didn’t want to get into the hassle of repartitioning everything that the boot loader works with both Linux & Windows." Hmmh? I haven't done so in years, but configuring multi-boot used to be considerably easier than disk-less operation.

It is relatively easy to configure. Just install Linux after windows, and Linux will generally automatically setup a boot-selection screen for you. The installer should detect windows and even shrink the partitions for you. You can install a prettier looking boot selection menu like rEFInd, but the default works just as well, and I think the mainstream distros all setup secure boot too. On my pc it was very easy, on…

I've never had this experience dual-booting, neither with UEFI nor Grub. I've been using Linux for nearly 15 years, 13 of those dual booting. Dozens of systems from laptops to desktops. Windows would always purge the boot entries. I'd have to manually fix booting, constantly. This happened with Ubuntu, Arch Linux and recently NixOS and through all the Windows editions till 11. I had to install Windows for a lan party recently and lo and behold on the second day NixOS is gone from the boot list and unbootable. Nothing of value is lost when it gets purged, but it's a damn annoying tax to pay just to be able to play video games.

Luckily gaming now works well enough that the only reason to use Windows was gone. Well, apart from some online games played during lan parties.

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#69
post #39

Earlier quoted context omitted.

The 'target' moves slow so once you learn it, it all stays relevant forever. ... And it's very, very fun.

Does it offer performance advantages over NFS root?

They operate at different layers.

iscsi is a block device: you gain a 'disk drive' sitting on your network. A dedicated network for disk traffic and use it to host on-prem virtualization. It's called a SAN array.

Re: Diskless Linux boot using ZFS, iSCSI and PXE

#70
post #45
post #36

Earlier quoted context omitted.

Or use UKI and throw the current kernel to /efi/boot/bootx64.efi; there's plenty of solutions to sane bootloader/kernel management if you're willing to invest 15 minutes into the topic and not act like it's scary and complicated (it really is the opposite).

Grub2 is scary and complicated. Remove grub from the equation, and all the scary goes away.

Grub is really impressive in how it consistently spent the last 30 years focused on improving everything except the UX of the one workflow 99.99% of its involuntary users need it for (boot linux as reliably as possible, and make it easy to debug when it does not).
Post reply on HN