Booting LFS on separate USB HDD + separate /boot parition
Hi,
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: Quote:
Below is output of some commands that you might ask for:
|
Looks like you've broken a one line command into two.
Code:
# Begin /boot/grub/grub.cfg Code:
linux /boot/vmlinuz-3.1-lfs-7.0 root=/dev/sdb1 ro |
Have you loaded grub on the usb drive hd2 or in the hd0,If it is all on the usb hd2 then you need to. Set root to hd0,1 and try adding root delay.
Code:
# Begin /boot/grub/grub.cfg Code:
# Begin /boot/grub/grub.cfg |
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: Quote:
|
Am i correct you have set grub on the usb when it boots it,s then hd0 as this is the drive loading.
|
To make it perfectly clear
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. Thanks |
Hi,
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. Hope this helps. |
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? |
@druuna: Thank you very much for your answer. Is it possible to use UUID's in grub and fstab. I was trying to google this kind of solution, because it seems much better, but I couldn't find anything.
@spiky: it is external harddrive. |
Hi,
Quote:
And although I never tried using UUID's and grub myself, have a look at this LQ thhread: [SOLVED] how to use UUID on fstab and grub Hope this helps. |
Just a note mine wont boot if there is a pendrive in a strange quirk
|
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
example HD0 ubuntu cd drive lan HD1 lfs7 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: Code:
(hd0) (hd0,msdos5) (hd0,msdos4) (hd0,msdos2) (hd0,msdos1) (hd1) (hd1,msdos7) (hd1,msdos6) (hd1,msdos4) (hd1,msdos2) (hd1,msdos1) (hd0,msdos1)! After a brief moment of excitement I got: Quote:
|
I didn,t have to do that this is my grub.cfg
Code:
# Begin /boot/grub/grub.cfg |
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!
|
All times are GMT -5. The time now is 07:17 PM. |