Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
I have recently attempted to install Ubuntu Linux and have it dual boot off XP's ntldr. I have run through several howto's and read a fair amount on forums to try and get this working myself; but am failing at getting grub chain loaded from ntldr. My disk geometry and fdisk output are at the bottom of this post.
I installed Grub by running the following commands:
sudo grub
grub> root (hd1,4)
grub> setup (hd1,4)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd1,4)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd1,4)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd1,4) /boot/grub/stage2 p /boot/grub/menu
.lst "... succeeded
Done.
I'm guessing the non-fatal error is actually fatal?
The command I'm using to create the boot file is:
dd if=/dev/hdb5 of=./ubuntu.bin bs=512 count=1
I then edited the boot.ini on my Windows partition and added a line: Ubuntu=C:\ubuntu.bin.
I get this as a choice in the OS menu, and when I select it all I see is: Grub _
I believe this is part of the contents of the ubuntu.bin file, and that Grub is not actually loading at all from (hd1,4) and not reading my menu.lst file – which is where I installed it to.
Has anyone got any ideas where I'm going wrong with this setup? I'm not looking to replace ntldr with Grub...hence this setup.
Many Thanks,
Phil
The output below has been edited in that i have removed my SATA drives from it, as I dont believe they are relevant to the problem (and it would take up a large amount of post space). My BIOS is set to boot from IDE. Current Disk Setup:
~$ sudo fdisk -lu
Disk /dev/hda: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders, total 78165360 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 63 78164351 39082144+ 7 HPFS/NTFS
Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 63 156296384 78148161 5 Extended
/dev/hdb5 * 126 71682029 35840952 83 Linux
/dev/hdb6 71682093 75874994 2096451 82 Linux swap / Solaris
/dev/hdb7 75875058 156296384 40210663+ b W95 FAT32
grub> geometry (hd1)
drive 0x81: C/H/S = 9729/255/63, The number of sectors = 156301488, /dev/hdb
Partition num: 4, Filesystem type is ext2fs, partition type 0x83
Partition num: 5, Filesystem type unknown, partition type 0x82
Partition num: 6, Filesystem type is fat, partition type 0xb
The one thing that I see is that--after making the file "ubuntu.bin", you need to copy it into the Windows partition. (in the same folder as boot.ini, I think)
note, in your dd command, I'm not sure you want or need to have the "./" in front of ubuntu.bin
Bariton:
I'm a little tentative about writing Grub into my MBR - mainly because I just don't want to interfere with the Windows installation which is on a seperate disk. It's a road I'll go down once I've exausted all other routes (I have now backed up my current MBR as I mull over using Grub as the primary bootloader). This post is the last chain salon for ntldr - perhaps not the best idea me posting this on a linux qs website then...
pixellany:
The ubuntu.bin file was copied to the windows partition (must have missed that bit out in my post). The ./ is not needed, but almost certainly not the cause of the problem as the file was written to the destination I was expecting.
I'm almost certain my ubuntu.bin file is being read during the boot as that's the only thing that is going to show the "Grub _" line i.e. Windows does not know about Grub.
You can also install grub in the MBR of the disk windows isn't on (hdb for example) then set in the bios to boot the second harddisk that way you won't have to mess your windows mbr and if you mess up you can just set the bios to boot hda again.
Teek:
I think I'll give that a go before i write Grub into my main disk MBR - sounds like a good suggestion on that front! Though ultimately dual booting off ntldr is the best option for me (shared PC etc, and my girlfriends not overly PC literate - might be an akward one trying to talk her through changing the boot options in the BIOS because I left it booting Ubuntu).
pixellany:
I've opened up the menu.lst file created by the ubuntu install and it knows about my Windows partiton etc and looks fine to me regarding the location of the ubuntu installation.
title Ubuntu, kernel 2.6.20-15-generic (recovery mode)
root (hd1,4)
kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=7b4069e7-a197-4fcb-a99c-d250a45758ab ro single
initrd /boot/initrd.img-2.6.20-15-generic
title Ubuntu, memtest86+
root (hd1,4)
kernel /boot/memtest86+.bin
quiet
title Other operating systems:
root
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
chainloader +1
My gut feeling is that Grub is not finding hd(1,4) partition.
might be an akward one trying to talk her through changing the boot options in the BIOS because I left it booting Ubuntu).
Its not if you get it to boot windows from there, its how I did it for years with a computer which somehow always stopped booting windows as soon as I messed with the mbr of the windows disk. Having 2 disks gives you a spare mbr to play with .
Edit: Maybe you can also post your /etc/fstab , you know you also should add 1 to the partition right?
Edit2: you know when you install grub on a secondairy disk you need to add this:
map (hd0) (hd1)
map (hd1) (hd0)
to your menu.lst/grub.conf... Also, that reverses the drive indicators; Grub finds the drive it's on to be hd0,0 although it isn't and you tell grub that by this statement.
ah ha - like the thinking! Definitely worth looking into straight away as it cant cause any harm with the current setup, and trusting it works straight off I can boot Windows also from the second disk. Will post the /etc/fstab once I'm up and running in ubuntu in a moment, I'm not sure what you mean by adding one to the partition. I know hdb5 is referred to as hd1,4 in Grub...
it errors on the setup command - Error 17: Cannot mount selected partition.
The hd1 disk does not have a primary partition, its an extended partition with logical drives. I understood this was not a problem for Linux from what I read on a website.
Last edited by pam196; 09-07-2007 at 10:16 AM.
Reason: typo
I don't know this for sure, hope someone else does... but in gentoo you have to be inside the installed Linux environment because some stuff has to be written to /boot/grub for grub to work. Don't know how it is for ubuntu, if "grub-install" doesn't work I'm sorry to tell you that I'm out of options.
Can't you boot your existing Ubuntu with the live cd?
Look at your first post - you used "root (hd1,4)" there; why did you change ???. I would expect the following to work; presumes Feisty (7.04) as it uses UUID - else you'll have some cleanup to do with device addresses
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.