-
Vista booting Linux explained
Edited - 28/4/09 - Tried the MS Windows 7 both 32 and 64 bits which use the same bootmgr and BCDedit as Vista. Thus this thread is also applicable to the new Windows 7.
NT versions of MS Windows can multi-boot Linux by its boot loader NTLDR. The steps are summarized in Task E4 of Just Booting tips.
I have been looking at Vista's new boot manager and use it boot Linux. The basics has not changed. The key features are using the bcdedit.exe to carry out 4 main steps (first 2 are done in Linux).
- The Linux must has a boot loader, either Lilo or Grub, in its root partition.
- The first sector of 512 bytes of the Linux partition is copied into the partition where Vista's bootmgr resides.
- Vista BCDedit is informed of the name of the Linux. An identifier is issued by BCDedit.
- User declares the identifier as a device boot.
- User informs BCDedit the filename of the Linux's first sector.
- User informs BCDedit the booting order of the Linux
In a nutshell Vista chainloads a Linux same as Grub or Lilo. However while Linux chainloads another system at the +1 position (starting from the second sector and load the entire boot sector) Vista only loads the first sector nothing else.
This is more to do with MS attitude towards other operating systems. It is a message saying I don't support you guys and there is no way I would come out to read your partition and fetch your boot loader. If you want me to boot you then place the first sector on a plate and deliver it to my "C" drive.
-----------------------------------------------------------------------------
Implementation
The best Linux for work with a Vista is possibly the current version of Slax which automatically mounts every partition it finds, already shipped with ntfs-3g so writing on ntfs partitions is seamless, offers root privilege to the user and permits user a complete freedom in the graphic desktop.
Thus if Vista is already mounted in /mnt/sda2 one can copy the first sector of any LInux partition, say sda7, to the "C" drive of Vista directly bt terminal command
Code:
dd if=/dev/sda7 of=/mnt/sda2/sda7.bin bs=512 count=1
The binary file used is "sda7.bin".
Thereafter there are 4 steps in Vista to implement the booting. The work is done in Command Prompt but must be run as the adminstrator. Just right click the "command prompt" and select "Run as Adminstrator". Vista will drop you straight into c:\Windows\system32 directory where the control program bcdedit.exe resides.
Step-1 Vista BCDedit is informed of the name of the Linux.
This is done by command
Code:
bcdedit /create /d "Linux_in_sda7" /application BOOTSECTOR
The entry {c4c13df3-7949-11dc-98f8-81e4e48608ff} was successfully created.
In the above only the Green bit is the input. The second line in orange is the response by Vista bcdedit. The entry {c4c13df3-7949-11dc-98f8-81e4e48608ff} is internally generated by bcdedit sequentially as a unique identifer which must be used in the next 3 steps.
Step-2 User declares the identifier as a device boot.
This is by command
Code:
bcdedit /set {c4c13df3-7949-11dc-98f8-81e4e48608ff} device boot
Step-3 User informs BCDedit the filename of the Linux's first sector.
This is by command
Code:
bcdedit /set {c4c13df3-7949-11dc-98f8-81e4e48608ff} PATH \sda7.bin
Step-4 User informs BCDedit the booting order of the Linux
This is by command
Code:
bcdedit /displayorder {c4c13df3-7949-11dc-98f8-81e4e48608ff} /addlast
The complete response the command prompt looks like this
Code:
C:\Windows\system32>bcdedit /create /d "Linux_in_sda7" /application BOOTSECTOR
The entry {c4c13df3-7949-11dc-98f8-81e4e48608ff} was successfully created.
C:\Windows\system32>bcdedit /set {c4c13df3-7949-11dc-98f8-81e4e48608ff} device boot
The operation completed successfully.
C:\Windows\system32>bcdedit /set {c4c13df3-7949-11dc-98f8-81e4e48608ff} PATH \sda7.bin
The operation completed successfully.
C:\Windows\system32>bcdedit /displayorder {c4c13df3-7949-11dc-98f8-81e4e48608ff} /addlast
The operation completed successfully.
C:\Windows\system32>bcdedit /enum
Windows Boot Manager
--------------------
identifier {bootmgr}
device partition=C:
description Windows Boot Manager
locale en-US
inherit {globalsettings}
default {current}
displayorder {current}
{c4c13df3-7949-11dc-98f8-81e4e48608ff}
toolsdisplayorder {memdiag}
timeout 1000
Windows Boot Loader
-------------------
identifier {current}
device partition=C:
path \Windows\system32\winload.exe
description Windows Vista
locale en-US
inherit {bootloadersettings}
osdevice partition=C:
systemroot \Windows
resumeobject {e8709fb7-fa5f-11db-be4d-e219ece5282e}
nx OptOut
Real-mode Boot Sector
---------------------
identifier {c4c13df3-7949-11dc-98f8-81e4e48608ff}
device boot
path \sda7.bin
description Linux_in_sda7
C:\Windows\system32>
Lastly I used the command "bcdedit /enum" to list the booting choices, which are just Vista and the new Linux I added. In the above the blue bits are commands while the rest is response by Vista.
For using Vista to boot more Linux it pays to write a script to automate the process, as I did in here.
--------------------------------------------------------------------------
Disappointments of Vista
(1) I have used a python script to automate booting of 20 Linux (later for 150 Linux) but found only those in the same hard disk as Vista can boot successfully. It would appear bcdedit.exe has not been written to handle booting system in a hard disk other than the one Vista residing.
(2) The location of the Linux first sector file also needs to be in the root directory as the bootmgr.exe. When I placed the same file in a subdirectory the booting failed.
(3) Vista has a scrolling screen but only the top 6 are visible. The highlight key may drop below the 6 booting choices and disappear completely in some instances.
Last edited by saikee; 04-28-2009 at 07:28 PM.
-
Why not use Vista to boot Grub and then chainload your 20+ operating systems on whatever disk/partition you may have Linux or whatever installed?
Last edited by JohnT; 11-04-2007 at 05:23 PM.
-
I did.
The Linux on the same disk as Vista boot fine but none of the Linux on another disk fired up.
I am working on another disk using the same script to try 150+ Linux there.
-
If you couldn't access another disc with Grub you have hardware problems.
-
JohnT,
No I don't have a hard disk access problem. All the Linux boot satisfactorily but Vista can't fire some up. More details are in the 150+ Linux thread.
They are alright if they are in the same hard disk as Vista. If they are in a different hard disk the Lilo-based Linux boot OK but not the Grub-based Linux.
Last edited by saikee; 11-04-2007 at 06:38 PM.
-
I think you missed my point......using Vista to boot into Lilo/Grub will enable you to access any partition/disc.......Vista's limitations not withstanding.
Good read anyhow.......very helpful to Newbies.
-
I am not an expert in MS systems and hardly know BCDedit.exe at all.
I started to look into Vista boot loader only about 4 evenings ago, tried it out on one pC to boot 20 systems , then tried another PC to boot 150+ Linux and wrote this thread and the another one on 150+ Linux, hoping to have something recent to post in the forum.
-
Knowing what a fanatic you are of multi-booting and partioning.....I thought you might like to observe this thread and even contribute.HERE
-
I was taught by and raised in Justlinux forum. Whatever I wrote I learn it from the members and super mods here. I pay particular attention to replies by knowledgeable member like you. Think I get more from Justlinux than an average newbie and leaned to stretch Grub after directed by the Justlinux forum to read the Grub Manual. I am amazed by the little bit of knowledge in Grub can get my teeth into Vista's BCDedit so quickly.
I joined the suggested site and see how other are doing with just the MS systems. I am sure there are things to learn if I keep my eyes open.
Last edited by saikee; 11-06-2007 at 04:44 AM.
-
I joined the suggested site and see how other are doing with just the MS systems. I am sure there are things to learn if I keep my eyes open.
I was thinking more along the lines that you could probably teach them a thing or two and possibly win some converts to Linux.
-
win some converts to Linux.
I am comfortable with this. Due to the structure of the MS boot loaders it is my opinion that it is nearly impossible for MS to boot all its products by any one of its current fleet of boot loaders.
Grub can fire up all of them now. I believe Lilo can do it too if I am willing to spend time with it.
Windows users have to learn Linux just to use Grub. The determined ones will come to Linux.
The fact speaks for itself. One learns Grub only once and is able to boot every PC system, regardless it was invented before or after Grub was born.
For MS systems one has to keep on learning a new boot loader from scratch each time MS decides to boost its profit by bringing out a new operating system.
-
I don't have Vista but I used to boot Redhat 9 almost the same way. I had a 512 byte linux.bin file in my c:\ drive. It was the first 512 bytes of the /boot(grub)partition. I had to edit boot.ini to make the ntbootloader boot grub and then from there I could boot Redhat.
I didn't want to touch the MBR in Windows. Redhat was on a second hard drive. Now I boot Mandriva 2007 and Win Xp for the rest of my family using grub alone ( See my post in this thread from 2004:
http://www.justlinux.com/forum/showt...562#post719562)
Last edited by jjflash; 11-08-2007 at 06:08 PM.
I was born in a crossfire hurricane...
Linux User #343734
-
Although I collect as many methods as possible to keep a Windows user happy not to have Windows MBR touched by Linux the fact of the matter is both Xp and Vista MBR, just like any boot loader, can be generated using the installation CD.
The joy of learning Linux is the tremendous flexibility it affords in booting. I don't even blink my eye if the MBR is accidentally overwritten and for months I didn't even bother to repair the MBR or even to use it. A Grub floppy is all I need to boot any operating system.
I probably spend all my life telling PC users to let go the fear of the MBR. You should try it someday. Just pick a Linux Live CD in the list shown here and use it to boot up your XP.
Believe me once you know how to use a Linux Live CD to manually boot up a MS Winodws you can feel the power of Linux.
-
I have used the comand
dd if=/dev/sda7 of=/mnt/sda2/sda7.bin bs=512 count=1
but I have got an error saying:
Error opening input file : the path can not be specified
Help please!
-
nico75,
You need to mount the Windows partition of whatever it calls first.
You find out which device name in Linux using a root terminal command
The Windows partition is always Type 7 denoting it is NTFS and should be the 1st or 2nd partition in a hard disk.
If this partition is say sda2 you have to create a mounting point in directory /mnt and mount that partition manually first, using root terminal commands
Code:
mkdir /mnt/sda2
mount /dev/sda2 /mnt/sda2
ls /mnt/sda2
The last command confirms its content.
Your Windows partition sda2 is now ready to accept the first 512 bytes from the partition /dev/sda7.
Please note dd does not need the partition to be mounted but if you are storing the output in a partition then the output destination has to be mounted first.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|