Linux - SoftwareThis 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
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.
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.
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
(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.
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
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
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.
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.
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.
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.
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.
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.
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.
(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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.