LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
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


Reply
  Search this Thread
Old 04-11-2006, 01:47 AM   #1
zbenjudah
Member
 
Registered: Mar 2006
Posts: 64

Rep: Reputation: 15
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
 
Old 04-11-2006, 03:20 AM   #2
kevkim55
Member
 
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353

Rep: Reputation: 32
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 !
 
Old 04-11-2006, 01:18 PM   #3
zbenjudah
Member
 
Registered: Mar 2006
Posts: 64

Original Poster
Rep: Reputation: 15
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
 
Old 04-15-2006, 07:36 AM   #4
kevkim55
Member
 
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353

Rep: Reputation: 32
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.
 
Old 04-16-2006, 04:09 PM   #5
zbenjudah
Member
 
Registered: Mar 2006
Posts: 64

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Image Target Window/File Problem lucky6969b Programming 0 01-12-2006 03:02 AM
File system middle man on dual boot system? TehFlyingDutchman Linux - General 5 12-28-2005 02:17 AM
Boot x86 target from flash, with the image and file system on the x86 host. batsayan Linux - Software 2 08-23-2005 12:09 AM
HELP cant boot file system error!!!!!! Nz_Boy_2004 Slackware 10 12-09-2004 05:17 PM
problem with file system boot... os2 General 2 07-14-2004 10:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration