Linux From Scratch This 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. |
Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-11-2006, 01:47 AM
|
#1
|
Member
Registered: Mar 2006
Posts: 64
Rep:
|
cant boot into my target file system
wht I have got here is my newly compiled kernel I created my root file system did make dev did sysvinit, copyied over the boot files vmlinuz bzimage boot.b map.system configured lilo to boot /dev/hda6
what Iam thinking the problem is when I boot it gets to the partition and cant find a boot record it just hangs with nothing but a blinking dash. I tried
dd if =/dev/zero of=boot.raw bs=1k count ROOT_OFFSET AND IT SMASHED BY MASTER BOOT RECORD AND CORUPTED THE FIRST PARTITION ON MY HARD DISK.
is there a dd command that will place the boot code on the particular partition that i want to boot so that lilo will find it and boot into the file system
I know therre must be a way becouse I am able to dd to a floppy and boot with it
|
|
|
04-11-2006, 03:20 AM
|
#2
|
Member
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353
Rep:
|
If you compiled a new kernel, did you run lilo after that ? Or if you're using grub, did you check the contents of menu.lst ?
BTW, what distro do you use ? You can't just copy bootcode to any partition you like. Bootcode is device specific i.e. it stores BPB which, contains information about the partition. Thus you simply cannot copy thr bootcode and expect it to work. Same goes for MBR although, the contents and references are different than the boot sector code.
Try booting off installation CD and choose the rescue option. See, if you can mount you linux system and chroot to it and the go about fixing it.
With the little or no information you have provided it is very hard to understand as to what is going on and what you are trying to ask !
|
|
|
04-11-2006, 01:18 PM
|
#3
|
Member
Registered: Mar 2006
Posts: 64
Original Poster
Rep:
|
Basicly I guess I cant understand why that if I can dd the boot code from my current partition to a floppy why can it not be dd to another target partition provideing that the target partition has the same charecteristics as the the current root file system.
what I am trying to get away from is the rediculouse installation rescue scripts that take a very long time to install and ask some stupid questions that I need not to have to answer to get a minimal commandline system up and running
btw if the rescue system can fix the problem what is in the rescue script that transfers the boot code to the partition and why cant it be done manually with the dd if= of= thing or some other way
btw I am useing a debian system 2.1 slink the rescue script that I have is resc1440.bin if I rawrite it to a floppy I can do a rescue but not very well becouse the script was done pritty lousey as far as I am concerned
I wish they had given me the source to the .bin so that I could have changed things rather than going through all this frustration..
sentially it seems to be a compiled bash script but seeing as i have not found the bash howto very informative I still am not fluent in bash script language not very good a decompileing .bin files either sothat has brought me here
|
|
|
04-15-2006, 07:36 AM
|
#4
|
Member
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353
Rep:
|
I've never heard of "compiled bash script" ! .bin is a binary file. It could be in the object code form or executable code. resc1440.bin as the name implies is meant for a 1.44MB floppy disk and not meant to be installed to HD partition. I still can't get it clear as to what exactly you are tryin' to do ! :^)
I guess, you are tring to install linux-from-scratch. If this is the case and if you've copied the linux kernel along with the modules, all that you need to do is install lilo or GRUB to the boot or root partition or to MBR if you like. Edit /etc/lilo.conf or /boot/grub/menu.lst to point at the boot partition so it can load the new kernel and the initrd image if the need be and set the necessary kernel parameters. Now if you boot, lilo or GRUB should load and display the boot menu from where you can select the kernel to boot.
I'll go on assuming you want to install linux-from-scratch. If all that you've got is linux kernel and lilo or GRUB and nothing else, you will end up with a "kernel panic - Unable to mount device...." error. To circumvent this, you can pass init=/bin/sh option provided you are loading an initrd image with "sh" binary present in the /bin directory of initrd image.
If you wanna repeat your question as to why you simply can't dd the boot code, refer my previous posting for the answer.
|
|
|
04-16-2006, 04:09 PM
|
#5
|
Member
Registered: Mar 2006
Posts: 64
Original Poster
Rep:
|
Sorry about the bash script misunderstanding, Its probably a C program that uses ncurses or somthing anyway my mistake
About the rescue thing in my distro it is burned onto the cd, when I boot with the cd i get the standerd install thing when I write resc1440.bin to a floppy it is the same installation thing so I kinda made the deduction that they must be the same script sort of thing maybe not. But what it does is ask the standered questions about makeing boot foppy or booting to the hard drive. So at that particular point in the instalation script it transfers the boot sector to the hard disk allowing the system to be boot and run from the hard drive. At least that is my understanding of it.
so that brings me to doing a linux from scratch which is esentially doing away with the instalation script and transferring the boot sector so that the system can boot from the hard drive
basicly what I have been able to figure out is that lilo's -r switch does exactly that. It is very unclear in the howtos. its in the lilo howto and then the rest is in the bootdisk howto I believe or maybe the bootpromt howto, where there is one miniscual line with the -r to do it. I believe the info should be repeated in both howtos for clearity thats just my opinion.......Anyway I do appresiate your info on this matter
BTW do you know whare one could get some example code of how to build a custom instalation script I would like to better understand this concept thanks
|
|
|
All times are GMT -5. The time now is 11:04 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|