LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-27-2009, 07:26 AM   #1
arielCo
LQ Newbie
 
Registered: Apr 2009
Location: Caracas
Distribution: [K]ubuntu
Posts: 11

Rep: Reputation: 0
Question grub 0.97 on sda2 (NTFS) fails silently on "Loading stage2"


Well, the title pretty much sums it up. Expanding, I picked sda2 at the Kubuntu 9.04 installer to place GRUB because my Dell notebook uses a "special" MBR . The menu shows up, and selecting the Windows entry:
Code:
title           Microsoft Windows XP Professional
rootnoverify    (hd0,1)
savedefault
chainloader     +1
makeactive
falls right back to the menu after printing "Loading stage2". I ran the script at http://sourceforge.net/projects/bootinfoscript (output at the end) and everything seems fine:
Code:
Grub0.97 is installed in the boot sector of sda2 and
looks at sector 23828642 of the same hard drive for
the stage2 file. A stage2 file is at this location on
/dev/sda. Stage2 looks on partition #6 for
/boot/grub/menu.lst.
I also tried inserting
Code:
rootnoverify    (hd0,1)
map (hd0,1) (hd0,0)
map (hd0,0) (hd0,1)
chainloader     +1
makeactive
and the outcome was identical.
Help/enlightenment will be appreciated and duly available to others

Output of boot_info_script032.sh, minus some comments:
Code:
============================= Boot Info Summary: ==============================

 => Windows is installed in the MBR of /dev/sda

sda1: _________________________________________________________________________

    File system:       vfat
    Boot sector type:  Dell Utility: Fat16
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files/dirs:   

sda2: _________________________________________________________________________

    File system:       
    Boot sector type:  Grub
    Boot sector info:  Grub0.97 is installed in the boot sector of sda2 and 
                       looks at sector 23828642 of the same hard drive for 
                       the stage2 file. A stage2 file is at this location on 
                       /dev/sda. Stage2 looks on partition #6 for 
                       /boot/grub/menu.lst.
    Mounting failed:
mount: unknown filesystem type ''

sda3: _________________________________________________________________________

    File system:       vfat
    Boot sector type:  Fat32
    Boot sector info:  According to the info in the boot sector, sda3 starts 
                       at sector 63. But according to the info from fdisk, 
                       sda3 starts at sector 19037025.
    Operating System:  
    Boot files/dirs:   

sda4: _________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:  

sda5: _________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows Vista
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files/dirs:   /bootmgr /Boot/BCD

sda6: _________________________________________________________________________

    File system:       ext3
    Boot sector type:  -
    Boot sector info:  
    Operating System:  Ubuntu 9.04
    Boot files/dirs:   /boot/grub/menu.lst /etc/fstab

sda7: _________________________________________________________________________

    File system:       ext2
    Boot sector type:  Unknown
    Boot sector info:  
    Operating System:  
    Boot files/dirs:   

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ _____________________________________________________

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xe8000000

Partition  Boot         Start           End          Size  Id System

/dev/sda1                  63       160,649       160,587  de Dell Utility
/dev/sda2    *        160,650    19,037,024    18,876,375   7 HPFS/NTFS
/dev/sda3          19,037,025    21,134,177     2,097,153   b W95 FAT32
/dev/sda4          21,141,540   156,296,384   135,154,845   5 Extended
/dev/sda5          38,959,969   156,296,384   117,336,416   7 HPFS/NTFS
/dev/sda6          21,141,666    37,945,529    16,803,864  83 Linux
/dev/sda7          37,945,593    38,957,624     1,012,032  83 Linux


blkid -c /dev/null: ____________________________________________________________

/dev/sda1: SEC_TYPE="msdos" LABEL="DellUtility" UUID="07D7-0B02" TYPE="vfat" 
/dev/sda3: LABEL="SWAP" UUID="49DF-7A6D" TYPE="vfat" 
/dev/sda5: UUID="7A52A45152A413C3" LABEL="Stuff" TYPE="ntfs" 
/dev/sda6: UUID="11ba4d32-ffdf-4152-909a-6d00fac103fe" TYPE="ext3" 
/dev/sda7: UUID="5a8ff04e-e5ef-496b-a911-e6cf2852a9f9" TYPE="ext2" 
/dev/mmcblk0p1: SEC_TYPE="msdos" UUID="FC30-3DA9" TYPE="vfat" 

=============================== "mount" output: ===============================

/dev/sda6 on / type ext3 (rw,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
lrm on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=755)
/dev/sda7 on /var type ext2 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw)
/dev/sda5 on /media/Stuff type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda3 on /media/SWAP type vfat (rw,nosuid,nodev,uhelper=hal,uid=1000)


=========================== sda6/boot/grub/menu.lst: ===========================

default		0

timeout		10

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST

title		Ubuntu 9.04, kernel 2.6.28-11-generic
uuid		11ba4d32-ffdf-4152-909a-6d00fac103fe
kernel		/boot/vmlinuz-2.6.28-11-generic root=UUID=11ba4d32-ffdf-4152-909a-6d00fac103fe ro quiet splash 
initrd		/boot/initrd.img-2.6.28-11-generic
quiet

title		Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid		11ba4d32-ffdf-4152-909a-6d00fac103fe
kernel		/boot/vmlinuz-2.6.28-11-generic root=UUID=11ba4d32-ffdf-4152-909a-6d00fac103fe ro  single
initrd		/boot/initrd.img-2.6.28-11-generic

title		Ubuntu 9.04, memtest86+
uuid		11ba4d32-ffdf-4152-909a-6d00fac103fe
kernel		/boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title		Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title		Microsoft Windows XP Professional
rootnoverify	(hd0,1)
savedefault
chainloader	+1
makeactive

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda5
title		Windows Vista (loader)
rootnoverify	(hd0,4)
savedefault
chainloader	+1


=============================== sda6/etc/fstab: ===============================

# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda6 during installation
UUID=11ba4d32-ffdf-4152-909a-6d00fac103fe /               ext3    relatime,errors=remount-ro 0       1
# /var was on /dev/sda7 during installation
UUID=5a8ff04e-e5ef-496b-a911-e6cf2852a9f9 /var            ext2    relatime        0       2
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0

=================== sda6: Location of files loaded by Grub: ===================


  12.1GB: boot/grub/menu.lst
  12.2GB: boot/grub/stage2
  12.2GB: boot/initrd.img-2.6.28-11-generic
  12.2GB: boot/vmlinuz-2.6.28-11-generic
  12.2GB: initrd.img
  12.2GB: vmlinuz
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader  on sda7

00000000  6c 5e 35 78 66 f1 22 6a  5d 11 c8 ee c9 74 d8 c3  |l^5xf."j]....t..|
00000010  99 f0 c8 08 74 de 8f 4c  49 11 4c 1f cf 58 8d f9  |....t..LI.L..X..|
00000020  5c ce 13 ab fe 39 25 56  12 29 59 63 24 c4 e1 23  |\....9%V.)Yc$..#|
00000030  c3 7d be f3 1f 1c a3 81  15 64 0a 89 ff d1 51 69  |.}.......d....Qi|
00000040  44 52 2f d5 97 63 53 e1  a4 34 3c 2b 78 55 a3 84  |DR/..cS..4<+xU..|
00000050  d6 f8 1d 9a 48 d7 51 6a  5f 66 17 13 81 67 82 19  |....H.Qj_f...g..|
00000060  23 96 98 9b a6 af c9 50  a3 a8 0d 37 0f 99 68 33  |#......P...7..h3|
00000070  2c d9 a9 b1 db 93 6d 1b  ec 1a 6d b5 5e 2f b6 99  |,.....m...m.^/..|
00000080  be c3 5a b3 b4 98 c2 c4  37 96 61 68 98 b4 b4 df  |..Z.....7.ah....|
00000090  9f 5e 1c 15 c2 6e 3c 33  28 93 4b ef fa 6d 92 51  |.^...n<3(.K..m.Q|
000000a0  b4 e4 38 0c 66 62 6a 41  6b c7 2f 26 c5 04 63 ac  |..8.fbjAk./&..c.|
000000b0  94 8c b3 8e c2 3a 43 a6  4b 0e 7e ab 37 26 8d c8  |.....:C.K.~.7&..|
000000c0  f1 4e ed 14 29 73 52 5f  62 dd 59 b6 9a 6c 7d cb  |.N..)sR_b.Y..l}.|
000000d0  4c 3b 90 75 1c ae 07 d3  20 af 8d 58 82 a8 cd 56  |L;.u.... ..X...V|
000000e0  6a 41 ac 5f d4 f8 0e 08  6f 4d de b4 39 f4 65 a1  |jA._....oM..9.e.|
000000f0  ad bb b6 39 32 11 1e 46  6f 64 a1 4a 3f fa 48 e1  |...92..Fod.J?.H.|
00000100  67 a9 6d 59 c7 4d 25 75  df 58 4c b2 69 98 bb 87  |g.mY.M%u.XL.i...|
00000110  65 31 ef 91 8f 8e 97 73  53 44 a4 a9 c7 77 20 7a  |e1.....sSD...w z|
00000120  f1 f3 09 2a 08 33 19 69  cb ce 60 21 3b f6 f3 22  |...*.3.i..`!;.."|
00000130  8b 47 17 78 77 99 56 07  13 b0 9c 4c 64 cc 1b 3b  |.G.xw.V....Ld..;|
00000140  ba b2 92 a9 49 da 99 4a  2d a7 82 21 cc 18 2d 53  |....I..J-..!..-S|
00000150  2a ba 2b 8f dc a6 3a 42  63 55 f6 de f3 52 29 ea  |*.+...:BcU...R).|
00000160  cb ef 43 a4 f3 88 e4 b0  3a 6f a4 66 47 10 73 eb  |..C.....:o.fG.s.|
00000170  2e 14 06 a3 ed ed 22 1b  17 21 a5 2f 07 5d 64 76  |......"..!./.]dv|
00000180  6e 5a 85 ff cb c5 1a c2  f9 b0 40 50 f6 99 7a ad  |nZ........@P..z.|
00000190  71 4b c6 aa 9f 9d 32 ad  46 e0 97 09 a4 7b b6 2a  |qK....2.F....{.*|
000001a0  fa 18 8f f6 f5 35 da 35  d7 2c 45 9b c2 89 8d c8  |.....5.5.,E.....|
000001b0  32 ed dc f0 66 99 98 58  4b 55 37 c3 58 9a 19 4a  |2...f..XKU7.X..J|
000001c0  dd 78 56 a1 9b 83 f7 b2  9a 26 e5 a9 d9 ec d5 82  |.xV......&......|
000001d0  6a 96 92 d6 20 15 19 34  11 39 c7 84 72 4b 16 53  |j... ..4.9..rK.S|
000001e0  a3 61 e0 cc 09 33 f6 1e  df 03 b3 66 17 af a4 22  |.a...3.....f..."|
000001f0  ff a3 37 96 94 44 1e 96  b7 01 63 54 75 1f 89 49  |..7..D....cTu..I|
00000200
 
Old 04-28-2009, 08:46 PM   #2
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
I wasn't aware that there was a "special" MBR on Dells. I think it may be that the first partition, sda1, (the fat16 one) is a "special partition" (your diagnostic partition?). I could be wrong.

I think you could have installed Grub on your Ubuntu partition and made that one the active partition. So you would have had a Microsoft bootloader, loading Grub from sda6, which could then chainload to the Microsoft NTLOADER bootstrap on sda2.

But installing it to the MBR would have been better.

What you have now is the Microsoft MBR bootloader; passing control to the active partition, sda2, containing the Grub loader; which gives you your menu. When you select the Windows entry, Grub dutifully chainloads back to sda2, itself, and redisplays the menu. Your NTLOADER was there originally which would have booted Windows, but it was wiped out when you did the Grub install, so there is no way to get there anymore.

To recover, I think you first need to repair your Windows system. I don't know Vista, but XP has its "Recovery Console".
If you Google "windows mbr recovery", the first hit will bring you to "support.microsoft.com/kb/314058". You need to get into Recovery Console, and "Repair the file system boot sector or the master boot record (MBR)" (actually both). You'll need to do 'bootcfg' and 'fixmbr', I think. It's been a long time since I've done this.

Then you need to get into Ubuntu (I don't know how, I'm Fedora and Slackware) and then do a 'grub-install'. (Fedora has a rescue mode.) You can probably repost another question on this topic to the Ubuntu folks if you are not familiar with how to do this.



If you want, you can copy the original Microsoft MBR loader code with the dd command 'dd if=/dev/sda of=somename count=1 bs=446'.

In the event you want to restore it back to the beginning of the MBR you can 'dd if=somename of=/dev/sda count=1 bs=446'. (But that really shouldn't ever be necessary... )



Then just for grins if you're curious, you can look at the MBR (1st sector of the disk) with 'dd if=/dev/sda count=1 bs=512 | hexdump -C'.
There's 446 bytes of loader code (at offset 0), 64 bytes of partition table (at offset 1be), and signature '55aa' (at offset 1fe).

Be careful. Good luck. YMMV, but it shouldn't.
 
Old 04-28-2009, 09:57 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by arielCo View Post
I picked sda2 at the Kubuntu 9.04 installer to place GRUB]
That was a (serious) mistake. You over-wrote the Vista boot sector record.
Plus a few more sectors as well - hence the non-bootable partition. As the script indicates, it's likely this (NTFS presumably) filesystem has been corrupted and can't even be mounted from bash.
You should have chosen sda6 for the grub install.

You may be able to recover this from the Vista CD/DVD -search the microsoft site for bootrec.exe and recovery.
You'll also need to install grub to sda6, and use something like EasyBCD to allow it to be selected from the Vista boot menu.
 
Old 04-29-2009, 07:24 AM   #4
arielCo
LQ Newbie
 
Registered: Apr 2009
Location: Caracas
Distribution: [K]ubuntu
Posts: 11

Original Poster
Rep: Reputation: 0
Cool right on!

Quote:
Originally Posted by tommylovell
When you select the Windows entry, Grub dutifully chainloads back to sda2, itself, and redisplays the menu.
Yup, I figured it out late on the next day and felt a bit silly after confirming it ; perhaps the Kubuntu installer should advise on good/bad choices. I reinstalled grub to sda3 (my swap/pagefile partition), since I couldn't care less if it got corrupted.

And oh yes, I had backed up the MBR precisely with dd bs=1 count=446, but alas, I wasn't sure if the VBR backups I had were up to date.

Quote:
Originally Posted by syg00
As the script indicates, it's likely this (NTFS presumably) filesystem has been corrupted and can't even be mounted from bash.
Right too, so I figure the boot record contains more than just boot code and grub overwrote the BPB or whatever it's called in NTFS. I fixed it with the Recovery Console. Again, methinks the distro installer should warn about installing to any NTFS partition. I'm switching over to regular GNOME Ubuntu tomorrow and see if the installer does warn me.

A tip, to whom it may help: to write a new VBR (bootrecord) to an XP partition, use the Recovery Console from the CD, use "diskpart" to find out what letter it assigned provisionally to the partition, and then use "fixboot X:". To repair the MBR, in older versions of Windows it was FDISK /MBR, now it's "FIXMBR \Device\HardDiskX". There's a lot more at http://www.michaelstevenstech.com/r_c_cmds.htm, better explained than at MS's page.

Thanks a lot to both of you; I wasn't 100% sure about what I had done wrong.

Last edited by arielCo; 04-29-2009 at 07:25 AM.
 
  


Reply

Tags
grub, ntfs



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
Grub Loading stage2.... (hang) zdenisl Linux - Software 8 02-23-2011 03:24 AM
GRUB Loading Stage2... unicornsoftsol Linux - Newbie 1 06-30-2008 03:19 AM
GRUB Loading stage2 problem SBN Linux - Distributions 3 06-26-2007 08:18 AM
Stuck on grub (loading stage2) Crazy_lenny Linux - Hardware 3 06-23-2006 12:13 PM
GRUB Loading stage2.read error?? angstsix Linux - General 2 12-12-2005 10:00 AM

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

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