Howdy and thanks for the comments :-)

*Chainloader.*

Think of it in terms of a RUN command in the order of 'a chain of links', i guess that is the easiest way to explain it.

chainloader implies - 'to load the boot manager by command' in a similar way to any other filesystem object. i.e. "now you have switched me on my first order of the day is to ...."
The +1 is a directive to order it to complete this task.

So in plain english, what we are asking grub to do is to simply 'engage' or load the first sector of the disk we named in the root.


*root(hdX,y)*

where 'x' is the hard disk number and 'y' is the partition.

If you were running a single hard disk with multiple o/s then you would address root (hd0, X) where x is the partition number based on examing the structure offered by gparted or the windows disk manager. Grub does not have to exist in the root partition with MBR - in fact NEVER write GRUB into the first few sectors of your disk on a dual-boot scenario. Add grub to a differnet partition - i.e. (hd0, 2) where windows would be in (hd0, 0) and (hd0, 1)

Having read through the grub paperwork I did experiment with the rootnoverify command line but found this to be a little erratic if not dangerous to the overly sensitive MBR at times as it does not mount the disk based on any factual evidence, whereas 'Root' will mount the drive, estimate what it is looking at and passes this information to the chainloader command.

*makeactive*
reset the active partition, the one we called in root(x,y) to be active in grub.

*map*

Mapping is a simple method of fooling windows into believing it is the first disk. Another MS monopoly foiled so to speak!
A map is created on two lines - i.e.

map   (hd0) (hd1) (hd2) (hd3) (hd4) etc...
map   (hd1) (hd1) (hd2) (hd3) (hd0)


where line 1 in the above example is a structure of your disk drives as represented by the boot process in your BIOS. so your first line of the map should match your BIOS but where bios labels them 1-X, map begins with 0-X. So a drive in BIOS called 1 is 0 in your map.

The second line instructs the chain to re-align the BIOS mappings in such a way as to determine a new load order that is required for a multiboot system.

So if we have the following physical structure:

O/S       BIOS NUMBER   MAP NUMBER
DEBIAN      1            0
WIN XP 2 1 WIN 2K 3 2
VISTA       4            3

Then Debian will be our root disc containing the grub mechanism. Your system will auto boot to this O/S if you ignore any prompts!
But, if you hit ESC when prompted by GRUB and choose VISTA [god help us!]

Then we are re-mapping the computer in such a way as to rebuild the default structure shown above:

O/S       BIOS NUMBER   NEW MAP NUMBER
DEBIAN      1            1
WIN XP 2 2 WIN 2K 3 3
VISTA       4            0


And when this happens, VISTA will believe it is the first disc and boot without any issues whatsoever!

Note: This how-to implies the use of your default operating system being a DEBIAN breed - i.e. ETCH GNOME, ECTH KDE, SARGE, MEPIS, UBUNTU, KUBUNTU. MINT ETC.... do not try this in any Red Hat Distro [i.e. fedora, centos etc...] - red hat handles grub in a different manner and it isn;t as felxible as Debian - thus i like debian methodologies!

However, in saying that. There is no reason why fedora, centos or any other Linux Distro cannot be in your DISK CHAIN replacing or adding to the Windows examples above - it all depends on the how many SATA drives you can run from your motherboard. I'm lucky - i build my own machines and mine support over 10!

If i missed anything, just give me a shout.

But i can always go through this at the next meeting if anyone wants me to.
Yes i will be there this month!
J.



Richard Forth wrote:
what does chainloader +1 mean/do?

ps nice how to!

Rich

On 15/03/2008, *substation* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi people,

    RE: UBUNTU/DEBIAN MULTI-BOOT SATA SYSTEMS - ISSUE FIX

    For anyone who is interested here is a great way of being able to
    multi-boot Ubuntu Gutsy/Debian Etch with Windows/Linux as often
    and as many times as you need. No more changing cables!

    This works with Linux acting as a master O/S for any Linux
    Distribution or Windows operating system. This is because we are
    going to modify GRUB.
    The windows boot manager is not very flexible!

    This method or approach can work for unlimited SATA disk drives
    containing unlimited O/S systems and storage drives - you could
    even use an ESATA disk - without the risk of killing your windows
    MBR without the risk of disk failure killing your system - pretty
    much risk free as long as you follow the how to carefully; but
    mistakes can happen. S yes, this guide is without warranty and
    works on a SATA based hard disk system only :-)

    Note: For multiple IDE disks you need to reconfigure the
    master/slave drive settings, whereas for a single disk multi-boot
    system it is simple enough to simply install XP first then add
    Ubuntu using a manual partition setup [there is a guide in
    Ubuntu's community docs for this]. For this how-to i am NOT using
    a RAID ARRAY and treating each disk as a separate disk drive for a
    distinct O/S. If you did use RAID, then you need to treat your
    disk like a rather large EIDE setup with partitions.

    These instructions will create 3 separate operating systems and a
    single hard disk for additional shared storage. Linux will always
    be disk number 1 and for simplicity - my cross-O/S storage drive
    is formatted to FAT32 - if you want to use NTFS then get the
    relevant disk tools for your linux distro!


    Let's begin:

    1] If you need to install your O/S jump to point 1, otherwise skip
    to point 2.

    1a] If you need to install an operating system, unplug all your
    disk drives. Add a single drie to header/channel 1 and install on
    a one-at-a-time.
    2a] Repeat the above for each and every O/S

    2] Back-up your data - The Windows MBR is very touchy.

    Then take your existing operating system disks and attach them in
    the following order to your sata headers on your motherboard:

        HEADER/Channel
        1   UBUNTU
        2   WINXP
        3   WINXP
        4   STORAGE DRIVE

    I find it easier to add the storage drive at the end, but you may
    want to run it as disk 2.
    All windows computers will see each others hard-disk whilst linux
    can see them all.
    All operating systems are standalone and fully functional.

    3] Verify your BIOS can see all the disks and ensure you have them
    booting in the correct order
    4] Boot to UBUNTU, open terminal and either:

        $ sudo vi /boot/grub/menu.lst
        or
        $ sudo gedit /boot/grub/menu.lst

    Create a back-up of this file immediately then start editing.

    4] Scroll down to the bottom of this file and look for the final
    line - i.e.

    ### END DEBIAN AUTOMATIC KERNELS LIST

    Below that line type the following [use a tab to separate the
    command word and the statement]:

    title   Other operating systems:
    root

    5] Now lets add your O/S. Your file should now look like this:

    ### END DEBIAN AUTOMATIC KERNELS LIST
    title   Other operating systems:
    root

    Below this type the following replacing XXX with your O/S
    descriptions [use a tab to separate the command word and the
    statement]:


    title   XXXXXXXXXXXXXXX XXXXXXX XXXXXXXX
    root   (hd1,0)
    makeactive
    chainloader   +1
    map   (hd0) (hd1) (hd2)
map (hd1) (hd0) (hd2)

    title   XXXXXXXXXXXXXXX XXXXXXX XXXXXXXX
    root   (hd2,0)
    makeactive
    chainloader   +1
    map   (hd0) (hd1) (hd2)
    map   (hd2) (hd1) (hd2)



    Now, let's adjust the timeout for something more human. Look for
    the following line at the top of the menu.lst file:

    timeout   3

    Change the number to something suitable - i.e. 9 to give you a 9
    second breaker.

    Jone done.
    Save the file and reboot. Jump to point 6 below.

    ===============================
    Notes:
    Your edited file could look like this:

    ### END DEBIAN AUTOMATIC KERNELS LIST
    title   Other operating systems:
    root

    title   Windows XP, Games
    root   (hd1,0)
    makeactive
    chainloader   +1
    map   (hd0) (hd1) (hd2)
map (hd1) (hd0) (hd2)

    title   Windows 2000 Server
    root   (hd2,0)
    makeactive
    chainloader   +1
    map   (hd0) (hd1) (hd2)
    map   (hd2) (hd1) (hd2)



    What we did:
    root   (hd2,0) - This line simply references the disk number and
    the correct partition.


    In what we have done, the important part is here:

    map   (hd0) (hd1) (hd2)
    map   (hd2) (hd1) (hd2)

    To fool XP we have created a map of the disks starting with disk
    drive 0 [where your first disk is disk 0]

    So fo you need to add more disks, replicate the above template as
    many times as required by following the implied logic and adding a
    new map - i.e. (hd3), (hd4) etc....
    ===============================

    6] If all goes well, simply watch GRUB. Hit the escape key when
    asked and choose the relevant O/S to use.

    If you have any issues - i.e. a stalled boot [flashing cursor or a
    grub error] it is either [a] you made a typo or [b] check your cables.
    If you really get stuck, don't force things. Simply switch off,
    disconnect all drives except for Ubuntu/Debian
    open terminal and try this command:

    $ sudo fdisk -l
    This should confirm if Linux can see all the hard disk on your system.

    If the above is correct then re-check your work with

    $ sudo vi /boot/grub/menu.lst

    mistakes can often happen in GEDIT - so use VI [VIM] or NANO etc...
    I like VI myself.

    If nothing works at all and you are fed up - then something else
    must be at issue, so simply restore your backup menu.lst file ,
    disconnect the relevant drives and continue as before [no harm done].

    ===============================

    As i said, this how-to is without warranty - as the Windows MBR is
    very touchy!.
    Be careful and have fun!

    J.














    _______________________________________________
    Peterboro mailing list
    [email protected] <mailto:[email protected]>
    https://mailman.lug.org.uk/mailman/listinfo/peterboro




--
*****
Richard Forth

Forever Living Products
Natural Aloe Vera and  Bee Hive Products
For Better Health or Better Wealth

For product recommendations and for
information about business opportunities.

Please ask me for more information.

There is no obligation and no pressure,
just take a look at what people all over
the world are talking about.
*****
------------------------------------------------------------------------

_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro

_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro

Reply via email to