LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   lilo root option (https://www.linuxquestions.org/questions/linux-software-2/lilo-root-option-568233/)

merchtemeagle 07-10-2007 05:46 PM

lilo root option
 
I'm experimenting a bit with Linux From Scratch and I want to try if it's bootable. Everything is installed in my home, and since /home is is on /dev/hda7, I want to add something to lilo.conf like:

image = /boot/vmlinuz-2.6.19.2
root = /dev/hda7/user/lfs
label = LFS
read-only

But this is impossible since the root option expects only the "/dev/hda7". Any ideas on how I could solve this?

MQMan 07-10-2007 07:39 PM

So, do I understand you have a complete linux filesystem, starting at /home/user/lf, which you want to boot.

You "might" be able to get it to boot with:

image=/user/lfs/boot/vmlinuz-2.6.19.2
root=/dev/hda7

But, my guess is, that it's going to treat /dev/hda7 as the / directory, and start looking there for /etc, which of course it isn't goint to find.

Cheers.

Hern_28 07-11-2007 09:32 AM

Had something similar.
 
Had to use something like this with lilo:

image = /boot/vmlinuz-2.6.19.2
append = "root=/dev/hda7/user/lfs"
root = /dev/hda7
label = LFS
read-only

append tells linux to set that as root and root= tells lilo to boot from that drive (basically).

merchtemeagle 07-11-2007 10:43 AM

Aah, yes, I see. And what would the /home/user/lfs/etc/fstab file look like?
Following will not work:

Code:

/dev/hda7    /    reiserfs  defaults      1    1
since the root is actually /dev/hda7/home/user/lfs .

Hern_28 07-11-2007 10:52 AM

Oops.. typo
 
image=/user/lfs/boot/vmlinuz-2.6.19.2(this should be the mounted path from the base system to /boot of the created system)
ex image =/mnt/hda1/lfs/boot/vmlinuz(ver).

append = "root=/dev/hda7/user/lfs"
root = /dev/hda7
label = LFS
read-only

Fstab i was able to leave the same base off the appended value. just have to be sure the path exists to /user/lfs/boot exists in the system you are building (and booting) from. Sorry for the typo :confused: .

EDIT: Its been a while since I used lilo, so I might be a bit rusty.

merchtemeagle 07-11-2007 11:05 AM

Sorry, I don't understand the ex image option. I can't seem to find anything about it in the man page. And could you post the fstab line, I'm afraid I don't understand that one either. :)

Hern_28 07-11-2007 11:33 AM

Hmm.
 
Trying to make it a little easier. Have a couple of options.

1) Could create a link too vmlinuz-2.6.19.2 in or copy it into the /boot directory on /dev/hda7.

Then lilo.conf will look something like:

image=/boot/vmlinuz-2.6.19.2 (the copy or like too the file)
append = "root=/dev/hda7/user/lfs" (system path for /)
root=/dev/hda7 (lilo's answer for which drive)
label=LFS
read-only

2) Try booting as currently setup.

image=/user/lfs/boot/vmlinuz-2.6.19.2 (LFS vmlinuz)
append = "root=/dev/hda7/user/lfs" (system path for /)
root=/dev/hda7 (lilo still booting to hda7)
label=LFS
read-only

The append will hopefully work like a chmod to /user/lfs to test you system and will be set as root for it. Sorry for being sketchy, like I said its been a while. I tried to use settings that would be closer to your setup. I know that I have gotten something line option #1 to work.

Hern_28 07-11-2007 11:47 AM

Also
 
Don't remember for sure, I do remember having to do a lot of tinkering to get it to work. But one of the things I can't remember for sure is if append="root=/dev/hda7/user/lfs" worked of I had to use append="root=/user/lfs". Only thing I remember is the next time I created a LFS system I used grub lol.

merchtemeagle 07-11-2007 11:49 AM

Ok, now I understand everything. But I still don't know how to edit the fstab file. If my system under /dev/hda7/user/lfs mounts /dev/hda7 as / , that should give problems, no?

Edit: Maybe I give grub a try, but than this question still holds I think.

Hern_28 07-11-2007 11:57 AM

Grub was easier (once figured out LOL)
 
The trick is with the append option. The append= sets root wherever you want it so if it works then fstab has no problem and requires no special modification. This keeps /dev/hda7 from being / and sets it somewhere else in this case /user/lfs. root= is just for lilo so it will boot to /dev/hda7 but the append= is where your system setups up / and it will override the root= once the system is booting.

EDIT: WOW... That looks like geek to me.

If nothing is appended then the system assumes that the root= location specified is to be set as root. If the append works correctly, you can cut and paste your current fstab into the LFS system and it should work which is what you want anyway :).


All times are GMT -5. The time now is 12:01 AM.