search for magic partition excludes nvme drives

Issue #4 resolved
Brian Ketelsen created an issue

Tried this amazing linux distro in a VM and it worked great so I wanted to put it on a bare metal machine. Persistence failed to pick up the drive I tagged because the script is only looking for “hdX” or “sdX” drives. It’d be great to include nvme drives too!

Comments (11)

  1. Stephan Henningsen
    • changed status to open

    Oh no, that's not good! Thanks for the kind words, and for trying out Lightwhale, and also reporting this bug.

    I’ll look into this immediately.

  2. Brian Ketelsen reporter

    well it almost worked! The boot process found the device `/dev/nvme0n1’ with the magic key, but the partitioning naming logic doesn’t work for nvme drives. sdX drives add a number for each partition like /dev/sda1, but nvme drives add a p before the number, like /dev/nvme0n1p1

    I think the partition naming assumption is on line 179 of the setup-persistence script. If it’s an nvme device it should have a p before ${partnum}.

    Thanks for cutting a test release for this. I’m excited to try this out for my home lab.

  3. Brian Ketelsen reporter

    to be clear the failure during partitioning was the script looking to create a partition called /dev/nvme0n11 which should be /dev/nvme0n1p1

  4. Stephan Henningsen

    No worries, I get what you mean. I realize the fix was half-baked, sorry. The thing is, the only machine I have with nvme is my workstation. I’d rather not have Lightwhale to format that, so I was limited to test only device detection.

    However, I found a way to make QEMU emulate nvme, so this time I’ve tested it and nvme Works on My Machine Emulator ;)

    Btw, the same device naming scheme is used for eMMC devices, which I’ve also made QEMU emulate, so that has been fixed and tested too. I cannot make QEMU give me two eMMC devices, so I wasn’t able to test RAID for eMMC. But I’ll leave that bug for when it’s relevant to fix, if ever.

    Like I said, this was all tested in an emulator, though. So it would be of great help if you would test nvme again on real hardware. I’ve dropped a new dev3 image for you.

  5. Brian Ketelsen reporter

    wow, thanks for the fast fix! Happy to report that persistence is working beautifully on my nvme drive. This is really exciting. Let the home serving commence!

  6. Log in to comment