Fedora Linux Support Community & Resources Center
  #1  
Old 27th January 2009, 07:14 AM
rbhkamal Offline
Registered User
 
Join Date: Jul 2007
Posts: 34
Added a new HDD and broke Grub - Error 15

[EDIT] Correction, Grub loads but gives me Error 15 [EDIT]

I bought a 640GB HD and wanted to swap it with a 80GB Harddrive which has two partitions: /dev/sdb1 (boot) LogVol01
/dev/sdb2 (LVM) LogVol00

After taking the steps below, grub doesn't seem to load from the new harddrive:
1- Used fdisk to create two partitions:
1.5GB /dev/sda1 (ext3) Primary + Boot flag
639GB /dev/sda2 (ext3) Primary

2- Used dd to clone the /boot partition from the old HD to the new one:
dd if=/dev/sdb1 of=/dev/sda1

3- Moved the extends from /dev/sdb2 to /dev/sda2
pvcreate /dev/sda2
vgextend VolGroup00 /dev/sda2
pvmove /dev/sdb2 /dev/sda2
vgreduce VolGroup00 /dev/sda2

4- Poweroff
5- Remove the old 80GB HD
6- Power-on and set my BIOS to boot from the new harddrive.

Now the computer seems to boot from the new harddrive however, I only get black screen with a blinking dash.

[EDIT] Correction, Grub loads but gives me Error 15 [EDIT]

What did I miss here?

Thank's for you help

Last edited by rbhkamal; 27th January 2009 at 07:37 AM.
Reply With Quote
  #2  
Old 27th January 2009, 08:24 AM
caf4926 Offline
Registered User
 
Join Date: Jun 2007
Location: The English Lakes
Posts: 125
You need to supply your /boot/grub/menu.lst

and

result of:

fdisk -l

error 15 usually means a file error
__________________
Novell Knowledge Partner
Reply With Quote
  #3  
Old 27th January 2009, 02:46 PM
mrechte Offline
Registered User
 
Join Date: Jul 2007
Posts: 59
Hi,

If disks are not the same you cannot just dd the the /boot disk partitions because the disk geometry is different.

Your step 2) will not work because you overwrite the MBR (including the partition table) you have created in step 1)

In rescue mode (with the F10 DVD),I think you should use cp -a to restore /boot and then re-install grub (you must re-create the boot loader to point to grub)

I will not comment your step 3) because obviously you have not reached that stage !

regards
Reply With Quote
  #4  
Old 27th January 2009, 04:50 PM
rbhkamal Offline
Registered User
 
Join Date: Jul 2007
Posts: 34
Thanks for the help, So now all I need to do is:
1- Recreate the partition /dev/sda1 and format it
2- mount /dev/sda1 to /media and "copy -a /boot to /media
3- ?

[Edit] If I plug both the old and new harddrive and boot from the old one, everything works fine. fdisk -l shows both harddrives
/dev/sdb (OLD)
/dev/sda (new)
/dev/sdc (just another hdd in lvm)
/dev/sdd (just another hdd in lvm)

Here the requested files
Code:
Last login: Tue Jan 27 11:42:08 2009
[root@server ~]# cd /boot
[root@server boot]# cd grub/
[root@server grub]# cat menu.lst 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.26.8-57.fc8)
	root (hd0,0)
	kernel /vmlinuz-2.6.26.8-57.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.26.8-57.fc8.img
title Fedora (2.6.26.6-49.fc8)
	root (hd0,0)
	kernel /vmlinuz-2.6.26.6-49.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.26.6-49.fc8.img
[root@server grub]# 
[root@server grub]# fdisk -l

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xcc6a4e5c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1500    12048718+  83  Linux
/dev/sda2            1501       77825   613080562+  8e  Linux LVM

Disk /dev/sdb: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0e490e48

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   83  Linux
/dev/sdb2              14        9039    72501345   8e  Linux LVM

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb8eb4f26

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1       60801   488384001   8e  Linux LVM

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000a096d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *           1       60801   488384001   8e  Linux LVM

Disk /dev/dm-0: 1072.2 GB, 1072231874560 bytes
255 heads, 63 sectors/track, 130358 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-1 doesn't contain a valid partition table
[root@server grub]#

Last edited by rbhkamal; 27th January 2009 at 04:54 PM.
Reply With Quote
  #5  
Old 27th January 2009, 05:14 PM
mrechte Offline
Registered User
 
Join Date: Jul 2007
Posts: 59
This is what I would try to restore the boot loader. Please remove your OLD disk to avoid mistakenly destroying its content !

In rescue mode, run grub and type:

grub> root (hd0,0)
grub> setup (hd0)

Th system should now be able to boot on /dev/sda1 partition and load the kernel.
Reply With Quote
  #6  
Old 27th January 2009, 05:38 PM
mrechte Offline
Registered User
 
Join Date: Jul 2007
Posts: 59
Quote:
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1500 12048718+ 83 Linux
/dev/sda2 1501 77825 613080562+ 8e Linux LVM
Something is strange: the boot partition is very big (12 GB). 100 MB is the recommended value, unless this was done on purpose. Also the fs you have restored with dd is originaly 100 MB, so you will have to increase it on the new drive.
Reply With Quote
  #7  
Old 27th January 2009, 08:45 PM
rbhkamal Offline
Registered User
 
Join Date: Jul 2007
Posts: 34
THANKS! Everything is well again with the exception of two things:
1- Grub doesn't load my OS automatically, how can I resolve this?
2- Will I be able to resize the boot partition to 100mb without destroying anything?

Thanks again

Edit: Here is the content of my /boot
Code:
Last login: Tue Jan 27 15:50:16 2009
[root@server ~]# cd /b
-bash: cd: /b: No such file or directory
[root@server ~]# cd /boot/
[root@server boot]# ls
boot                    config-2.6.26.8-57.fc8  initrd-2.6.26.6-49.fc8.img  lost+found                  System.map-2.6.26.8-57.fc8  vmlinuz-2.6.26.8-57.fc8
config-2.6.26.6-49.fc8  grub                    initrd-2.6.26.8-57.fc8.img  System.map-2.6.26.6-49.fc8  vmlinuz-2.6.26.6-49.fc8
[root@server boot]# ls -al
total 13612
drwxr-xr-x  5 root root    4096 2009-01-27 15:53 .
drwxr-xr-x 26 root root    4096 2009-01-27 15:49 ..
drwxr-xr-x  3 root root    4096 2009-01-27 12:19 boot
-rw-r--r--  1 root root   88385 2008-10-17 16:10 config-2.6.26.6-49.fc8
-rw-r--r--  1 root root   88396 2008-12-18 19:27 config-2.6.26.8-57.fc8
drwxr-xr-x  2 root root    4096 2009-01-27 15:52 grub
-rw-------  1 root root 3769971 2008-11-06 13:45 initrd-2.6.26.6-49.fc8.img
-rw-------  1 root root 3770567 2009-01-17 19:52 initrd-2.6.26.8-57.fc8.img
drwx------  2 root root   16384 2007-08-31 18:57 lost+found
-rw-r--r--  1 root root  934839 2008-10-17 16:10 System.map-2.6.26.6-49.fc8
-rw-r--r--  1 root root  934955 2008-12-18 19:27 System.map-2.6.26.8-57.fc8
-rw-r--r--  1 root root 2133568 2008-10-17 16:10 vmlinuz-2.6.26.6-49.fc8
-rw-r--r--  1 root root 2133920 2008-12-18 19:27 vmlinuz-2.6.26.8-57.fc8
[root@server boot]# cd grub/
[root@server grub]# ls -al
total 272
drwxr-xr-x 2 root root   4096 2009-01-27 15:52 .
drwxr-xr-x 5 root root   4096 2009-01-27 15:53 ..
-rw-r--r-- 1 root root     63 2007-08-31 19:11 device.map
-rw-r--r-- 1 root root  12000 2009-01-27 12:18 e2fs_stage1_5
-rw-r--r-- 1 root root  11872 2009-01-27 12:18 fat_stage1_5
-rw-r--r-- 1 root root  11104 2009-01-27 12:18 ffs_stage1_5
-rw------- 1 root root    766 2009-01-17 19:53 grub.conf
-rw-r--r-- 1 root root  11104 2009-01-27 12:18 iso9660_stage1_5
-rw-r--r-- 1 root root  12576 2009-01-27 12:18 jfs_stage1_5
lrwxrwxrwx 1 root root     11 2009-01-27 15:12 menu.lst -> ./grub.conf
-rw-r--r-- 1 root root  11264 2009-01-27 12:18 minix_stage1_5
-rw-r--r-- 1 root root  13600 2009-01-27 12:18 reiserfs_stage1_5
-rw-r--r-- 1 root root   7459 2007-11-14 10:00 splash.xpm.gz
-rw-r--r-- 1 root root    512 2009-01-27 12:18 stage1
-rw-r--r-- 1 root root 109212 2009-01-27 12:18 stage2
-rw-r--r-- 1 root root  11424 2009-01-27 12:18 ufs2_stage1_5
-rw-r--r-- 1 root root  10656 2009-01-27 12:18 vstafs_stage1_5
-rw-r--r-- 1 root root  13152 2009-01-27 12:18 xfs_stage1_5
[root@server grub]# cat menu.lst 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.26.8-57.fc8)
	root (hd0,0)
	kernel /vmlinuz-2.6.26.8-57.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.26.8-57.fc8.img
title Fedora (2.6.26.6-49.fc8)
	root (hd0,0)
	kernel /vmlinuz-2.6.26.6-49.fc8 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
	initrd /initrd-2.6.26.6-49.fc8.img
[root@server grub]# 
[root@server grub]# cd ..
[root@server boot]# ls
boot                    config-2.6.26.8-57.fc8  initrd-2.6.26.6-49.fc8.img  lost+found                  System.map-2.6.26.8-57.fc8  vmlinuz-2.6.26.8-57.fc8
config-2.6.26.6-49.fc8  grub                    initrd-2.6.26.8-57.fc8.img  System.map-2.6.26.6-49.fc8  vmlinuz-2.6.26.6-49.fc8
[root@server boot]# cd boot
[root@server boot]# ls -al
total 12
drwxr-xr-x 3 root root 4096 2009-01-27 12:19 .
drwxr-xr-x 5 root root 4096 2009-01-27 15:53 ..
drwxr-xr-x 2 root root 4096 2009-01-27 12:19 grub
[root@server boot]# cd grub/
[root@server grub]# ls -al
total 260
drwxr-xr-x 2 root root   4096 2009-01-27 12:19 .
drwxr-xr-x 3 root root   4096 2009-01-27 12:19 ..
-rw-r--r-- 1 root root     75 2009-01-27 12:19 device.map
-rw-r--r-- 1 root root  12000 2009-01-27 12:19 e2fs_stage1_5
-rw-r--r-- 1 root root  11872 2009-01-27 12:19 fat_stage1_5
-rw-r--r-- 1 root root  11104 2009-01-27 12:19 ffs_stage1_5
-rw-r--r-- 1 root root  11104 2009-01-27 12:19 iso9660_stage1_5
-rw-r--r-- 1 root root  12576 2009-01-27 12:19 jfs_stage1_5
-rw-r--r-- 1 root root  11264 2009-01-27 12:19 minix_stage1_5
-rw-r--r-- 1 root root  13600 2009-01-27 12:19 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 2009-01-27 12:19 stage1
-rw-r--r-- 1 root root 109212 2009-01-27 12:19 stage2
-rw-r--r-- 1 root root  11424 2009-01-27 12:19 ufs2_stage1_5
-rw-r--r-- 1 root root  10656 2009-01-27 12:19 vstafs_stage1_5
-rw-r--r-- 1 root root  13152 2009-01-27 12:19 xfs_stage1_5
[root@server grub]#

Last edited by rbhkamal; 27th January 2009 at 09:14 PM.
Reply With Quote
  #8  
Old 28th January 2009, 08:47 AM
mrechte Offline
Registered User
 
Join Date: Jul 2007
Posts: 59
Good to hear it worked.

Point 1) Your /boot/grub/grub.conf looks allright. Do you mean you have to press enter on the menu to start your kernel ?
Point 2) I am afraid you'll have to repartition from scratch. But now you know how to do it
Reply With Quote
  #9  
Old 29th January 2009, 03:14 AM
rbhkamal Offline
Registered User
 
Join Date: Jul 2007
Posts: 34
Sorry for the late reply...

No, I get the grub prompt and then I have to set the root drive/partition and load the kernel manually.

It's doesn't seem to pickup the menu.lst file....
Reply With Quote
  #10  
Old 29th January 2009, 03:45 AM
rbhkamal Offline
Registered User
 
Join Date: Jul 2007
Posts: 34
Oh... I kept searching for grub won't load menu.lst and ignored the answers... lol

I just had to follow the instructions http://www.gnu.org/software/grub/grub-faq.en.html#q11

I had to tell grub where the are images specifically:
grub> root (hd0,1)
grub> install /grub/stage1 d (hd0) /grub/stage2 p /grub/menu.lst

Thanks for your help, I've learned a lot.
Reply With Quote
  #11  
Old 30th January 2009, 09:22 AM
mrechte Offline
Registered User
 
Join Date: Jul 2007
Posts: 59
Strange you have had to specify all this. May be F10 is more clever on that subject, or I miss something, because recently I had to restore the stage1 on a F10 system and grub managed to find all the paths you mentioned (they were actually displayed) by issuing the setup command only.

Cheers
Reply With Quote
  #12  
Old 30th January 2009, 08:54 PM
rbhkamal Offline
Registered User
 
Join Date: Jul 2007
Posts: 34
Maybe it's the "d" option.
from http://www.gnu.org/software/grub/manual/grub.html
"If the option d is present, the Stage 1 will always look for the actual disk stage2_file was installed on, rather than using the booting drive."

Tonight I'll be making a switch to Intel so I have to reinstall everything. I'll trying installing grub without the d option an see if that still works.
Reply With Quote
  #13  
Old 1st February 2009, 07:38 AM
rbhkamal Offline
Registered User
 
Join Date: Jul 2007
Posts: 34
I forgot to try it....
Reply With Quote
Reply

Tags
added, broke, grub, hdd, load

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can other os be added to grub through fedora? sseipel133 Installation, Upgrades and Live Media 3 15th October 2009 12:48 PM
Interrupted preupgrade broke GRUB rgaelzer Installation, Upgrades and Live Media 1 20th August 2009 12:24 AM
Manually added fdi file to /etc/hal/fdi/policy is unable to load in Fedora 11 helloworld1 Using Fedora 0 30th June 2009 03:31 PM
grub help-- added vfat partition Wiles Using Fedora 1 19th December 2006 03:48 PM
Grub Didn't Load into MBR saberman Installation, Upgrades and Live Media 1 6th April 2006 04:03 AM


Current GMT-time: 15:57 (Friday, 25-07-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat