View Single Post
  #3   (View Single Post)  
Old 15th March 2009
argv argv is offline
New User
 
Join Date: Mar 2009
Posts: 5
Default another way

let's say you have vista and you shrink your ntfs partition and install BSD. you've got Vista on 1st partition and BSD on 2nd partition.

rather than a commercial product you might use a free linux live cd with GNU parted (or the gui Gparted), i.e. the ntfsresize utility, to shrink your ntfs partition.

parted has a 'set' command which is very useful for multibooting. alas, there's no parted for BSD (yet), it's linux only. but BSD's fdisk has the -a switch.

how it's done: while you're in linux via the live cd, from the command line you set a boot flag (0x80) on one of the partitions. here we set it to partition 2. this way we will boot to BSD.

Code:

(parted)set 2 boot on

when you reboot, the OS that boots is the one with the boot flag, the one marked as "Active": the 2nd partition. your BSD partition.

if you set the boot flag on your Vista NTFS partition (partition 1) then the system will reboot to Vista. simple.


Code:

(parted)set 1 boot on

or (if you are in BSD)

fdisk -a and follow the instructions


what do you do while you're in Vista and you want to set boot flags? to boot to BSD. are there windows equivalents of GNU parted or BSD's fdisk?

not that i know of. bcdedit is a "boot manager" (as is "grub"), which is something different. these "managers" aim to boot OS's by acting as a go-between, taking control before letting the OS's native boot loader do its job. do we need a go-between?

parted and fdisk aim to edit partitions which is what switching the boot flag involves- a very small hex edit.

i found a small utility called plppart32 on the plop (system recovery) linux site. easier to use than bcdedit? have a look. it requires just one more line than parted to set the next reboot. while in Vista we can set the boot flag on 2nd partition (BSD) like this

Code:

plppart32 -d 0 -p 2 -b 0x80 # set boot flag on 2nd slice
plppart32 -d 0 -p 1 -b 0 # remove boot flag from 1st slice

in sum the boot flag is all that needs to be manipulated to choose an OS to boot from

hence you can

[just in case] save a copy of your windows MBR (tar'd or zipped)

[just in case] keep a linux systemrescuecd on hand

use a tool like GNU parted in linux, or fdisk in BSD, and use a tool like plpprt32 in Vista to make the simple hex edit to set the boot flag.

simple and easy. let each OS use its own boot loader, with no go-betweens.

Last edited by argv; 2nd April 2010 at 09:25 AM.
Reply With Quote