LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-01-2008, 08:50 AM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,057

Rep: Reputation: 165Reputation: 165
Unhappy Grub Checking if "/boot/grub/stage1" exists... no (but it does) ???


Here is the situation - I have a Dell Dimension 4600 (Pentium 4) in which I have installed a "mobile rack" and have several drives which I can put into the rack (one at a time) depending on what OS I wish to run.

I created an install of Ubuntu 7.10 on an 80 GB SATA drive then backed it up with g4l. I built partitions on a 160 GB SATA drive to match the size of those on the 80 GB drive, copied the MBR using dd and restored the / and /home partitions to the 160 GB drive using g4l. Note: the 3rd partition is swap and the 4th partition /data is empty at this point - it takes up what ever space is left on the drives. Worked great.

Now I am trying to clone back from the 160 GB drive to an 80 GB drive. I have followed the same process. However, when I try to boot the machine goes to a GRUB prompt and stops.

After trying various things I decided to install Grub manually. I built the partitions with fdisk restored the data to sda1 and sda2 with g4l. This time I did NOT restore the mbr. Then I booted from a Ubuntu 7.10 live CD. Here is the layout of the 80 GB drive:
Quote:
ubuntu@ubuntu:/$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1f341f33

Device Boot Start End Blocks Id System
/dev/sda1 * 1 984 7903948+ 83 Linux
/dev/sda2 985 3474 20000925 83 Linux
/dev/sda3 3475 3723 2000092+ 82 Linux swap / Solaris
/dev/sda4 3724 9729 48243195 83 Linux
I invoked grub and proceeded as follows:

Quote:
ubuntu@ubuntu:/$ sudo grub
grub> root (hd0,1)

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

Error 15: File not found
I ran fsck on the partitions which I had restored with g4l and they showed clean. I then mounted partitions on the drive and poked about. I was able to navigate around the / and /home partitions (sda1 and sda2) with no problem. The stage1 file appeared to be where it was supposed to be:

Quote:
ubuntu@ubuntu:/$ sudo mkdir /test
ubuntu@ubuntu:/$ sudo mount /dev/sda1 /test
ubuntu@ubuntu:/$ ls -l /test/boot/grub
total 220
-rw-r--r-- 1 root root 197 2008-02-14 19:38 default
-rw-r--r-- 1 root root 30 2008-02-14 19:38 device.map
-rw-r--r-- 1 root root 8660 2008-02-14 19:38 e2fs_stage1_5
-rw-r--r-- 1 root root 8452 2008-02-14 19:38 fat_stage1_5
-rw-r--r-- 1 root root 15 2008-02-14 19:38 installed-version
-rw-r--r-- 1 root root 9152 2008-02-14 19:38 jfs_stage1_5
-rw-r--r-- 1 root root 4693 2008-07-07 14:28 menu.lst
-rw-r--r-- 1 root root 4201 2008-07-07 14:28 menu.lst~
-rw-r--r-- 1 root root 4265 2008-04-28 23:09 menu.lst.orig
-rw-r--r-- 1 root root 7860 2008-02-14 19:38 minix_stage1_5
-rw-r--r-- 1 root root 10132 2008-02-14 19:38 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 2008-02-14 19:38 stage1
-rw-r--r-- 1 root root 110292 2008-02-14 19:38 stage2
-rw-r--r-- 1 root root 9980 2008-02-14 19:38 xfs_stage1_5
I am no doubt missing something simple here. My next step is to do a clean install of Ubuntu on the 80 GB drive just to make sure it is not a mechanical malfunction. I sort of doubt that as I have recently run XP and Fedora 9 on this drive.

Thank for any advice.

Ken

p.s. Do I need to mount sda1 before running the grub "setup" command? Guess I will try that as well.
 
Old 08-01-2008, 09:32 AM   #2
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Knoppix
Posts: 1,823
Blog Entries: 14

Rep: Reputation: 282Reputation: 282Reputation: 282
hd0 vs hd?

Sometimes BIOS and therefore Grub have a different idea about the drive order than you do. You mentioned a multirack system, I suspect that placing the drives in different locations may be underlying the problem, particularly if more than one drive is in at the time.

Try typing, at the grub prompt:

root ([TAB]

to see what drives are available. You can then use

find (hd0,0)/grub/stage1

or variations thereof to find out where grub thinks the files are.
 
Old 08-01-2008, 09:35 AM   #3
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Quote:
Originally Posted by taylorkh View Post

p.s. Do I need to mount sda1 before running the grub "setup" command? Guess I will try that as well.
No if you have the grub shell your commands were good and if you are doing this from your ubuntu install disk. My only question is are you sure your root partition is number 1 and if it is your commands should be

root (hd0,0)

setup (hd0)
 
Old 08-01-2008, 09:59 AM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,057

Original Poster
Rep: Reputation: 165Reputation: 165
Thanks for the prompt reply Larry. Tried mounting and that did not help - as you indicated. I believe you have hit the nail on the head. If partition numbering is zero based my root would be 0. I was following instructions in an article where the writer had about half a dozen different OS installed on the same disk. In reading it again I think he was installing on his second partition for some reason. I simply followed his example.

I just finished installing a fresh Ubuntu 7.10 image on the existing partitions of the 80 GB drive. Booted fine. I then used g4l to replace the / and /home partitions and again it boots. I will go back and try "boot (hd0,0)" and make sure that works. Then I have to remember why I was making this copy of my "production" install(?) I think it was to upgrade to 8.04 and see what gets broken. Thanks again!

Regards,

Ken
 
Old 08-01-2008, 12:48 PM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,057

Original Poster
Rep: Reputation: 165Reputation: 165
It helps to use the correct partition. boot (hd0,0) did the trick. Thanks again.
 
Old 08-01-2008, 05:17 PM   #6
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
You are welcome.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gentoo... grub problems... "/boot/grub/stage1" exists... no halo14 Gentoo 5 02-06-2011 04:50 PM
gentoo : grub: The file /boot/boot/grub/stage1 not read correctly Boudewijn Linux - Software 3 05-21-2008 03:13 AM
uninstall boot loader "Lilo" install "Grub" sethis Linux - Newbie 6 11-30-2006 09:32 AM
GRUB dual boot problem: Boot "other" (windows) just restarts GRUB! stevod333 Linux - Software 13 04-06-2006 05:26 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM

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

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