# Using a Linux Live CD to boot up a XP or Vista



## saikee (Jun 11, 2004)

This may come in handy for Windows users panicking after losing the Windows MBR. The sad fact in life is most Windows users do not know that all MS Windows can be booted up without its MBR.

*What?*

Sounds crazy but it is true. Not all Linux Live CD can do it though but the following can

*Mepis
Frugalware
Sidux
Kanotix
Yoper
DreamLinux
eLive
Linux Gamer
Belinix
Solaris (both Version 10 and Express)*

The distros colored in *orange* are Solaris systems. Their CD are already supplied with Grub in text mode. Strictly speaking Solaris is a Unix-like system and different from Linux but iits Grub, which has been enhanced, can be used for the same purpose.

*Why?*

A Linux Live CD can only be booted by a boot loader that can read the iso9660 filing system. There are only two such boot loaders used in a Linux Live CD.


*Isolinux* (used by the majority of Live CD)
*Grub* (which has a boot loader for the hard disks and another seaprate one for CD/DVD)

With the exception of OpenSuse and Freespire, which have been excluded from the above list because their implementation of the splashimage/gfxmenu makes a Grub prompt inaccessible, all the above Live CD use Grub and therefore can be used to boot any PC that has MS systems of Dos, Win9x, Win2k, Xp and Vista.

For some reason the Linux distros maintainers want to present a stunning graphic screen at the boot up session by the splashimage and gfxmenu command. Such implementation prevents the user from communicating directly with Grub. It can be overcome at the boot up screen if the "Esc" key is pressed to trigger this message (before booting up any system)


```
[B]You are leaving the graphical boot menu and starting the text mode interface[/B]
```
by pressing "OK" the boot screen truns into text mode.

In text mode the Grub screen lower part has an instruction saying 

```
[B]Press "c" for a command-line[/B]
```
Pressing the "c" key will drop a user into a *Grub prompt*.

*As far as I am aware there is no installed PC operating system in existence that cannot be booted up by a Grub prompt. *

*How?*

I assume you have one of the above CD and walk up to *a PC that you have never seen before* except you know it runs Windows. I also assume the PC has been arranged in the Bios to boot up a CD first if inserted, otherwise it boots automatically to the hard disk.

Just insert the Linux Live CD, boot it up, at the booting screen, press "Esc" key to change into the text mode and then press "c" to get a Grub prompt.

You first move is to see the partition arrangement of the first boot disk (hd0) by typing the command

```
[B][COLOR="Red"]geometry (hd0)[/COLOR][/B]
```
You will be presented a list of partitions starting from 0 and partition ID near the end.

Every partition has an ID number to denote its type

Type --- Partition
6 ------ fat16
e ------ fat16 (LBA mode)
b ------ fat32
c ------ fat32 (LBA mode)
7 ------ ntfs

A modern NT version of MS Windows of Win2k, Xp or Vista will normally installed in a ntfs partition. However if an older Dos or Windows is present and installed earlier then the boot loader will be placed in the first MS partition because it will be detected first. Therefore looking at the "geometry (hd0)" output one should find out the partition number of the first MS partition, by checking the partition ID.

Grub counts from 0 so the first hard disk is (hd0) and its first partition is (hd0,0) which is the traditional residence of a MS Windows. If this is the case you will see Windows fires up after these commands in Grub prompt

```
[B][COLOR="Red"]root (hd0,0)
chainloader +1
boot[/COLOR][/B]
```
Adjust the Windows partition number to suit your case. *Enjoy Linux and find out how a computer works*.

You can do the same thing with a floppy, a CD or a pen drive if you put Grub inside.


----------



## TRS-80 vet (Jun 18, 2005)

What is involved in editing my MBR at this point?


----------



## saikee (Jun 11, 2004)

You don't need to use the hard disk's MBR if you boot an operating system with a Linux Live CD.

MBR of any OS rarely get edited. It is wholly restored usually by the installation CD.

To restore any Dos to Xp MBR ----use a bootable Dos floppy with fdisk.exe inside or XP/Win2k installation CD. The two can be mixed as up to that point the MS systems have a common MBR

To restore Vista MBR ---- Use Vista installation DVD

To restore any Linux's MBR --- Any Linux Live CD

To boot any PC system --- A Grub prompt obtainable from selected Linux Live CD (or Grub unattached to an OS in a floppy, USB, CD, internal or external hard disk)

The commands are in the the last link of my signature


----------



## RobLinux (Nov 7, 2007)

Nice post!



saikee said:


> With the exception of OpenSuse and Freespire, which have been excluded from the above list because their implementation of the splashimage/gfxmenu makes a Grub prompt inaccessible, all the above Live CD use Grub and therefore can be used to boot any PC that has MS systems of Dos, Win9x, Win2k, Xp and Vista.


On OpenSuse, I've always been able to get to the GRUB prompt. I haven't tried their Live CD, but on OS Install CD or installed system, you simply hit <ESC>, get into text mode, and then you can select the entry you want to edit with 'e'.


> For some reason the Linux distros maintainers want to present a stunning graphic screen at the boot up session by the splashimage and gfxmenu command. Such implementation prevents the user from communicating directly with Grub. It can be overcome at the boot up screen if the "Esc" key is pressed to trigger this message (before booting up any system)


Exactly, so I don't understand why you exclude OS from your list, because I've done that all the time from it.

On the Install CD, it includes a rescue system, testcd and memtest86 IIRC, as well as boot from hard disk, which you can choose and edit the options.

It's very comfortable, has been since SuSE switched to GRUB, and that is one thing they haven't screwed up yet and Ive been installing OS-10.3 on 3 boxes recently.


----------



## saikee (Jun 11, 2004)

The Opensue installation CD has isolinux and the "Esc" send a user to the isolinux section.

Installed Opensue does not have the same problem.

My Live CD list isn't exhaustive and I am glad that you have provided the extra distros that can be used for the same purpose.

Getting Grub from the hard disk, floppy, CD (installed with stage2_eltorito) and pen drive is outside the scope of this thread. Personally I just use a Grub floppy to boot every PC system but readers may think it may be hard to create. A Linux Live CD is one that can be downloaded and burn and so it is widely available.


----------



## RobLinux (Nov 7, 2007)

If you select 'Rescue System' then you can mount any partition. So you can re-install a backup MBR using dd. Or you can install GRUB on the hard drive.

But I don't understand now why you need the Live CD at all, if you have to fix the Vista boot via CD/DVD etc then just boot it in the first place.

For disk partitions etc and checking Windows partiton is set to active, you can just boot the Linux Live system (and SuSE one will do that).

There's something I don't understand, boot from CD to get into GRUB,just so you can choose to boot into Windows. If you've only got windows, then a boot floppy with GRUB on it would do it.

And if the Live CD is to provide a comfortable environment to install GRUB on the hard disk, and get it to boot windows then any CD will do.


----------



## saikee (Jun 11, 2004)

The idea of using a Live CD is to be able to boot any OS without the need of a functional MBR.

Many Windows users do not want Linux inside or to install Grub. Making them using a Linux Live CD is equivalent to pointing a gun at his/her head. However if a Windows user gets into trouble with the MBR then a Linux Live CD may be just the tool to rescue XP or Vista quickly. Remember the thread assumes the person using the Live CD can have absolutely no knowledge of Linux. All he/she need is just a couple of commands in Grub.

Grub does not fix a Windows. It just boots it up one without using its MBR.

Grub can be use to make a partition active, re-map the disk order, hide partition and unhide partition without a Linux. That is the whole point of using Grub. Booting XP or Vista is just a "part time" job for Grub.

I advocate using a Live CD because many new PCs and laptops are no longer supplied with a floppy drive! Thus there is no good to tell how great a bootable Grub floppy is to these owners.

In the last sentence of Post #1 I did mention that one can put Grub in any media to achieve the same thing but that requires the user to know a little about Linux.

*This thread is good for a Windows user who known absolutely nothing about Linux. *

The Linux Live CD application here is about using Grub alone. Linux isn't booted or used at all. A Live CD is portable and you don't need to know the partition details in advance if you know how to use the "geometry" command in Grub.

I am hoping if a Windows user finds Grub so useful he/she may be tempted to think may be the rest of Linux is equally that good.


----------



## RobLinux (Nov 7, 2007)

I see. But Vista is a pig, if it gets a boot error, it will refrain from trying again. You have to use an M$ disk to re-activate, GRUB will boot it but Vista will be in a huff and not play ball, merely re-starting the system. But if you have the disk then, then it will do an fdisk /mbr and then boot 'doze without having the hassle of burning CDROMs.

Re-mapping the BIOS disk order won't change anything on the next boot, it's going to have to try and boot itself.

There's specialised Rescue CD's that will let you set partions active and such, and try and sort passwords. They may even have a GUI for all these tools, which will be much nicer than text commands in GRUB.

Posting in the UNIX/Linux section a thread for "Windows Users who know nothing about Linux", confuses me; have you tried advocating GRUB in less enlightened sections? I'm curious what sort of reaction you get.


----------



## saikee (Jun 11, 2004)

There are Linux newbies who need to be taken by the hand here.

We can set a partition active with any Dos, XP, Vista, Grub, Lilo or Linux. There is a lot simple tasks we can do with various boot loaders and going after a special CD doing it in behind a script isn't the best way to learn.

I am neither a supporter of Vista or its enemy but I have its bootloader booting 150+ Linux by automating the process with a script. I therefore don't share your pessimistic view of its boot loader which I found it easier to work with than XP's NTLDR. Both XP and Vista use the same chainloading technique to boot Linux.

From Liinux side I never experience any booting problem with Xp/Vista using Grub or Lilo. That is why I draw people's attention that these two MS systems can be booted by just a Linux Live CD.


----------



## RobLinux (Nov 7, 2007)

In that case it's using Vista's boot loader when it's s succeeding to load it.

When it's not booting, quite possibly because someone tried to boot it slightly incorrectly, then it will insist on having itself repaired and possibly re-activated by Key.

If Vista's boot loader is working why you need the Live CD?


----------



## saikee (Jun 11, 2004)

> If Vista's boot loader is working why you need the Live CD?


A vista or a XP with a defective MBR will not be able to boot itself. Its boot loader can be healthy and can be fired up by a selected Linux Live CD, Grub or Lilo in a hard disk or an installed BSD or a Solaris.

If the residing MBR belongs to an operating system other than MS you may not wish to restore the XP or Vista MBR.

This is what I wrote at the very beginning of this thread.

*" The sad fact in life is most Windows users do not know that all MS Windows can be booted up without its MBR."*

I would go further by saying every PC system can be booted without its MBR if you can boot up a Grub prompt from a floppy, a pen drive, a CD/DVD, an internal hard disk or external hard disk. A selected Live CD mentioned in this thread give you that Grub prompt.


----------



## RobLinux (Nov 7, 2007)

But you can fix that with Windows CD...

Why's a windoze user going to want to mess with Linux Live CD, just when they're under stress of their system not booting?

And, if they're not dual booting, and that happened, and now they go and mess with Linux, what's their support ppl going to say, and what going to get the blame?

If they get the GRUB line slightly wrong, then Vista will refuse to boot, until it's repaired by it's own disk. So I don't really see what they're gaining.

Is it impossible to fix the MBR with the XP/Vista disks?

BTW: Some of the specialised Rescue CD's are not script but polished GUIs, more suitable to Windows type than GRUB is by a long way.


----------



## saikee (Jun 11, 2004)

RobLinux,

I write something about using a Linux Live CD to boot Widows systems and explain the principle behind. The two are totally unrelated. This is meant for a better understanding of how boot loaders work.

If you think what I wrote is unsound please show the evidence and keep the opinion to yourself, or better still write your own threads. 

I don't expect everybody want or need to use it. It is just like food if you don't want to eat meat then go for the fish or stay as a vegetarian. 

You can't possibly know what other people want to do with their computers. 

What I say about how an operating system or a hardware will behave will not change whether I write this thread or not.

I will leave the readers to judge if the information is any good to them.


----------



## Elvandil (Aug 1, 2003)

Those who don't have a full Linux distro to boot from can find the Super Grub Disk useful. It has versions for floppy, CD, and USB.


----------



## RobLinux (Nov 7, 2007)

saikee said:


> I write something about using a Linux Live CD to boot Widows systems and explain the principle behind. The two are totally unrelated. This is meant for a better understanding of how boot loaders work.


That's fine, and the actual purpose was what I was asking you. I just didn't understand why they'd want to fix their MBR by getting a Linux distro, when their OS disk would do it; that didn't make sense, so I asked the question.

Now you answered it's finally clear.

But...

You're assuming the Generic MBR code installed by GRUB will work. If it doesn't then GRUB won't help them. A distro could also change that, for some reason (there's discussion on need to do that on OpenSuSE's Bugzilla, to help make single dual boot disk systems work better).

Let's not worry about that though, it's too detailed for educational purposes.


----------



## saikee (Jun 11, 2004)

RobLinux,

I do object to your spreading out baseless rumour in my thread. You don't have any proof on Grub's generic MBR code not working on MS systems but you made such a hint.

I found this objectionable because 

(1) I have booted every Dos and Windows with Grub and never experience any problem. In my signature there is a link showing how 3 Dos and 5 Windows were booted in a PC. My information is therefore based on experience on things that I have carried out successfully with theory that I could explain. 

(2) MS systems up to and including XP share a common MBR. The function of this MBR is to search the 4 primaries like a blind man and boot the one with the booting flag switched on. It is well documented in the Internet and explains why a Dos floppy can rescue a XP's MBR while a XP installation CD can "fixmbr" a Dos MBR. I personally has used MS's MBR to boot up Grub because MS's MBR does not care what system inside as long as the partition is an active primary. Needless to say I have published this information. Vista has its own MBR but it behaves exactly the same way as the old one but requires the Vista installation DVD for its restoration.

My other complaint is the rumour of a new distro can change the PC booting. This can only be done with the Digital Rights Management (DRM) or trusted computing feature outside the established PC standard, with a different partition table arrangement and possibly a new Bios that has a full kernel inside. There are EFI partitioning scheme, eLilo and DMR-aware Grub trying to control the end user's freedom on choices of software and hardware by working on the OpenSource front. This type of changes is exactly what drives Linux more popular. 

The defacto standard as it exists today is every boot loader can boot another boot loader. Grub can boot a Vista and so too Vista can boot a Linux. You can use a BSD to boot a Solaris, a Solaris to boot a Xp and so on. Grub booting Windows is not a feat! It is the accepted practice in the industry for multi-boot. Whatever you buy or download any third party boot loader it will do exactly the same thing as Grub. Saying a new distro will change all this is irresponsible unless you have proof. 

I don't mind if you have something concrete to contribute to the understanding of our knowledge of the subject but if you don't I would prefer you start your own thread to spread out what your belief.

Your seemingly misinformation can discredit the effort I put into this thread.


----------



## RobLinux (Nov 7, 2007)

No, I'm pointing that the GRUB generic MBR, can be replaced by a different one by a distro. This is something they try to avoid doing, but may do in future, for reasons that you could discover in OpenSuSE Bugzilla, as I mentioned.

I said they do not do it at moment, but I explained that it was an option they might do in the future. It appears you have misunderstood this point.

When Generic MBR code, merely looks for active partion and then runs that, everyone is happy. But as a 'boot' expert, you know that these codes installed in those sectors can be altered, causing problems for other operating systems. If you don't believe that then RTFM on GRUB.

Actually I've been multi-booting with lilo(8), before GRUB became widely accepted in Linux world, so you do not need to convince me that multi-booting is possible. 

Because of the issues, you mention with the like of DRM, is exactly why I have not been happy with the suggestion of using Linux disks to fix, M$ Windows booting problems on machines which don't run Linux ever.


----------



## saikee (Jun 11, 2004)

I am not an boot expert but I am not aware a boot loader can be used to fix any operating system like a M$ Windows. A boot loader's function is to boot the operating system up.

Grub can't even read a NTFS partition. Let alone to fix it.

Any suggestion a boot sector of a M$ Windows can be altered by another boot loader during booting is groundless. *The MBR is the only 512 bytes that is commonly used and overwritten by every boot loader which has been instructed to multi-boot. The MBR is restorable by every boot loader.*

Grub in booting never alters any M$ system. If it is asked to boot a M$ system it hands over its control to that M$ system at the +1 position of its boot sector.

Lilo does exactly the same.


----------



## RobLinux (Nov 7, 2007)

Oh right, so GRUB won't install MBR code if you tell it to then?

How would you ever boot off a new hard disk, or one zero-ed out by DFT? If GRUB wouldn't write MBR.

As it can and does, then it is perfectly possible for GRUB to alter MBR on a M$ disk. Linux tools will also happily trash windows if that's what you want. It's just bytes on a disk platter.


----------



## saikee (Jun 11, 2004)

Please read Post #18. I highlighted the relevant parts.

Basically if you ask a boot loader, say a *Lilo* that you have used so often before, to multi-boot you give it the permission to occupy the MBR.

The thread I have written here is to multi boot *without touching the MBR*!


----------

