LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2005, 06:29 PM   #31
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113

If you put Ubuntu's Grub into the MBR then the installer will not put it again in the root partition. Your current problem is Ubuntu can't be booted from the MBR. You can put it back into hd0 later once you get Ubuntu up and running, preferrably have the precise information how each of your disk is called by both Linux and Grub.

Chainloading is the best thing in booting.

A Linux boot loader boots a system up by only 2 methods

(1) Directl method - by calling its kernel and initrd out, as demonstrated by Ubuntu

title Ubuntu, kernel 2.6.12-9-386
root (hd1,2)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hdb3 ro quiet splash
initrd /boot/initrd.img-2.6.12-9-386
savedefault
boot

(2) By chainloading - This means one boot loader call another boot loader, as demonstrated by FC booting Windows

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hdc1
title Microsoft Windows XP Professional
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

In chain loading Grub discrads itself after the first sector and "pastes" it with the new boot loader at the +1 sector position. The combined code is loaded. Grub has to do this with Windows because the bugger has no kernel!

The beauty of chain loading is that Grub can boot anything, even DOS, BSD, Solaris and naturally its fellow Linux.

The Grub floppy I asked to to make will boot without the use of the MBR. The first sector from the Floppy-Grub is then joined up at the second sector position of your Ubuntu-Grub. The combined bootloader will boot up Ubuntu.

The Grub floppy (unattached to a system) boots every of my 50+ systems! so open a deposit box in the bank and lock it up every time you finish with it.
 
Old 11-12-2005, 10:36 AM   #32
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
Running the Ubuntu live cd and following the instructions from the other thread:

Quote:
Step 1 - Arrange the boot loader Grub inside Debian's root partition

I am guessing the root partition of your Debian is in hda1 so putting Grub in hda1 is

grub-install /dev/hda1
ubuntu@ubuntu:~$ sudo grub-install /dev/hdb3
/dev/mapper/casper-snapshot does not have any corresponding BIOS drive.

fdisk on ubuntu:

Device Boot Start End Blocks Id System
/dev/hda1 * 1 26203 198094648+ 83 Linux

Disk /dev/hdb: 40.8 GB, 40822161408 bytes
255 heads, 63 sectors/track, 4963 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 2550 20482843+ c W95 FAT32 (LBA)
/dev/hdb2 4842 4963 979965 82 Linux swap / Solaris
/dev/hdb3 * 2551 4841 18402457+ 83 Linux

Partition table entries are not in disk order

Disk /dev/hdc: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 2550 20482843+ c W95 FAT32 (LBA)
/dev/hdc2 2551 9964 59552955 7 HPFS/NTFS
 
Old 11-12-2005, 12:26 PM   #33
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Remember to change root from Live CD Linux to the installed Linux with coomands like

mkdir /mnt/hdb3
mount /dev/hdb3 /mnt/hdb3
chroot /mnt/hdb3

before replicating Grub, otherwise you replicate Live CD's boot loader.

OK your problem of no corresponding BIOS drive may be difficult to resolve but you can activate Grub after changing root to the distressed Ubuntu by typing at root terminal

grub
root (hd1,2)
setup (hd1,2)
quit

The above is same as doing grub-install /dev/hdb3 in Bash shell. If this fails too just proceed to Step 2 to make a GRub floppy unattached to an operating system.

With that Grub floppy booted to a Grub prompt your Ubuntu can still be booted "manually" with these lines

root (hd1,2)
kernel /boot/vmlinuz-2.6.12-9-386 root=/dev/hdb3 ro quiet splash
initrd /boot/initrd.img-2.6.12-9-386
boot
 
Old 11-12-2005, 01:51 PM   #34
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
ubuntu@ubuntu:~$ dd if=/mnt/hdb3/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 1.228935 seconds (417 bytes/sec)
ubuntu@ubuntu:~$ dd if=/mnt/hdb3/boot/grub/stage2 of=/dev/fd0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes transferred in 1.296455 seconds (395 bytes/sec)

Created my grub floppy
(I did enter sudo chroot /mnt/hdb3 but`/boot/grub/stage1': No such file or directory error cropped up so I used the statement shown above)

I'll give both ways of booting a shot.
[Naturally Ill be changing the boot order from cd;hdd2 to fd;hdd2]

before installing grub onto the floppy i ran an fdformat on it.

------------------------------------------

System boots, reads floppy then hangs. No grub output. Just a corrupt/incorrect installation I guess?

Last edited by TotalLinuxNoob; 11-12-2005 at 02:04 PM.
 
Old 11-12-2005, 04:51 PM   #35
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
I am afraid you haven't read the important bits of

---------off from another thread------
OK, May be you should try the traditional method of locating the original source of stage1 and stage2 files by asking Linux to find it for you. So while in Suse do a

find / -name stage1

The record I kept indicates Suse 9.3 keeps these two files in /usr/lib/grub/i386-suse directory. You then cd to the directory located by the find command and do the two dd statements again, with /boot/grub dropped, i.e.

dd if=stage1 of=/dev/fd0 bs=512 count=1
dd if=stage2 of=/dev/fd0 bs=512 seek=1

That is the method recommended by "Linux in a nutshell" and also the "Grub Manual" but I alway grab the two files from the /boot/grub directory as they work OK.
----------------------------

You should have seek=1 instead of cout=1 for stage2.

Also to obtain the stage1 and stage2 from the directory starting /usr/lib/grub.... is preferred for the best success rate.

The guy who got my above reply has since reported using the Grub floppy booting both Linux and Xp successfully.
 
Old 11-12-2005, 05:55 PM   #36
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
After making that post I used grub-floppy on the live cd and managed to boot the Ubuntu kernel. Ubuntu then forced checked the / drive as according to its diagnosis it contained errors.

The grub prompt did print the error 18 pertaining to hdb2

I'm not too happy about it mounting all my drives, including ntfs, as rw but that can be edited in the fstab file I believe.
Especially displeasing is its choice of 60Mhz at 1024*768.

In Ubuntu I set the FC3 fstab swap partition to hdb2 and rebooted. Setting kernel fails, however. When the kernel is set it returns somethign along the lines of "..bad file.." The file name and path are correct.

Many thanks for all your efforts and determination.
 
Old 11-12-2005, 06:29 PM   #37
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Don't know what you have done with Grub on hdb2 which is a swap partition. Grub never touches a swap partition and should not report error on it, unless you make Grub to boot it.

I wouldn't worry too much of Ubuntu mounting your ntfs partitions because Linux cannot write on it and so no possible damage. You can only damage your own files by deleting them in /mnt directories where they would be mounted.

It does look like you have done whatever possible with FC3 and it may be time to upgarde to FC4. Migrate al your personal data out of the large disk and do a clean install of FC4 or FC3. Both are no bigger than 10Gb. FC3 and FC4 are 2.72Gb and 3.15Gb respectively. They are housed in 5 and 20Gb partitions in my box.
 
Old 11-15-2005, 03:38 PM   #38
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
I installed ubuntu and left grub alone so maybe a hd h/w problem? Possibly the drive just needs a good ol' complete format...? That however does sound like an unprofessional approach...

the reason I was worried bout Ubuntu mounting my HD was that I recalled the NTFS module being experimental and I believed it included the ability to write to the hd.

When u mention clean install u mean a hd/partition format ..

I did download the FC4 rescue disk - it found both the ubuntu install and FC. However upon trying to mount the FC drive [hda1] it encountered errors and halted.

Would it be possible to leave hda1 the way it is, download and run the FC4 installer, which is bound to find the FC3 installation, and let it update it? Or is the FC4 installer incapable of updating FC3 and leaving other data on the drive intact?
Atleast that way I would be able to preserve all the settings found in FC3.. like my configured apache server.
If not I will most likely replace the ubuntu installation with FC4. Ubuntu did not win any favours with me. The strength of many Linux distro's is all the software that is included. ubuntu is without this strength which makes it rather weak IMHO.

Thanx

Last edited by TotalLinuxNoob; 11-15-2005 at 03:40 PM.
 
Old 11-15-2005, 04:19 PM   #39
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
The last 2 things you can try

(a) Boot up FC manually with the Grub floppy (unattached to a system) and type

root (hd0,0)
kernel /boot/vmlinuz-2.6.11-1.27_FC3 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.11-1.27_FC3.img
boot

Report any error message

(b) Restore FC's boot loader in MBR

Boot up the Grub floppy again and type

root (hd0,0)
setup (hd0)

again report any error

---------------

A clean install = format the partion before putting things in.
 
Old 11-15-2005, 05:44 PM   #40
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by saikee
The last 2 things you can try

(a) Boot up FC manually with the Grub floppy (unattached to a system) and type

root (hd0,0)
kernel /boot/vmlinuz-2.6.11-1.27_FC3 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.11-1.27_FC3.img
boot

Report any error message

Same error as before -
Error 2: bad file / directory type

Quote:

(b) Restore FC's boot loader in MBR

Boot up the Grub floppy again and type

root (hd0,0)
setup (hd0)

again report any error
It failed to find the grub files on the drive. It would make sense considering the grub install booting FC3 up originally was installed on what is currently hd1 [grub notation]. I had problems installing it on the 200gb b/c of BIOS issues so at the time a more tutored friend found the solution in booting up FC from the 40gb drive.

It did manage install it on hd1.
1]This could be b/c ubuntu is currently installed on it or b/c the previous grub install still exists on it?
2]Would it be ok to now change the boot order and attempt to boot a different drive to determine the effect of installing grub on hd1?
3] Would running an FC4 upgrade on the FC3 installation leave my data on the drive intact? If so, that could be a last resort. However if it has the effect of wiping all setting / preferencs including those of yum etc I mite aswell install it over the ubuntu partition.

Thanks
 
Old 11-15-2005, 06:11 PM   #41
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
(1) yes the MBR on the 2nd disk would disappears
(2) You can try it. Would do any damage. Just remeber don't use Unbuntu because the wrong disk order!
(3) I would pull the data out first. Generally you can make the installer to keep the old files. You bound to lose some settings.
 
Old 11-18-2005, 09:19 PM   #42
tinybit
Member
 
Registered: Jul 2005
Location: China
Distribution: Mandriva
Posts: 84

Rep: Reputation: 15
GRUB and LILO always conflict with Windows.

So try GRUB for DOS please. It is a cross-platform boot loader based on GNU GRUB. The GRUB.EXE can be started from DOS/Win9x; and GRLDR can be started from BOOT.INI of Windows NT/2K/XP/2003; and even more, the GRUB.EXE can be started from LINUX via the KEXEC tool.

By using GRUB.EXE or GRLDR, you don't have to touch your MBR. It is the safest way coexisting with DOS/Windows.

You needn't install GRUB for DOS. Just run GRUB.EXE from DOS, or append a line of "C:\GRLDR=START GRUB" into your BOOT.INI(restart and select the "START GRUB" menu item), that will do.

Download GRUB for DOS here: http://freshmeat.net/projects/grub4dos/

There is a fat12grldr.img file with the GRUB for DOS release. You can create a GRUB bootable floppy with this fat12grldr.img file.

Or, you can just copy GRUB.EXE to your DOS floppy and run GRUB.EXE to enter the GRUB environment.
 
  


Reply



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
Where's my 'Kernel-output-path' BuckRogers01 Debian 2 07-14-2005 08:13 AM
Finding the kernel path blacksunshine Linux - Software 2 10-03-2004 02:45 PM
What is the path to Linux Kernel source beginner16 Linux - Newbie 4 11-24-2003 04:21 AM
Compiling Kernel (specifying Bash path) ugenn Linux - Software 5 04-02-2003 12:38 PM
path and filename of compressed kernel ? ohernandez Linux - General 3 05-29-2002 06:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:35 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