LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 10-13-2007, 06:05 AM   #16
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113

I apologise for not reading everybody's post but as far as Linux is concerned the OP problem appears to be due to

(1) the deletion of a previous hdc2 formatted in a fat32 partition
(2) Resize the boundary of hdc1 to absorb the space left by hdc2
(3) The partition table of the previous hdc3 and hdc4 were physically moved into positions of hdc2 and hdc3. (This could be the work of a non-Linux software because it is against the normal practice in Linux. This software is likely the culprit responsible for creating the boundary errors in the partition table.)

Consequently Ubuntu residing in previous hdc3 is now living in hdc2 and its swap position is in the wrong place too.

In order to get the Linux boots again the following must be implemented

(1) Partition reference in menu.lst must be change from (hd1,2) to (hd1,1) assuming hdc is the 2nd boot disk and sda boots first. I am assuming the by-uuid addressing is used in "root=" parameter.

(2) In the /etc/fstab the /dev/hdc3 should be changed to /dev/hdc2. Change the swap to /dev/hdc3 too. This step can be omitted if both the / and swap are identified by the by-uuid method of using a unique long string.

(3) Restore Grub again (source the root from (hd1,1))

Adjust (hd1,X) to (hd0,x) if you have told the Bios to boot hdc ahead of sda.

Get Linux sorted and then solve the Windows problem later.

Last edited by saikee; 10-13-2007 at 06:07 AM.
 
Old 10-13-2007, 06:15 AM   #17
MegaSvensk
Member
 
Registered: Sep 2007
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks for replying, but I was able to successfully boot and run Ubuntu after just changing a few lines in menu.lst.

Now, I just need Windows working again.
 
Old 10-13-2007, 06:58 AM   #18
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
You Windows boot is more complicated and it all depends on how many M$ systems you have and which one you use to multi boot the other.

Your Post #4 tells us that you have two active partitions, sda1 and hdc1 previously, but later changes show sda1 is no longer active.

You Windows therefore can only boot with sdb1 and must have the following

(1) There is a M$ boot loader inside hdc1. For XP it will be NTLDR. For Vista it should be Bootmgr.
(2) If hdc is the current first boot disk then your Windows must be installed when hdc was the first boot disk, otherwise you need to use the "map" statements to re-map the hdc back to the disk order it was originally installed.

The cure is different if your Windows was booted by a boot loader residing elsewhere. Rather for me to explain each possible combination why don't you explain your case saving us to speculate. WE also need to know the order of XP and Vista installation as the later system overwrites the boot setting of the older system, making salvage work a lot more difficult. If you install Vista later and remove it then the bootmgr will still override NTLDR making the booting very messy.

Grub always boots a M$ Windows by booting up its boot loader because Grub can't even read a ntfs partition.

Last edited by saikee; 10-13-2007 at 07:02 AM.
 
Old 10-13-2007, 07:27 AM   #19
MegaSvensk
Member
 
Registered: Sep 2007
Posts: 43

Original Poster
Rep: Reputation: 15
hdc is the first boot drive so I guess NTLDR is stored there. Vista was formatted away and XP was installed in its place but first I shrunk the partition from 45 GB to 30 GB. 15 GB is still unformatted.

Code:
Disk /dev/sda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               2        5738    46082452+   f  W95 Ext'd (LBA)
/dev/sda2            5739       36483   246959212+   7  HPFS/NTFS <- Data storage
/dev/sda5               2        3825    30716248+   7  HPFS/NTFS <- Windows XP system partition

Disk /dev/hdc: 200.0 GB, 200049647616 bytes <- First boot disk
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1   *           1       21773   174890040    7  HPFS/NTFS <- Data storage
Partition 1 does not end on cylinder boundary.
/dev/hdc2           21774       24199    19486845   83  Linux
Partition 2 does not end on cylinder boundary.
/dev/hdc3           24200       24321      979965   82  Linux swap / Solaris
Partition 3 does not end on cylinder boundary.
Man, should have used Gparted to change the partitions instead of the XP setup.

Last edited by MegaSvensk; 10-13-2007 at 07:29 AM.
 
Old 10-13-2007, 07:47 AM   #20
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Think there may be a problem here.

Can you tell us after you installed XP did you have it run successfully at all? If the answer is yes then how was it booted? by Grub or by a M$ boot loader?

The situation now is your XP is in a logical partition. AFAIK XP does not boot directly from a logical partition. It may if there is another bootable MS system in an active primary partition to house NTLDR. That to me has to be hdc1 as it is the only one marked active with a "*". Linux does not need partition marked active to boot and never uses the damn thing.

However you now confirm 175Gb hdc1 is a data storage and XP is in a 30Gb sda5 partition. (all partition number higher than 4 are logicals because the first 4 are reserved primaries).

Technically if hdc1 is a data-only partition then it would not be bootable and therefore cannot launch NTLDR from there.

This will make sense if you have installed XP but never see it working. In other word you newly installed XP was never in a working condition to start with. If you migrated XP from another partition then it will not work either.

Last edited by saikee; 10-13-2007 at 07:50 AM.
 
Old 10-13-2007, 07:53 AM   #21
MegaSvensk
Member
 
Registered: Sep 2007
Posts: 43

Original Poster
Rep: Reputation: 15
It did boot perfectly fine with the MS bootloader. I don't think it could really be a logical partition, because it was created by the Windows XP setup. Linux must be reading it wrong.

Even if I use the partition for data storage, couldn't NTLDR still be in the boot sector?

Everything I wrote about my partitions is correct AFAIK.

But now that I think about it, the XP partition is really stored within the WIN95 ext'd since that contains the 30 GB XP partition and the remaining 15 GB of unformatted space.

Edit:
Actually, when I installed XP, I saw two unformatted partitions. One was 8 MB and the other was 15 GB. Do you think those could be sda3 and sda4?

Last edited by MegaSvensk; 10-13-2007 at 08:06 AM.
 
Old 10-13-2007, 08:16 AM   #22
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
sda1 is an extended partition, meaning it is just a border defining the beginning and finishing cylinders of the logical partitions.

sda1 starts with cylinder 2 and finishes at cylinder 5738 and has a size of 45Gb.

Inside sda1 the first logical partition sda5 occupies the boundary from cylinder 2 to 3825 and a size of 30Gb.

There is an empty space after the 3825th cylinder because the next one used is 5739 of sda2. This tells me you created sda2 after sda5. The remaining 15Gb after sda5 is still usable for creation of sda6 to sda15.

Thus I don't think your XP boots from sda1 because an extended partition has no storage of its own. It is just a border!

NTLDR is always visible as a file and never in the boot sector.

If your information is correct then your XP should have been booted from hdc1 which has originally a bootable NT operating system inside. Chances are the NTLDR would be there. You should use Linux to munt this partition and see it for yourself.

If this is the case your Windows should boot if before selecting a system to boot you press the "c" key at the Grub boot screen and drop into a Grub prompt. XP should fire up by terminal Grub commands
Code:
root (hd0,0)
chainloader +1
boot
When you boot a XP or a Vista you always boot to the partition that stores its boot loader. It is the duty of M$ boot loader to find its master and none of the business of Grub.

The above is to boot XP "manually". If it works you can then add to the menu.lst of the Linux all the manual commands except adding at the begining a "title" line like
Code:
title dude said boot hdc1 and it will find XP in sda5"
For booting with menu.lst the last "boot" statement is optional and can be removed. I never use it but it does no hard to leave it there.

Last edited by saikee; 10-13-2007 at 08:24 AM.
 
Old 10-13-2007, 09:33 AM   #23
MegaSvensk
Member
 
Registered: Sep 2007
Posts: 43

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by saikee View Post
Inside sda1 the first logical partition sda5 occupies the boundary from cylinder 2 to 3825 and a size of 30Gb.

There is an empty space after the 3825th cylinder because the next one used is 5739 of sda2. This tells me you created sda2 after sda5. The remaining 15Gb after sda5 is still usable for creation of sda6 to sda15.
No, sda2 has been there unchanged for at least two years

Quote:
Originally Posted by saikee View Post
Thus I don't think your XP boots from sda1 because an extended partition has no storage of its own. It is just a border!

NTLDR is always visible as a file and never in the boot sector.

If your information is correct then your XP should have been booted from hdc1 which has originally a bootable NT operating system inside. Chances are the NTLDR would be there. You should use Linux to munt this partition and see it for yourself.
Will do as soon as I get home. I think it boots from there too seeing as it is the first disk in the boot order.

Quote:
Originally Posted by saikee View Post
If this is the case your Windows should boot if before selecting a system to boot you press the "c" key at the Grub boot screen and drop into a Grub prompt. XP should fire up by terminal Grub commands
Code:
root (hd0,0)
chainloader +1
boot
When you boot a XP or a Vista you always boot to the partition that stores its boot loader. It is the duty of M$ boot loader to find its master and none of the business of Grub.

The above is to boot XP "manually". If it works you can then add to the menu.lst of the Linux all the manual commands except adding at the begining a "title" line like
Code:
title dude said boot hdc1 and it will find XP in sda5"
For booting with menu.lst the last "boot" statement is optional and can be removed. I never use it but it does no hard to leave it there.
I'll try doing that.

Thank you very much for your help.

Last edited by MegaSvensk; 10-13-2007 at 09:34 AM.
 
Old 10-13-2007, 09:49 AM   #24
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Quote:
No, sda2 has been there unchanged for at least two years]No, sda2 has been there unchanged for at least two years
You are right. The recent change of sda5 took place wholly inside sda1 and does not affect the boundary of sda2 set up two years ago.
 
Old 10-13-2007, 12:00 PM   #25
MegaSvensk
Member
 
Registered: Sep 2007
Posts: 43

Original Poster
Rep: Reputation: 15
I checked and I have two NTLDR, one NTLDR and one ntldr (lower case). ntldr was last modified on August 4, 2007 at 02:59 AM and NTLDR was last modified on August 4 at 00:59 AM. Both are the exact same size. Should I delete one of them?

Edit:
Never mind, one of them (the upper case one) was in a copy of the disk contents I made for VMware.

Last edited by MegaSvensk; 10-13-2007 at 12:03 PM.
 
Old 10-13-2007, 12:30 PM   #26
MegaSvensk
Member
 
Registered: Sep 2007
Posts: 43

Original Poster
Rep: Reputation: 15
I tried what you suggested with the command line and it worked. Then I added it to menu.lst and that worked too.

Thanks so very much much to everyone who has helped me in this thread. Without your assistance, I'd probably still be looking at those error messages.
 
Old 10-13-2007, 04:14 PM   #27
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Yes everybody has done his/her bit to assist you.

We make a good team, which means they do the donkey work and I just appear in the photo finish. So I have to thank everybody too.

I jumped into the thread because I thought I could explain why things went wrong after seeing your partition table in Post #4.

Last edited by saikee; 10-13-2007 at 04:18 PM.
 
Old 10-13-2007, 05:12 PM   #28
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
Way to go saikee!

I made a note to check this again today and come back to find you've aced it.

Moral: you gotta be very careful when repartitioning. And use the open source tools - they're tidier and you have a better chance to figure what happened.
 
  


Reply



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
reinstalled windows in dual boot,,,grub disappeared,,,help ace.adi Linux - Newbie 3 03-18-2007 11:46 AM
Newbie: Reinstalled windows, can't boot Fedora raheelm Linux - Software 2 05-23-2006 06:07 AM
just won't boot from te right disk since win reinstalled :confused: torsten.t.h Linux - Software 6 05-23-2006 06:05 AM
Windows 2003 server & Fedora / GRUB wont boot win UrbanDEV Linux - Newbie 6 04-28-2004 09:34 AM
Reinstalled Windows 98 lost linux dual boot llefty Linux - Newbie 0 08-01-2003 12:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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