LFS 7.8 Setting up grub to boot from flash drive
Hallo guys,
I built LFS 7.8 completely on a flash drive without any problems. Those only occur as I get to the booting part. I'm not quite sure what to write to the grub.cfg as my drive (sda, sdb...) changes whenever I plug the flash drive into another hardware configuration. Code:
set root=(hd0,2) // what should I set here? Code:
set root=(hd0,1) I would be very grateful if someone could help me here. Even telling where to find the boot log would be very helpful. I looked in /var/log but all the files are empty :/ Thanks in advance. |
Here are the things that I do in order to boot my BLFS system from an external USB drive...
1. Compile a kernel to build in USB support (for core, port, and storage drivers) and initial RAM filesystem support (for booting with UUID or LABEL). a. USB support... Code:
...[*] USB support ---> (CONFIG_USB_SUPPORT=y) NOTE: The HCD port drivers usually are EHCI for high-speed USB plus either OHCI or UHCI for a fallback to legacy USB. b. SCSI device support (CONFIG_SCSI) also should be built in (required by USB support)... Code:
... SCSI device support ---> c. Initial RAM filesystem and RAM disk support... Code:
....General setup ---> NOTE: See the swaplabel command for finding or changing a swap partition’s UUID. If swaplabel or Gparted fail work for setting a label or UUID for the swap partition, then use mkswap to recreate the swap area with the -L option to set a label which also will assign a UUID to the new swap partition.3. Boot the system in the usual way with GRUB 2 but add the kernel parameter rootdelay=5 to avoid a kernel panic caused by the slower response of the USB drive. 4. To boot the USB system directly from the BIOS splashscreen menu (instead of from another system's GRUB), install GRUB in the master boot record of the USB drive in the usual way with grub-install. Edit the USB system’s grub.cfg file for the root filesystem and to add the rootdelay kernel parameter. To boot with UUID or LABEL (a good idea with a hot-plugable USB drive), see the BLFS book chapter on initial RAM filesystems, creating the initrd image file, and editing grub.cfg for the initrd command line. Also replace the typical set root command line with a search command line that uses UUID. My current example... Code:
# Begin /boot/grub/grub.cfg |
Thanks for the fast reply, I will try that.
|
Quote:
Quote:
(edit for the correct UUID number.) |
I have not looked into BLFS so far but the "rootfstype=ext4 rootdelay=5" seems to resolve my issue right now. I am still stuck with /dev paths at the moment but it is finally booting. Thanks all. This can be closed/marked solved.
|
Quote:
Anyway, if you ever want to boot the USB system with UUIDs or LABELs to avoid the drive enumeration issue, just read the BLFS section "About initramfs". It's easy to create an initial ram filesystem following those instructions. You have to install cpio (easy, no dependencies). Then install the two scripts found there and run the mkinitramfs command as described. I have a BLFS system on a USB drive that boots directly from BIOS, often with other USB drives also running. So I need this UUID business to boot it. |
All times are GMT -5. The time now is 06:01 AM. |