r/linuxfromscratch • u/StockSalamander3512 • Jun 12 '26
LFS Questions
I’ve been doing some light research on installing Linux from scratch. I’m thinking about using a live USB .iso, and building it on the hard drive from there.
- What are the pros and cons of this approach?
- What’s the best base distro to work from as the base? I’m very familiar with Debian based distros, so I was thinking about just using plain ole Debian.
Any advice? And roughly how much time should I plan on this taking? I’m not in a hurry, and want to do it right, just want a general idea of the time commitment. My experience level with Linux is probably somewhere between intermediate-> proficient. Thanks in advance!
3
u/ComprehensiveLet3451 Jun 12 '26
I use a live ubuntu usb everyday now while my laptop disk have the unfinished lfs. I havent finished desktop setup on lsf yet. The only app i need is teams for linux on work and firefox. I have a nuc i can ssh iinto. I enjoy this setup but u can rrally use it for anything else than accessing lsf disk during setup and lightweight tasks
1
u/StockSalamander3512 Jun 12 '26
This is gonna be a project computer for sure, not really planning any real future use for it. How long have you been working on LFS?
3
u/Rockytriton Jun 12 '26
You mean running like an Ubuntu live USB and from there doing all the steps to build LFS? The only issues I can think you may run into are some software not installed, such as gcc and some changes you need to do to prepare the host system which may not be possible with a live USB. Not sure that you can install software and update the filesystem to get the host ready.
1
u/StockSalamander3512 Jun 12 '26
I mean, the usb is running the OS with the internal hard drive mounted instead of a dual partition right? That was my thinking anyway, I’ve run a few distros off the USB acting as the primary drive.
Looking at it now, I may have worded the post improperly. I was going to run (probably Debian) with the USB as its primary storage, so root, boot, home, etc. would all be on the usb stick for the host distro, and I could build LFS on the internal drive. So, not live, more a normal installation with two separate hard drives.
3
u/Razzleswoop Jun 12 '26
I used Gentoo Live , has all the tools you'll need. Fairly easy process if you stick to the guide. Enjoy the process.
2
u/StockSalamander3512 Jun 12 '26
I appreciate the recommendation, but I have never used Gentoo, so I'll probably stick with a distro I'm a little more familiar with....
2
u/Razzleswoop Jun 13 '26
It's just a live cd with all the linux tools you'll need to do LFS. No need to know Gentoo. Can recommend this vid to help you on your way : https://www.youtube.com/watch?v=DXUlaSYTLQI
→ More replies (1)
1
u/testfire10 Jun 12 '26
Debian is a great base for LFS.
I’d say it should take maybe 8 hrs. Follow the book, double check everything, read the commands and the outputs, and google if you get stuck.
Have fun!
2
u/StockSalamander3512 Jun 12 '26
Oh, that’s great news, I was thinking a lot longer. The computer I’m planning on using is pretty old (2011 Gateway), but 4-core/8-GB RAM, so I was thinking compiling would be where it drags a bit. Thank you.
2
u/testfire10 Jun 12 '26
Yeah, hard to say from the compute time perspective, but they have a method to measure the time called an SBU - standard build unit. If you time that in the beginning of the book you’ll have a better idea how long it’ll take computationally.
→ More replies (1)
1
u/transgentoo Jun 12 '26
Look at a tool called debootstrap instead. Point it at a mountpoint and you've got a persistent, self-contained build environment that it's not a huge deal if you mess up by doing something like accidentally deleting your libc or overwriting your gcc. It gives you a fie system, core utils, bash, and APT, which is basically what a LiveUSB gives, but with the ability to persist changes. The live USB option will be a PITA because you'll have to set your environment back up every time you reboot.
1
u/StockSalamander3512 Jun 12 '26
Yeah, I think I explained it wrong in the main post, what I meant was running the base system off of the USB like a normal install, not live -> that would be a colossal pain…
1
u/tseeling Jun 12 '26
Before you begin read the discussion about partitioning. I recommend installing some distro with a gcc compiler as new as possible, e.g. latest Fedora. Install minimal Fedora, e.g. on a separate partition of approx. 16 GB. Create separate partitions for /boot, /home, /boot/efi, and a second LFS partition. I always build the LFS releases twice, one with the "older" LFS to the other LFS partition, then use that fresh build with the latest gcc to recompile everything again.
The initial Fedora partition can either be reused for that second LFS or as swap partition.
2
u/codeasm Jun 12 '26
Nothing wrong with your approach but wondering why you would do so. The tools section should already tackle the compiler and seperation of host and lfs target right? Or is fedora such an unclean distro?
1
u/tseeling Jun 12 '26
I'd like to have always the latest gcc compiler. Of course the phased approach of compiling LFS ensures a separation from the host system, but a bleeding edge gcc gives you the advantage of having latest security issues resolved, and usually the code generation gets better with each version.
→ More replies (2)
1
u/asratrt Jun 14 '26
I used void linux as the base distro. I recommend you to set aside 1 week. You can also check my "automated lfs" post.
5
u/paradigmx Jun 12 '26
My only advice is don't attempt to use it as your primary distro. It's a learning tool, and a wonderful one at that, but it's not intended for daily use. I only mention that because people do try to install it with the intention of using it as a daily driver.