LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 12-01-2005, 08:34 PM   #1
scottybwoy
LQ Newbie
 
Registered: Nov 2005
Location: Birmingham, UK
Distribution: Kubuntu 10.04 x64
Posts: 25

Rep: Reputation: 15
Angry windows ate my debian install


I've just installed WinXp on the first partition on my drive which is set up so forth :

hda1 25Gb NTFS Win XP
hda2 5Gb FaiserFs Debian /
hda3 0.3Gb swap swap
hda4 10Gb Fat32 /home

I had Debian installed first but have some programs that I need to use in windows and had allowed for it with an empty partition, however It seems to have wiped everything as far as Linux is concerned.

The funny thing is that Windows can see it fine well nearly fine, It reads the ntfs and fat32 FS and acknowledges the / and swap just doesn't know what they are, which is to be expected.

I have told the Windows NTLDR to recognise Linux @ boot and does so no problem. It askes wheter I'd like to boot windows or linux, and on choosing Linux says there is no linux boot and to insert a valid boot disk.

I was planning to update my kernel from 2.4.27 to 2.6.8 for the added ntfs support and came across Deb Sarge 3.1 which could boot from floppy d/l packages of the net and thaught that would do the trick, but when it gets to the partitioning section reads only 1 42Gb Empty partition Whereas Windows still reads it correctly as above.

I'm perplexed and would like to know How I can get linux to put it specs on my true partition table.

Thanks in advance.
 
Old 12-02-2005, 08:28 AM   #2
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
My guess the consequence is totally normal.

XP when installed always writes on the MBR and so Debian's boot loader was partially overwritten.

XP does not support Linux and wouldn't mount its partition and there should be no way you can read Linux via XP, except by specialist software.

NTLDR can boot Linux but requires you to have Debian's MBR ready in a floppy so that it can be copied into the "C" drive of XP. That is how NTLDR works. You obviously haven't prepared Debian's first 512 bytes of the boot loader.

XP Installation does not wipe Linux. It never does so please donot make such a claim. Your hda2 and hda3 are still safe. You just didn't know how to access them.

Have XP wiped clean and formatted everything on the disk you wouldn't have been able to read you hda4 FAT partition, right?
-----------------------------------
Now the cure
Just pick up any Linux Live CD, boot it up, make a temporary directory called /mnt/temp, mount the device partition hda2 on it, replicate Debian's Grub boot loader into the MBR again and make ajustment to Grub to boot both systems.

After booting to a Live CD, type

mkdir /mnt/temp
mount /dev/hda2 /mnt/temp
chroot /mnt/temp
grub-install /dev/hda

now you are inside Debian, using a text editor to add these lines to boot XP in Debian's /boot/grub/menu.lst

title My XP in hda1
root (hd0,0)
chainloader +1

save the file, exit back to the Live CD and reboot. Remember Grub counts from 0 so the first partition of your disk is known as hda1 in Linux but (hd0,0) in Grub.

Both Debian and XP should be bootable.

------------------------

If your Debian uses Lilo, the above procedure still applies except instead of doing a grub-install you type

lilo -b /dev/hda

The additions in /etc/lilo.conf to boot XP are

other=/dev/hda1
label=xp

Last edited by saikee; 12-02-2005 at 04:07 PM.
 
Old 12-02-2005, 02:47 PM   #3
acker
Member
 
Registered: Apr 2004
Location: Timisoara, Romania
Distribution: Debian
Posts: 90

Rep: Reputation: 15
Quote:
Originally posted by saikee
XP Installation does not wipe Linux. It never does so please donot make such a claim. Your hda2 and hda3 are still safe. You just didn't know how to access them.
XP ate half of my harddisk one morning... I guess because I haven't took it for a walk for about two years....

Quote:
Just pick up any Linux Live CD, boot it up, make a temporary directory called /mnt/temp, mount the device partition hda2 on it, replicate Debian's Grub boot loader into the MBR again and make ajustment to Grub to boot both systems.
[...]
Both Debian and XP should be bootable.
No, I think they will not be bootable. Why? You haven't explained how to "replicate" grub in MBR... I am using LILO so I'll let someone else to talk about grub-install and stuff like that.

Greetings,
ack
 
Old 12-02-2005, 04:08 PM   #4
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
OK smart guy, I amended the text to put procedures for both Grub and Lilo. Happy now?
 
Old 12-02-2005, 04:36 PM   #5
acker
Member
 
Registered: Apr 2004
Location: Timisoara, Romania
Distribution: Debian
Posts: 90

Rep: Reputation: 15
Quote:
Originally posted by saikee
OK smart guy, I amended the text to put procedures for both Grub and Lilo. Happy now?
First part was a fvcking joke. Absolutely no disregard intended.

"No, I think they will not be bootable. Why? You haven't explained how to "replicate" grub in MBR..."

Just said my opinion why I thought it won't work. I quoted "replicate" because I don't think is the right term.

"I am using LILO so I'll let someone else to talk about grub-install and stuff like that."
I shouldn't try to advise him wrong, right? I really haven't used grub in a while and I don't know the procedures to re-install the MBR.

And now I'm wodering why I even wrote the reply.
 
Old 12-02-2005, 07:03 PM   #6
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 do take the booting matter rather lightly, as I boot all the 70+ systems using one Grub in an empty partition of its own. I would have used Lilo but it stops at 15 systems.
 
Old 12-08-2005, 02:21 PM   #7
scottybwoy
LQ Newbie
 
Registered: Nov 2005
Location: Birmingham, UK
Distribution: Kubuntu 10.04 x64
Posts: 25

Original Poster
Rep: Reputation: 15
sorry I didn't reply for so long that a mini bout of lilo vs grub ensued, however I do use grub thanx to both of you trying to help me out, however saikee's original post was enough to solve my query. the partition loss was 'almost' real, i did have to delete the reiserFs and swap for it to be seen in the Deb install, was just lucky I was planning to do so anyway. Does anyone know if linux can be loaded from ntldr though, not really necessary just looks a little cleaner.

Cheers
 
Old 12-08-2005, 03:26 PM   #8
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
Have a look at #23 of this thread if you go NTLDR way.

It takes 10 times the effort as Grub to do the configuration, so be prepared to get sick.
 
Old 12-09-2005, 08:57 AM   #9
michapma
Member
 
Registered: Oct 2003
Location: Zürich
Distribution: Debian
Posts: 537

Rep: Reputation: 39
The first version of Linux I ever had was SuSE (7.1 or 7.3), and they described a method of dual-booting while keeping NTLDR in the MBR and using LILO information. I was able to follow it succesfully. Basically, you write the LILO boot info to a binary file, copy it to floppy and then copy the file to your C:\ partition and modify boot.ini to reflect the information; this allows NTLDR to find the required boot info on the Windows partition. Unfortunately, I'm pretty sure this procedure requires that Windows be bootable, unless you've installed Windows on FAT or happen to be able to write to system files on the NTFS file system from Linux.

Actually, I dug out an old bookmark that is still valid:
http://www.enterprisedt.com/publications/dual_boot.html

That said, GRUB is a far better bootloader and also a better solution, as long as Windows is installed on a primary partition.

Edit: Btw, if Windows has become unbootable and you want to try the above trick, you can restore NTLDR to the MBR using the Windows CD (see MS's website for details). Just make sure to make a bootable floppy or CD so that you can still boot Linux until you get Linux bootable via NTLDR and boot.ini. There are incidentally also tools available that will allow you to make backups of the MBR and the partition table, so that you can restore them later (for instance using a DOS bootable floppy that also has the MBR utility program). One I believe is MBRutil.exe (MBRUTILD.exe for DOS). Simple, effective, and independent of both Windows and Linux.

Last edited by michapma; 12-09-2005 at 09:09 AM.
 
Old 12-09-2005, 09:48 AM   #10
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 boot over 80 systems in my box with one Grub, from MBR, in any root partition with a system (Dos is offered with DOS 7.10, >50% Linux and SOlaris Express), in an empty partition with only Grub itself, in a CD, a pen drive or in a floppy.

If XP is the in the first partition of the first disk, a Grub floppy unattached to a system (see Chapter 3.1 of Grub Manual for its creation) can boot it with just 3 lines of command at Grub prompt

root (hd0,0)
chainlader +1
boot

You can install XP in the 1st disk and then put it in the 4th disk position and it still boots. All you need is to add two map statement to "re-map" the disk order "on-the-fly". just add these 2 lines after between the "root" and "chainlaoder" stattement

map (hd3) (hd0)
map (hd0) (hd3)

You can also round up every M$ systems and install in you box and boot any one of them. For M$ partitions ahead the target partition use the "hide" statement provided by Grub to hide them and every system can therefore booted into a "C" drive. I have 3 versions of DOS and 4 version of WIndows in the box.

The thread I suggested in #8 post is the exact method described by michapma. I tried it and it stopped at 10 systems. The amount of work is about 10 times that required by Grub. For those who plan big things for NTldr my comment is "Never send a boy to do a man's job!"

If a Linux user pre-partitions the hard disk, say the second one called hdb, into 50 partitions and edits his/her existing Grub configuration file /boot/grub/menu.lst with entries like

Title My Linux in hdb1
root (hd1,0)
chainloader +1

Title My Linux in hdb2
root (hd1,1)
chainloader +1
...
...
... until

Title My Linux in hdb50
root (hd1,49)
chainloader +1

All he/she has to do when installing a Linux is to tell the installer to place the boot loader, which can either be Lilo or Grub, in the root partition then that system will be instantly bootable on a reboot using the existing Grub in the MBR (or in any bootable media like a pen drive, CD, floppy etc).

You can't do the above to Lilo because Lilo always check and know the partitions are empty and wouldn't implement it, plus you can't have more than 15 entries in a Lilo boot screen.

Move with time, be lazy, don't do any work unless you have to and go with Grub!

I have not found a PC system that cannot be booted by a Grub floppy! As long as that system, say in partition j+1 of i+1 disk has its bootloader in root partition then these 3 generic always boot it (GRub counts from 0!!!)

root (hdi,j)
chainlader +1
boot

Don't take my word for it, try it on any Dos, Windows, Linux, BSD, Solaris and even Darwin X86. (Darwin boots but panic at lack of hardware driver in my box but all others fire up)

Any user reads Grub Manual and practises it will laugh at how booting has been made complicated by other boot loaders.

Last edited by saikee; 12-09-2005 at 09:57 AM.
 
  


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
help windows ate my MBR AhYup Slackware 1 10-07-2004 04:24 PM
windows upgrade ate my MBR.... brock57 LinuxQuestions.org Member Success Stories 2 07-26-2004 08:58 AM
Using Knoppix to install x-windows for Debian statmobile Debian 4 04-02-2004 02:54 PM
Windows ate my bootloader MediGuy Linux - Newbie 4 10-10-2003 06:10 AM
Windows ate Linux! RedHattedGnome Linux - Newbie 11 03-30-2003 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:01 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
Open Source Consulting | Domain Registration