On 12/31/20 7:53 PM, Ken Moffat wrote:
On Thu, Dec 31, 2020 at 05:55:57PM -0600, Brian Hagen wrote:
Hello,
Re the comments from Ken and Bruce, first, thank you for them. I
will quote here from LFS 9.1, section 2.4.1.4 comments on partitioning:
=======================
/boot – Highly recommended. Use this partition to store kernels and
other booting information. To minimize potential boot problems with
larger disks, make this the first physical partition on your first disk
drive. A partition size of 100 megabytes is quite adequate.
=======================
So, although I read this during the previous LFS 9.1 processes,
since it states "highly recommended", not mandatory, I did not use it.
If something can be avoided, it is not manadatory - no matter what
pain avoiding it may cause (for me, see my aversion to gtk-doc).
The difference with LFS is that we do not support upgrading an
existing LFS system (although people have done that) - every binary
distro I am aware of will upgrade in-place, similarly in gentoo and
its derivatives you can 'make world'.
I've been here a long time, and on occasion I've had a machine
without a separate /boot partition - but I think the last one was a
mac powerpc64 (not officially supported) with 64-bit kernel and
32-bit userspace (unlike cross-lfs, which supported that
architecture but wanted to use either pure64 (i.e. all 64-bit) or
multilib. The last time I tried to boot that machine, the 3.10
kernel was still in Long Term Support (but was poor for a
single-core ppc64), so my experience is by no means current, but it
could be made to work and I've seen nothing since then which forces
builders to separate /boot.
After all, I have never seen a Linux distro install that requires that
type of setup. I have installed numerous ones from CD/DVD, and having
/dev/sda1 or /dev/hda1 (as the case may be) designated as "/" was always
adequate.
We think that for LFS it still is, but you need to adapt
instructions where appropriate - like Bruce said in relation to
grub.cfg.
So, does this mean that going through LFS without having /boot as
the first partition on the first drive basically dooms the grub-install
sequences to a useless result? I would really like to know.
Brian
I think that one one of my machines I've had separate /boot without
it being the first partition (ISTR that machine had been used for
some version of windows, and then that objected when I upgraded the
hardware - so sda1 on a DOS-style disk, and probably sda2, were for
windows and sda5 or later was used for /boot. On gpt disks, the
partiitoning is of course different (a 'spacer' partition at the
start marked as 'bios boot' or something like that).
If your whole system is on sda1 on a DOS disk, I think you have to
point grub to /boot/vmlinuz-something whereas on a separate /boot
partition the location is just vmlinuz-something. But also,
specifying the root affects where grub is looking. So, in the
LFS-9.1 section 8.4.4 there are settings for LFS on sda2 without a
separate /boot partiiton -
insmod ext2 (so that grub can read ext2|3|4 partitions)
set root=(hd0,2) (partition 2, counting from 1, of first disk
(counting from 0)
root=/dev/sda2 - passed to the kernel after grub loads it, telling
it where to look for /sbin/init.
In your case with LFS on sda1, I think you need
set root=(hd0,1)
root=/dev/sda1
I agree with you Ken, but there is one caveat. If there is more than
one drive, sometimes the kernel and grub do not agree that hd0 is sda.
It's not frequent, but I have seen that, especially if the drives are
different interface types e.g. sata, usb, or the newer nvm devices for
some ssd drives.
The best way to figure that out is to start the grub command line and
run ls.
Personally, I think the best approach is to not use a MSDOS partition
table and use GPT instead. When using GPT, grub needs a special
grub-bios partition that is not formatted.
For instance I have:
Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02 grub
2 4096 1052671 512.0 MiB 8300 boot
3 1052672 39456767 18.3 GiB 8300 lfs-7.9
4 39456768 60428287 10.0 GiB 8300 lfs-20180801
... etc
Note that the Name field is for humans. grub doesn't care. It only
knows (hd0,1), (hd0,2), (hd1,12) etc.
When using this type of setup the kernel recognizes the PARTUUID
parameter. No initrd is needed. Therefor the linux line in grub can be
something like:
linux /vmlinuz-5.6.14 root=PARTUUID=AA22639D-4BE3-4E99-9FF5-2AA2A8F76BFC
ro
You can get the uuid from fdisk using the 'i' (info) command for a
partition. Also note that this is NOT the filesystem UUID, but the
partition UUID.
Overall, the boot process is pretty complex. It depends on the hw of
the drives (and can use a network connection in a diskless environment),
the disk layout, and can be tricky in a VM environment. What we have in
the book really only covers the situation where there is a simple disk
layout with ext partitions. Different partition types or LVM types of
setup is another can of worms.
-- Bruce
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page
Do not top post on this list.
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
http://en.wikipedia.org/wiki/Posting_style