LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-11-2008, 05:47 PM   #1
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Rep: Reputation: 15
When installing Ubuntu 8.10 I selected hd0 for grub to reside but...


when the system boots it says it is booting from hd1,7 ext3. When I checked fdisk -lu it says it boots from /dev/sb1. This seems contradictory. I have a vanilla WinXP system with Ubuntu 8.10 installed on a usb external drive. My intention was to have XP be the primary OS until I get linux running stable. I wanted to have grub on the internal hd so that I could remove the usb drive but when I do it won't boot. Can someone please tell me how to straighten this out.
 
Old 11-11-2008, 06:24 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Presumably you mean the fdisk shows /boot on /dev/sdb1. Where that is (ultimately) mounted may be irrelevant to the boot process - but in your case probably not.

What it looks like you did was only install grub to the MBR of the interbnal disk - so far so good. You need the stage and config files (i.e. /boot) on there as well. That means another partition on the internal disk - and a re-install of the loader code so the MBR knows to look at the internal. Then you should be good to go.
 
Old 11-12-2008, 01:11 PM   #3
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Thank you for your insights. [Pardon the typo; I did mean sdb1.] I have plenty of partitions on the internal drive. I don't know how I got so many. There is a 3.23G primary, a 3.12G logical, a 160G extended, and three 4.98G logical partitions. Anyway, I did not notice any options, while doing the install, that permitted me to select the location of the boot loader. If they aren't available in the installation program I don't know how to proceed. Also, if I run the installation disk again what impact will that have on the rest of the ubuntu OS, (which I have spent quite a bit of time customizing) and can I quit when I have corrected the grub problem? It's too bad you are sleeping while I am typing - otherwise I'd have an answer sooner.

Regards, Dick

Woops, I see that the profusion of partitions is on the usb drive, not the internal drive. Strangely, the 3.23G and the 3.12G partitions both seem to have the ubunto OS installed. Does this do any harm - should I remove one of them? I assume I can safely create the needed partition on hd0 since there is plenty of room. And I also assume this is to be done before the re-installation. Is there any reason to do it either in Windows or linux? I feel more comfortable doing it in linux.

Last edited by dickgb; 11-12-2008 at 01:22 PM. Reason: Error in original
 
Old 11-12-2008, 03:07 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I'm not sure if the "normal" install allows you to manually select the mountpoints (for /boot in this case) - it never used to, so I always use the "alternate" CD so I can control things better. Maybe there is an "expert" option somewhere now.
I had typed a missive on how to do what you want, but first we'd better see how things are setup at the moment. From a Ubuntu terminal run these and post all the output
Code:
sudo fdisk -l
grep -vE "(^#|^\s*$)" /boot/grub/menu.lst
 
Old 11-13-2008, 12:45 PM   #5
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Good morning syg00

Again thanks for your attention and efforts. Here is the info you requested. I hope this will enable you to recommend the mods that are needed. Hopefully, tomorrow you'll have some new wisdom for me.

Dick

dick@dick-Foothills:~$ sudo fdisk -l
[sudo] password for dick:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
240 heads, 63 sectors/track, 20673 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Disk identifier: 0xa7a57e45

Device Boot Start End Blocks Id System
/dev/sda1 1 843 6373048+ b W95 FAT32
/dev/sda2 * 844 20672 149907240 7 HPFS/NTFS

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x01394e34

Device Boot Start End Blocks Id System
/dev/sdb1 1 422 3389683+ 83 Linux
/dev/sdb2 423 24321 191968717+ 5 Extended
/dev/sdb5 23803 24321 4168836 82 Linux swap / Solaris
/dev/sdb6 423 829 3269164+ 83 Linux
/dev/sdb7 23284 23802 4168836 82 Linux swap / Solaris
/dev/sdb8 830 22764 176192856 83 Linux
/dev/sdb9 22765 23283 4168836 82 Linux swap / Solaris

Partition table entries are not in disk order
=================
dick@dick-Foothills:~$ grep -vE "(^#|^\s*S)" /boot/grub/menu.lst

default 0

timeout 10






















title Ubuntu 8.10, kernel 2.6.27-7-generic
uuid a72323cc-b659-4992-8a19-73ec7f8d525f
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=a72323cc-b659-4992-8a19-73ec7f8d525f ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic
quiet

title Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid a72323cc-b659-4992-8a19-73ec7f8d525f
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=a72323cc-b659-4992-8a19-73ec7f8d525f ro single
initrd /boot/initrd.img-2.6.27-7-generic

title Ubuntu 8.10, memtest86+
uuid a72323cc-b659-4992-8a19-73ec7f8d525f
kernel /boot/memtest86+.bin
quiet


title Other operating systems:
root


title Windows NT/2000/XP
root (hd0,0)
savedefault
makeactive
chainloader +1


title Microsoft Windows XP Home Edition
root (hd0,1)
savedefault
makeactive
chainloader +1
 
Old 11-13-2008, 03:17 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
looks like you've had a few goes at that install - let's see this output as well
Code:
df -hT
blkid
 
Old 11-13-2008, 08:53 PM   #7
Duck2006
Member
 
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
http://www.pendrivelinux.com/categor...sb-hard-drive/
 
Old 11-14-2008, 12:48 PM   #8
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Here's the info you requested. I hope this will permit you to make your recommendations for a new setup that will permit the removal of the usb drive withou affecting the use of WinXPp

dick@dick-Foothills:~$ df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb8 ext3 166G 3.2G 154G 3% /
tmpfs tmpfs 695M 0 695M 0% /lib/init/rw
varrun tmpfs 695M 100K 695M 1% /var/run
varlock tmpfs 695M 0 695M 0% /var/lock
udev tmpfs 695M 2.9M 693M 1% /dev
tmpfs tmpfs 695M 436K 695M 1% /dev/shm
lrm tmpfs 695M 2.0M 694M 1% /lib/modules/2.6.27-7-generic/volatile
/dev/sdb6 ext3 3.1G 344M 2.6G 12% /media/disk
/dev/sdb1 ext3 3.2G 348M 2.7G 12% /media/disk-1


dick@dick-Foothills:~$ blkid
/dev/sda1: LABEL="HP_RECOVERY" UUID="595B-27B6" TYPE="vfat"
/dev/sda2: UUID="8624958324957741" LABEL="HP_PAVILION" TYPE="ntfs"
/dev/loop0: TYPE="squashfs"
/dev/sdb1: UUID="5b366277-a02a-42bb-8b79-c40bf7b9a47d" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb5: UUID="d173ecf5-f993-4a87-bf78-5afa0b56cf26" TYPE="swap"
/dev/sdb6: UUID="cb86eddb-2c4a-4e6a-8de9-c05afdca4fb6" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb7: UUID="30d6bbcc-487e-426a-9738-f22c3b5db030" TYPE="swap"
/dev/sdb8: UUID="a72323cc-b659-4992-8a19-73ec7f8d525f" TYPE="ext3"
/dev/sdb9: UUID="13b26653-1787-4f94-bacb-f74e504435c0" TYPE="swap"
dick@dick-Foothills:~$

Thanks, Dick
 
Old 11-14-2008, 07:58 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I don't know how you got this impression ...
Quote:
Originally Posted by dickgb View Post
When I checked fdisk -lu it says it boots from /dev/sb1.
From the data you've presented, the boot code is under the root directory on /dev/sdb8.

Create a new partition on the internal - primary or logical, doesn't matter. I tend to make it ext2, but no reason not to use ext3 or any other grub supported filesystem. Give it say 200 Meg - way more than needed, but the Ubuntu installer has abysmal math; I've had it fail with 80 Meg free saying it needs 35 Meg. Others have reported similar when using separate boot partition. Let's say it's /dev/sda3 - check that it mounts automagically; usually something like /media/sda3 (might need a reboot). From a Ubuntu terminal try this
Code:
sudo cp -a /boot/* /media/sda3/
(before proceeding check that both dirs now look the same)
sudo grub
root (hd0,2)    <<<=== grub counting is zero-based
setup (hd0)
quit
Next you need to correct /media/sda3/grub/menu.lst so that all the lines beginning with uuid are replaced with
Code:
root (hd0,2)
Also add the following line to /etc/fstab
Code:
/dev/sda3    /boot    ext3    relatime   0  2
That should be about all.

The link from Duck2006 suggests another alternative - not what you said you wanted, but an option. Keep the external completely self contained. This would require less of the above, but would probably require you to select the boot device each time you wanted to use the external. Modern gear would allow you to have USB first in the boot order and even get around that. You would also need to restore the Windows loader on the internal - easy enough to do if you have the install disk.
 
Old 11-21-2008, 06:47 PM   #10
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
I didn't get lost. I just got sick -- respiratory infection. So I haven't been able to tend to my computer (except email.)

In response to your last communication, I have tried to create a new partition in linux as well as in Windows (both gui and command) but with no success. I don't know what I am doing wrong but maybe it is just that I have gotten more than a little cautious. I don't want to destroy my WinXP system again! Hopefully, you can point me in the right direction -- again.

Thanks in advance. I do appreciate the help.

Dick
 
Old 12-15-2008, 05:19 PM   #11
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
I finally got a program to retrieve part of the partition and created a new partition per your instructions. I was unable to complete your instructions because I got the following:

grub> root (hd0,2)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

Can you please explain how to proceed. Thank you very much.

Dick
 
Old 12-15-2008, 06:05 PM   #12
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Quote:
Originally Posted by dickgb
My intention was to have XP be the primary OS until I get linux running stable.
It sounds like you want to be able to use XP on your internal drive regardless of whether you have the USB drive connected, is that true? And then when you connect the USB drive, you would like the option to boot into Linux? If that's the case, can you change your BIOS to boot the USB drive? If you can, I think the solution to your problem could be really simple; you could install Grub to the MBR (Master Boot Record) of you USB drive, and then when you have the USB drive connected, you will get the Grub menu on start up so you can boot into Linux. That assumes you set your BIOS so that the USB drive comes before your internal drive in the boot order. If you then restore a Windows MBR to your internal drive, then when your USB drive is disconnected, you will boot straight into Windows. You could even add an option in your Grub menu to boot your internal Windows drive so that you don't have to disconnect/turn off your USB drive just to boot into Windows. Is this maybe along the lines of what you are looking for, or did I completely misunderstand your goal?

Also, in case you can't set your BIOS to boot your USB drive, but if your BIOS recognizes the USB drive on start up, it would be really easy to install Grub4DOS into Windows so that you could have the option to boot either Windows or your USB drive. If either of the cases I've outlined would work for you, you could save yourself from having to make a /boot partition on your Windows drive, although that's definitely an option that could work. It's up to you of course. Let me know if you want any specifics of how to go about the options I've suggested in case you are interested.

Last edited by CJS; 12-15-2008 at 06:09 PM.
 
Old 12-16-2008, 03:35 PM   #13
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by CJS View Post
It sounds like you want to be able to use XP on your internal drive regardless of whether you have the USB drive connected, is that true?
Exactly. I want to boot to XP by default, but later I will probably change that to booting linux by default. In any case, I would like, at this time, to be able to boot to XP with or without the USB drive connected.
And then when you connect the USB drive, you would like the option to boot into Linux? If that's the case, can you change your BIOS to boot the USB drive? If you can, I think the solution to your problem could be really simple; you could install Grub to the MBR (Master Boot Record) of you USB drive, and then when you have the USB drive connected, you will get the Grub menu on start up so you can boot into Linux. That assumes you set your BIOS so that the USB drive comes before your internal drive in the boot order. If you then restore a Windows MBR to your internal drive, then when your USB drive is disconnected, you will boot straight into Windows. You could even add an option in your Grub menu to boot your internal Windows drive so that you don't have to disconnect/turn off your USB drive just to boot into Windows. Is this maybe along the lines of what you are looking for, or did I completely misunderstand your goal?
Precisely. However, I don't know how to install grub to the two drives. When I installed Windows I installed a boot program which is initiated by the MBR, correct? When I installed linux I inadvertently installed it to the USB external drive so that the grub file was there and it brings up the menu so I can select the OS I want. However, if I disconnect the USB drive, the machine doesn't know how to boot.

Following your instructions I checked to see if the USB drive can be accessed from the BIOS and it can be. Unfortunately, when I told it I wanted the USB drive to boot first it wouldn't boot at all. If I left it for a long time (lunch) it booted to the USB, i.e. linux. It may or may not have brought up the menu, but previously it brought up the menu almost instantly. If I want to boot now, I have to access the BIOS and instruct it to use the internal HD as primary.

I would appreciate it if you could tell me how to install the grub program on each of the 2 drives and where to find the info on how to edit the grub file to designate the proper drive. I am sure it is now structured incorrectly.
Also, in case you can't set your BIOS to boot your USB drive, but if your BIOS recognizes the USB drive on start up, it would be really easy to install Grub4DOS into Windows so that you could have the option to boot either Windows or your USB drive. If either of the cases I've outlined would work for you, you could save yourself from having to make a /boot partition on your Windows drive, although that's definitely an option that could work. It's up to you of course. Let me know if you want any specifics of how to go about the options I've suggested in case you are interested.
I think the Grub4DOS is probably the right solution to my problem but I will respect your opinion and follow your advice.

Many thanks for the information.

Dick
 
Old 12-16-2008, 03:42 PM   #14
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
OK, in order to get a clearer picture of your setup, how about downloading the "boot_info_script.txt" file to your Ubuntu desktop, open a terminal (Applications > Accessories > Terminal) and do:
Code:
sudo sh ~/Desktop/boot_info_script.txt
That will create a "boot_info_results.txt" file on your desktop; please copy/paste the contents of that file to your next post. That will help clarify your setup so I can give you more specific instructions about setting up your system to dual boot.

Last edited by CJS; 12-18-2008 at 12:49 PM.
 
Old 12-17-2008, 12:46 PM   #15
dickgb
Member
 
Registered: Oct 2007
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks for your instant reply. It came so quickly that I missed it yesterday.

The shell script you sent would not run per your instructions but I fooled around and got the output which follows. I have no idea whether it is complete. Please let me know if I need to access more information. It would appear that my efforts prior to your involvement deleted all boot loaders which is why I'm having so much trouble. Anything you can do to get this novice out of trouble and back on track will be greatly appreciated.

==============================

No known boot loader is installed in the MBR of /dev/sda
No known boot loader is installed in the MBR of /dev/sdb
No known boot loader is installed in the MBR of /dev/sdc
No known boot loader is installed in the MBR of /dev/sdd
No known boot loader is installed in the MBR of /dev/sde
No known boot loader is installed in the MBR of /dev/sdf
No known boot loader is installed in the MBR of /dev/sdg

sda1:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sda2:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sda3:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sda4:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sdb1:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sdb2:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sdb5:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sdb6:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sdb7:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sdb8:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:

sdb9:
File system:
Boot sector type: Unknown
Boot sector info:
Operating System:
Boot files/directories present:
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fatal error - grub cant be written to hd0 PlaneCharlie Linux - Newbie 2 12-02-2007 12:04 AM
Grub hard drive question - root (hd0,0) Thaidog Linux - Newbie 3 12-13-2006 05:18 AM
grub; hda1 == root(hd0,0) ; hda5 = ???? stupidloser Linux - General 6 12-05-2004 01:26 AM
Grub: how to recover Boot Record for (hd0,0)? fishwombat Linux - General 1 04-27-2004 09:43 AM
Grub can't find files on (hd0,0) nathology Linux - Software 6 10-24-2003 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:56 PM.

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