LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   MBR problem (no XP load) after Ubuntu 7.1 install (https://www.linuxquestions.org/questions/linux-newbie-8/mbr-problem-no-xp-load-after-ubuntu-7-1-install-640268/)

kingleo 05-06-2008 07:56 AM

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.


Emerson 05-06-2008 08:25 AM

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.

Nsipid 05-06-2008 08:28 AM

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?

Emerson 05-06-2008 08:30 AM

Edit: Wrong idea.

kingleo 05-06-2008 08:49 AM

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


kingleo 05-06-2008 09:30 AM

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


Emerson 05-06-2008 09:37 AM

/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. :confused:
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.

kingleo 05-06-2008 01:03 PM

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?

Emerson 05-06-2008 03:28 PM

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.

vadkutya 05-06-2008 04:43 PM

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

syg00 05-06-2008 07:43 PM

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.

yancek 05-06-2008 09:10 PM

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.


All times are GMT -5. The time now is 12:45 AM.