[SOLVED] Booting LFS on separate USB HDD + separate /boot parition
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Booting LFS on separate USB HDD + separate /boot parition
I have just finished my first LFS. I keep all the files on separate usb hdd (I only have one internal and one external hdd, listed as sda and sdb respectively in my host system).
I have separate swap, boot and home partitions. I gave priority to external hdd's in bios. When I try to boot my system, grub loads fine, but when I select lfs entry I get:
error: no kernel specified
error: unknown command '/boot/vmlinux-3.1-lf
Anybody have some ideas how to fix this? I already tried changing root= in grub.cfg to different letter, but it does not work. Thanks very much for any help!!
Below is output of some commands that you might ask for:
Thanks for both answers. Both of this things were an issue and I fixed them now.
@spiky0011 Why is it the case that I have to change hd2 to hd0? Device map outputs hd2 fo my usb hdd on which I have both grub and the system. Besides following that reasoning shouldn't I change /dev/sdb to /dev/sdX for some other X? If yes how determine which one? Is my thinking correct that the order can be random, so I should add some udev rules?
Second issue is that unfortunately this still doesn't work grub say's it's booting, but then it outputs, really helpful error:
I have (naming from my host system):
/dev/sdb4 which corresponds to /
/dev/sdb1 which corresponds /boot
I made /dev/sdb1 bootable and installed grub on it. I also have another grub on my main harddrive, but it does not matter LFS is completely separate from that and my main hard drive is not used. I posted output of cat device.map generated by grub while chrooted into LFS on my host system in my first post.
If the hd that holds a complete independent LFS installation, including grub and this hd is seen during start as your primary boot device it will be seen as sda, not sdb.
As pointed out by spiky, you should adjust you grub.cfg and fstab file accordingly. It might be wise to looking into using UUID's instead of device names (UUID's are unique, devices name are not) wherever possible.
That is how mine is setup I boot lfs from sdb1 grub installed in sdb1 /boot.
As you mentioned it dose matter where the usb gets loaded if it switches to hd1 then it wont boot,
The usb is it an external harddrive or a pendrive/memory stick?
Just another thing when I boot fromm 2nd drive I use F12 which which shows all harddrives to boot they must be in the correct order I,E sdb must be 2nd harddrive inlist, if it,s the 3rd position it wont boot
HD2 lfs 6.7
if lfs7 and lfs 6.7 swap places they wont boot
I did some experiments and reached some conclusions:
1. I removed all /dev/sdX rubbish from fstab and grub.cfg to do this we replace /dev/sdX with UUID=<DEVICE_UUID> in fstab and by /dev/disk/by-uuid/<DEVICE_UUID> in grub.cfg.
2. (hdX,Y) is also dependant on hardware you have plugged in. For example in my case if I have memory card inserted i get different number for harddrives that if I didn't have it.
As now I am using UUIDs everywhere, the thing the might be wrong is (hdX,Y). Launched grub and typed ls in grub console. The output I got is:
As my external usb hdd (the one with LFS) has exactly 5 partitions and internal excactly 7 I deduced that hd0 is the disk I am looking for. Also I noticed grub is adding this weird msdos prefixes, so finally I deduced that correct value must be:
After a brief moment of excitement I got:
error: file not found
I am gradually starting to think that us government is involved.
Well it does not work for me. Small question - do I have to reexectute any grub related commands when updating grub.cfg and fstab? And are my /boot directory contents ok (in the first post)? Thanks very much for all answers!