ISO: Live mode boot slow, needs 4GB+ RAM
Currently we need at least 4 GB of RAM for the Live system when the booted sytem in theory only needs <1. This is because everything gets copied into RAM at boot time.
I would like to remove the need for so much RAM, e.g., by loop-mounting system.uzip, and merging it with a tmpfs using unionfs, and then chrooting into that.
FuryBSD had a unionfs setup but it was more involved: https://github.com/furybsd/furybsd-livecd/tree/union-tar-nochroot
I’d like the simple version (loop-mount read-only filesystem, overlay it with tmpfs usion unionfs, chroot into that). If it doesn’t work, then collaborate with unionfs kernel devs (who maintains unionfs? @mjguzik, @cemeyer?) to make it work.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 59 (53 by maintainers)
Commits related to this issue
- Workaround for #4 — committed to helloSystem/ISO by probonopd 4 years ago
- Try workaround for low-level tools trying to load things from /sysroot https://github.com/helloSystem/ISO/issues/4#issuecomment-787062758 — committed to helloSystem/ISO by probonopd 3 years ago
- initgfx_enable="NO" for deugging (temporary) — committed to helloSystem/ISO by probonopd 3 years ago
- Try workaround for low-level tools trying to load things from /sysroot https://github.com/helloSystem/ISO/issues/4#issuecomment-787062758 — committed to helloSystem/ISO by probonopd 3 years ago
- nullfs-mount /sysroot/sysroot/boot https://github.com/helloSystem/ISO/issues/4#issuecomment-800636914 — committed to helloSystem/ISO by probonopd 3 years ago
- sysctl kern.module_path=/sysroot/boot/kernel https://github.com/helloSystem/ISO/issues/4#issuecomment-800636914 — committed to helloSystem/ISO by probonopd 3 years ago
Screenshot with htop output on a 2GB VBox VM (which also shows a bug where the dock does not listen to resolution changes - has that been reported yet?):
I’d say it’s a resounding success.
Thanks to the help of @pkgdemon we have an experimental Live build that should address this issue:
https://github.com/helloSystem/ISO/releases/tag/continuous-12.2-unionfs
Note that this build contains fluxbox rather than helloSystem to make the ISO smaller (and because the 12.2-unionfs branch has diverged a lot from the current experimental branch of helloSystem), but it should be possible to port the changes over to the helloSystem builds in case everything turns out to work well.
So let’s test, especially
-m 512inqemu)Username: liveuser, no password
@pkgdemon noted on IRC:
Pinned the issue @Tunas1337
This seems like an issue that, if possible, really ought to be referenced in a little “echo” message in the bootloader, before the system attempts to load further. It’s a source of confusion for a lot of people, and I’m sure there are people who have tested helloSystem, seen this, thought it was fundamentally broken and given up on it (myself included, had I not checked the GitHub issues!) EDIT: alternatively, this issue could be pinned for easier discovery, as opposed to searching closed issues to find a reference to this. It’d also stop people from making issues related to it, thus saving time.
I’m aware; sadly I have no machines with <4GB RAM right now. PS: Somehow, in my previous comment I neglected to mention the most important thing, that the implementation of geom_rowr reduced boot times to 30-45 seconds from several minutes as seen before. That was the thing I wanted to report in the first place, and that was what I was testing with the VMs. D’oh!
I am excited to share the news that a new FreeBSD kernel module is in the works that will allow us to do what we need, combine a read-only with a read-write disk to get a read-write disk: geom_rowr by Jordan Gordeev. I am preparing an ISO for testing that will use it for booting in the geom_rowr branch.
Edit: We now have a working ISO for the geom_rowr tree. Known issue: Cannot be installed yet because the installer has not yet been reworked.
This is the diff: https://github.com/helloSystem/ISO/compare/helloSystem:6139ff2...3aa68d9?expand=1
@probonopd This is basically what ghostbsd did for years. Except that it would tar specific directories at boot like /etc that had to be writable, mount this as tmpfs, and untar the small archive over the top. The
rc.initdisklessscript if used will already make /var and /tmp writable. If you need additional directories tar is probably the way to go. I don’t know why you would wantrw_root_mount="NO"after install though? Yes the main issue with a read only system would be things likeinitgfxunless you can punch through whatever directories it needs. The next issue would be not allowing the user to instal packages or configure other parts of the system for example if you didn’t ship a driver they needed. Depending on your desired goals I think readonly sounds like a great solution for you.Just a thought, but we can probably get around the chroot/module issues by nullfs mounting /boot with all of the modules etc onto the chroot’s /sysroot/boot, or wherever necessary. Obviously this needs doing before the chroot call.
I was privately contacted by a helloSystem user who wishes to remain unnamed, and has summarized the issues as follows:
The user presented two solutions to problem 2 and noted that 3 and 4 need to be addessed separately and noted:
For problem 4 the use of swap space was suggested, which unfortunately does not work on truly read-only media such as DVD.
So the solutions suggested by the unnamed user appear to be (partial) alternatives to what @pkgdemon has implemented and what seems to address at least 3 and 4.
Probably all solutions come with specific pros and cons which I currently do not fully understand yet. So some experimentation will be needed to see what works best for helloSystem.
Thank you everyone sharing your ideas and code! 👍
Been experimenting in the
12.2-unionfsbranch but it is not working.https://github.com/helloSystem/ISO/blob/dea799d632438cf2d065f03a5a8b62ac595a1359/overlays/ramdisk/init.sh#L33
fails.
Any help appreciated.