LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-06-2008, 08:56 AM   #1
kingleo
LQ Newbie
 
Registered: May 2005
Location: Thessaloniki, Greece
Distribution: Mandrake v9.0
Posts: 10

Rep: Reputation: 0
MBR problem (no XP load) after Ubuntu 7.1 install


Hi all. I didnt find any good by reading many posts with GRUB problems, so I make this post. If any expert can help, plz do.

I have 2 HardDisks.
HD1 had 2 partitions:
a.ntfs with XP(EDIT:primary,'C:'),
b.ntfs (EDIT:secondary, no OS,'D:').
HD2 had 1 partition ntfs (logical, no OS,'E:').

I decided to install Ubuntu 7.10 on D. So, from the partition tool of the liveCD I kept the windows partition as it was (I noticed that it wrote that the EDIT:device was /dev/sda5, quite weird,no?) and 'broke' the second partition: one for ext3 and one for swap (I think the EDIT:devices were /dev/sda3,/dev/sda2 respectively), leaving the second hard disk with no change.
So,I should have:
HD1 a.ntfs with XP ('C:')
b.ext3 with linux
c.swap partition
HD2 ntfs no OS ('E:')

The state now is:
A. When I select to boot XP from the grub menu, it says 'Error 12: Invalid device requested'
B. Ubuntu runs perfect.
C. I can see both HD1,HD2 and their contents from Ubuntu.
D. I managed to run a couple of XP programs with WINE (eg.WinAce)
E. I tried with XP Installation Recovery (fixmbr & fixboot) with no good.
F. I booted from XP startup disk, but when I entered C:,D: or E:, it answered they were invalid disks. I tried K: and it answered there was not such device.

Here are some results:

Code:
sudo fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa5c9a5c9

Device Boot Start End Blocks Id System
/dev/sda1 2 12142 97522582+ f W95 Ext'd (LBA)
/dev/sda2 * 12143 14452 18554687+ 83 Linux
/dev/sda3 14453 14593 1132582+ 82 Linux swap / Solaris
/dev/sda5 2 12142 97522551 7 HPFS/NTFS

Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x5f4a066f

Device Boot Start End Blocks Id System
/dev/sdb1 1 38913 312568641 7 HPFS/NTFS
/dev/sdb4 * 1 1 0 0 Empty
Partition 4 does not end on cylinder boundary.

Last edited by kingleo; 05-06-2008 at 10:14 AM.
 
Old 05-06-2008, 09:25 AM   #2
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

Rep: Reputation: Disabled
You are confusing drive letters as Windows assigns them with physical drives as Linux sees them.
How you managed to squeeze XP to a logical partition is beyond me, the problem is Windows will boot only from primary partitions, sda1-sda4 that is.
 
Old 05-06-2008, 09:28 AM   #3
Nsipid
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
Notice that sda1 and sda5 start at the same block. Also, /dev/sda1 is W95 extended partition, I take it that you did not put it there? Can you mount /dev/sda5 somewhere in linux?
 
Old 05-06-2008, 09:30 AM   #4
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

Rep: Reputation: Disabled
Edit: Wrong idea.

Last edited by Emerson; 05-06-2008 at 09:32 AM.
 
Old 05-06-2008, 09:49 AM   #5
kingleo
LQ Newbie
 
Registered: May 2005
Location: Thessaloniki, Greece
Distribution: Mandrake v9.0
Posts: 10

Original Poster
Rep: Reputation: 0
Emerson probably you are correct on how I refer to the partitions (logical etc) as I'm noob to linux.
Look on sda1:

Code:
ncc@UbUntU:~$ ls /media/sda1
ATI                     MSDOS.SYS
AUTOEXEC.BAT            MSOCache
Bridge Base Online      OEMSettings
CONFIG.SYS              ppmaterecord
Documents and Settings  Program Files
DVDVolume               RECYCLER
FLEXLM                  Shockwave
Games                   System Volume Information
inATESLogs              Temp
IO.SYS                  WINDOWS

Last edited by kingleo; 05-06-2008 at 09:52 AM.
 
Old 05-06-2008, 10:30 AM   #6
kingleo
LQ Newbie
 
Registered: May 2005
Location: Thessaloniki, Greece
Distribution: Mandrake v9.0
Posts: 10

Original Poster
Rep: Reputation: 0
The following is the Partition table as it is shown when installing from liveCD:

Code:
Device    Type  Mountpoint
/dev/sda
/dev/sda5 ntfs /media/sda5
/dev/sda2 ext3 /media/sda2
/dev/sda3 swap
/dev/sdb
/dev/sdb1 ntfs /media/sdb1
 
Old 05-06-2008, 10:37 AM   #7
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

Rep: Reputation: Disabled
/dev/sda1 2 12142 97522582+ f W95 Ext'd (LBA)
/dev/sda2 * 12143 14452 18554687+ 83 Linux
/dev/sda3 14453 14593 1132582+ 82 Linux swap / Solaris
/dev/sda5 2 12142 97522551 7 HPFS/NTFS

Frankly, I do not understand this layout.
0. No partition starts from the beginning of the disk?
1. sda1 is extended, followed by two primary partitions, and then logical one.
2. Still, sda1 shows some Windows installation ...

How did you create this layout? I even do not know what to recommend. Boot up with LiveCD and use GParted to put these partitions in sensible order maybe? Maybe parted can't fix this mess. Maybe copying with dd or partimage to another disk, creating a normal partition order and copying partitions back will work.
 
Old 05-06-2008, 02:03 PM   #8
kingleo
LQ Newbie
 
Registered: May 2005
Location: Thessaloniki, Greece
Distribution: Mandrake v9.0
Posts: 10

Original Poster
Rep: Reputation: 0
I need to thank you for keeping on trying with me.
Gparted did really nothing, but giving some information:
Inside /dev/sda1 (extended) exists the /dev/sda5 (ntfs,lba).
The /dev/sda3 and /dev/sda2 are alone. 'Out' of /dev/sda1.

Does this help in any way or give any answer to the mess?
 
Old 05-06-2008, 04:28 PM   #9
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

Rep: Reputation: Disabled
As I said, all this seems very strange to me. Since sda1 shows some Windows installation, I'd try booting Windows from hd0,0 in GRUB.
 
Old 05-06-2008, 05:43 PM   #10
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
Do you have backups?

hey kingleo,

first and foremost, do you have backups of your data and a windows install cd? if so, my advice would be setting up a whole new system because your partition table is out of control...

the windows default setup with a c:\ and a d:\ drive is to have only one primary partition with two logical ones, i.e. c:\ and d:\. so this might explain why your windows partition is a "logical" one. unfortunately this doesn't help a bit.

since you didn't touch your second hdd we can leave the sdb aside. there must be gaps on your first hd. did you remove any partitions? i think the problem is that /dev/sda5--your windows partition--is neither bootable nor the first partition on your first hdd. i woudn't recommend using a partition tool under linux. kill all...reinstall MAKE SURE YOU HAVE BACKUPS please...

good luck, vadkutya
 
Old 05-06-2008, 08:43 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,848

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
First thing you should do is report this as a (installer) bug - go to ubuntu.com and check if it is a known problem.
I *never* trust the partitioners on install disks - especially the GUI based ones. I always do the partitioning by hand ahead of the install.
This is seriously lame.

Looking at that layout, I'd say all your data is (hopefully) o.k. - getting to it might be difficult. If it were me, I'd image the complete disk to another disk (for backup), then using [c]fdisk delete sda5, and change the type of sda1 to x'07'.
I suspect this would resolve your problem(s) - deleting sda5 will only delete the partition definition, not the data.
Hopefully.
After all that, next take the boot flag off sda2, and set it for sda1. This should now allow fixmbr to work, should you need to do that again.

If it all goes bad, I just restore the image, and try something else.

Good learning exercise if you want to experiment, but the best answer is to use your backups, and restore everything.
 
Old 05-06-2008, 10:10 PM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
As Emerson said, it won't work from a logical partition because windows can't be booted from a logical partition unless you have another windows OS on a primary. You don't!

You have most of your data on sdb1 so make sure you do this install on sda. I would recommend a little reading to make sure you understand the drive nameing conventions of Linux and also Grub which are quite different from windows.

What exactly do you have at the beginning of your sda (first drive)?
Also, if you think you might be installing other systems there really is no point in using a primary partition for swap.

You will need to re-install xp on a primary partition (sda4 would be your option) unless you start all over with your first drive. If your xp and Ubuntu are both recent installs, you would be best off to start all over with a more sensible partitioning schems.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 6.10 install screen wont load from boot cd. Tiepo Ubuntu 4 03-23-2007 04:43 AM
Installed FC5> Wrote over Ubuntu MBR: How do i add Ubuntu Partition to Grub Loader Free_beer Ubuntu 4 10-02-2006 07:11 PM
X.Org failed to load after Ubuntu 10.5 install habiblove Ubuntu 3 02-19-2006 05:25 PM
[SOLVED] Ubuntu Install Corrupted MBR? thund3rstruck Linux - Newbie 4 11-30-2005 10:55 AM
lilo MBR install problem nobu Slackware - Installation 5 04-04-2004 08:33 PM


All times are GMT -5. The time now is 04:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration