Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I boot from a root filesystem (maybe squashfs or dd image)?
2017-10-01, 22:20
Post: #3
RE: How can I boot from a root filesystem (maybe squashfs or dd image)?
(2017-10-01 21:58)NiKiZe Wrote:  You could always dd your disk to an iSCSI device and boot from that with iPXEs sanboot command.

But my guess that you have something small-ish that you want to boot and if so I would recommend creating an initramfs with your whole disk.

Below is psuedo command to create such a file of your fs
find . | cpio -H newc -o | gzip > /ramfs.gz

The choices here depends on a few things
* Do you want it to work when network cable is disconnected for whatever reason
* Do you have the RAM to hold your entire system
* Do you want to be able to store data
* Do you want to have multiple machines running with the same image

Since you have already tried squashfs my guess is that you have the RAM and want it to work even if the machine goes "offline"

If so if you post what you have with your squashfs approach so far, as in what is the files you have, the iPXE script you are using, and what the actuall issue is (error message) when you use this I'm sure we can figure it out, but it's always hard to start helping from "nothing".

it might be as easy as adding your squashfs image with initrd, but first adding cpio headers to it, if your are booting in pcbios mode (not efi) than it is possible to have iPXE add those headers for you.

Hi NiKiZe,

To answer your questions:
- No, I don't need it to work when the network is unplugged - I only want my disk image stored on a server for the client to fetch
- Yes, I want the image mounted read-only and changes saved in RAM - AFAIK this is default behavior?
- No, I don't need to store any data on the client
- Yes, ideally I want it to work for multiple clients at once

I've tried a lot of things with squashfs. A lot of it was based around this tutorial:

And a lot of it I took from this guide:

However these were both for PXE. I tried to adapt them to iPXE by simply using the kernel and initrd from these guides in my config. I got examples from places like these:

Additionally, instead of attempting to make the installation with debootstrap or similar, I also tried installing Ubuntu Server 17.04 in a virtual machine, mounting it in another virtual machine, and creating the image with mksquashfs. So my config may have looked something like this:

imgargs vmlinuz boot=live config console=ttyS0 username=aj fetch=

This results in iPXE 'freezing':
The server is not transmitting anything either.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: How can I boot from a root filesystem (maybe squashfs or dd image)? - ajr - 2017-10-01 22:20

User(s) browsing this thread: 3 Guest(s)