Jump to content











Photo
* * * * - 2 votes

Grub4dos Guide/Tutorial


  • Please log in to reply
129 replies to this topic

#76 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 10 May 2010 - 07:43 AM

This way I can let XP own the MBR and not have to know what files linux needs or change them if the kernel gets updated. I don't know how many linuces this would work for, but it seems simpler for Fedora and if others agree, might be worth adding to the documentation. I could even make some suggested changes to the docs for submission to whoever is responsible if wanted. I'll check back in a few days and see if that is desired.


Well, NO.
You have two separate partitions, each with it's own bootsector (or PBR) code, which you alternatively load through "something".
There are only three places where you can normally have boot code:
  • the MBR
  • the PBR (or boot record) of first partition (hd0,1)
  • the PBR (or boot record) of second partition (hd0,2)

From what you report, the PBR on (hd0,1) is the XP PBR (invoking NTLDR) and the PBR on (hd0,2) is the "whatever" Linux installed (typically a GRUB - not grub4dos bootsector).

The "something" can then be residing ONLY in the MBR.

The default XP MBR can ONLY directly boot - without any choice possible - the PBR of the partition marked active in the partition table (also inside the MBR), no more, no less.

So, what you reported is either (no offence intended :cheers:) inaccurate or missing some steps/details.

The only "possible" explanation I can see right now is that you have three partitions and have grub or grub4dos in the third one. :cheers:

Please try detailing the steps you took, which version of grub4dos you used (if any) or what version of GRUB (coming form Fedora) you are using, how you did the partitioning, etc., etc. :cheers:
FYI the normal booting process of a linux distro (most use GRUB) is:
BIOS->GRUB MBR->menu.lst->whatever
BIOS->Standard MBR->GRUB PBR of active partition->menu.lst->whatever
(things are slightly different if GRUB2 is used, but substantially the same)

The normal booting process of a XP is:
BIOS->Standard XP MBR->Standard XP PBR of active partition->NTLDR->BOOT.INI->whatever

:P
Wonko

#77 L A M A

L A M A

    Silver Member

  • Advanced user
  • 540 posts
  •  
    United Nations

Posted 23 May 2010 - 03:45 AM

Hi! Quick question!

I installed 3 OSes on my system.
01. OSX
02. 7
03. XP
04. (X.IMG :cheers: )

Now, once I'm done with installations, I want to save OS changed MBR to file and then boot it from Grub4Dos. Bootice allowed me to save :cheers: Can I boot those MBRs with this?

title find and load MBR01.SAV

fallback 1

find --set-root --ignore-floppies --ignore-cd /MBR01.SAV

map () (hd0)

map (hd0) ()

map --rehook

find --set-root --ignore-floppies --ignore-cd /MBR01.SAV

chainloader /MBR01.SAV

savedefault --wait=2


#78 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 May 2010 - 09:00 AM

@Lama
Why don't you simply try it? :cheers:

Usually this kind of things either:
  • work
  • do not work

From a pure syntax standpoint, you can use hook instead of rehook, and you may save some time by not re-searching for the file and directly establishing root on (hd0,0).

I am not at all sure that the () that you get is mappable to a whole (hd0). :cheers:

:cheers:
Wonko

#79 Silvia Nudel

Silvia Nudel
  • Members
  • 3 posts
  •  
    Germany

Posted 14 August 2010 - 11:19 PM

Where i can get the grub4dos tutorial ?

Link on first post does not work.

#80 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 15 August 2010 - 08:26 AM

Where i can get the grub4dos tutorial ?

Link on first post does not work.

Server is unfortunately DOWN.

Hopefully it will be working again soon. :D

:(
Wonko

#81 saddlejib

saddlejib

    Frequent Member

  • Advanced user
  • 270 posts
  •  
    United Kingdom

Posted 28 January 2011 - 05:46 AM

Do you the general community not feel that grub4dos requires a Wiki that can simply be added to by all with the know how.

I know knowledge is power but come on guys, a nice tutorial in command line use of grub4dos would be nice i.e knowing what and why to expect certain output from the commands you enter and why youve entered it. i.e what and why to expect certain output from say
kernel / <enter>

It would be beneficial to everyone, also knowing the meaning of the returned error codes and their descriptions
i.e Error13:inconsistent filesystem structure
would be helpful, yes I am ignorant enough not to know but is it the way forward? Would Linux be where it is today without community spirit?

I will leave these thoughts with you hopefully in the the improvement of an excellent project.

"The Truth Is Out There"

I think that might be X-Files but from me

"The list of accidental discoveries is endless"

#82 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 January 2011 - 03:04 PM

Do you the general community not feel that grub4dos requires a Wiki that can simply be added to by all with the know how.

Maybe. :cheers:
Probably that's because one was created at the time ;):
http://grub4dos.sour...x.php/Main_Page

Our western "resident" wiki Author, Mr:
http://grub4dos.sour...ki/index.php/Mr
is however currently MIA. :dubbio:

You may want to contact Bean123:
http://reboot.pro/5352/
to get access to it.

:cheers:
Wonko

#83 saddlejib

saddlejib

    Frequent Member

  • Advanced user
  • 270 posts
  •  
    United Kingdom

Posted 28 January 2011 - 07:33 PM

Whoops:
Yep, Read all those before, sorry, my apologies I'm an idiot at times.

#84 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 28 January 2011 - 07:44 PM

Whoops:
Yep, Read all those before, sorry, my apologies I'm an idiot at times.


Naah, don't put you too down :), you are right when you highlight that we don't have a coordinated, extensive documentation, problem is that we lack willing, competent (and possibly native English speaking) people that can put together the loose ends....

And sometimes it is not easy even to keep pace with the new features, bugs, solutions for them and whatever.

:cheers:
Wonko

#85 john3voltas

john3voltas

    Member

  • Members
  • 97 posts
  •  
    Portugal

Posted 26 May 2011 - 05:18 PM

Greetings.
I'm looking into booting Puppy Linux from a USB memory stick and I thought that I could use Grub4dos to do that.
The thing is, either I'm too dumb or this is very difficult.
Besides I'm not running Windows on my computer (running Fedora Linux) and the tutors/guides that I find all relate to windows utils to install Grub4dos.
Could someone give me a hand?
I know I can use UNetBootIn to make a bootable Puppy USB memstick but that way I can't boot anything else from that memstick.
Anyone can give me a hand?
Cheers

#86 LeMOGO

LeMOGO

    Frequent Member

  • Advanced user
  • 240 posts
  •  
    United States

Posted 27 May 2011 - 01:26 AM

For what it's worth, I'm adding a g4d section to the booting "map"

#87 john3voltas

john3voltas

    Member

  • Members
  • 97 posts
  •  
    Portugal

Posted 27 May 2011 - 07:36 AM

For what it's worth, I'm adding a g4d section to the booting "map"


Thanks LeMOGO. Using your map I just visited another thread here.
Here's a something that I copied from steve6375 that is an exact description of what I am looking for:

'How can I boot have lots of linux versions on the same UFD with persistence for each of them?'


The only difference is that I just posted that I wanted to have puppy linux but I actually was thinking of later adding a couple of other distro's such as backtrack, sysrecuecd, etc.
Cheers

#88 Sphinx114

Sphinx114

    Newbie

  • Members
  • 19 posts
  • Location:Siberia, Russia

Posted 19 November 2011 - 09:55 AM

How to use command "command"? What i can to run by it? I tried to run some *.exe *.com, but nothing works.

#89 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 November 2011 - 12:19 PM

How to use command "command"? What i can to run by it? I tried to run some *.exe *.com, but nothing works.

Where exactly did you read of command "command"?

:cheers:
Wonko

#90 Sphinx114

Sphinx114

    Newbie

  • Members
  • 19 posts
  • Location:Siberia, Russia

Posted 20 November 2011 - 12:15 AM

grub> help command

command: command [--set-path=PATH] FILE [ARGS]
Run executable file FILE with arguments ARGS.--set-path sets a search
PATH for executable files,default is (bd)/boot/grub.

#91 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 November 2011 - 01:22 PM

grub> help command

command: command [--set-path=PATH] FILE [ARGS]
Run executable file FILE with arguments ARGS.--set-path sets a search
PATH for executable files,default is (bd)/boot/grub.


Ah, yes, that has been introduced to allow some specific EXternal executables to run from grub4dos (i.e. the file you want to execute has to be written explicitly for this use).

An example is here:
http://translate.goo...php?tid=159760

Basic info here:
http://code.google.c...ki/UserPrograms

Some of such programs can be found here:
http://code.google.com/p/grubutils/
http://code.google.c.../downloads/list

And yes, try to track this kind of releases is a nightmare for everyone.....;)

:cheers:
Wonko

#92 Sphinx114

Sphinx114

    Newbie

  • Members
  • 19 posts
  • Location:Siberia, Russia

Posted 11 December 2011 - 09:48 AM

Thanks Wonko. Those utils is difficult for me now, maybe in future...

Next question. For what the option map --rd-size=SIZE is necessary?
I can successfully create ramdisk with using:
map --mem (md)200000+80000 (hd1) or map (md)200000+80000 (hd1) command without map --rd-size=80000.

And one question else. What designate letters p, u and n in find --devices= command?

#93 Szabolcs Raduly-Zorgo

Szabolcs Raduly-Zorgo
  • Members
  • 7 posts

Posted 23 January 2012 - 07:46 PM

Hi :)
I hope some of U will be able to help me with an unusual request / question:
The thing is, that I'm trying to get the next available free hdX (X should be the next free hd device number) so that I can map a new HD disk image.

ex: if I map hd0, then after boot the real hd0 will be invisible (I will see the image instead), ig I map as hd8 or any other higher number then the real existing hdX+1 then it will not be mapped.
If I have 2 HDD's I will have hd0, hd1... if I map the image as hd2 it will be OK, but in different systems I have different number of real HDD's... so I'm trying to find the number X from hdX, where the X is the real existing HDD number (in the second example: 2)

Thank U anticipated 4 U're help :)

#94 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 23 January 2012 - 09:22 PM

With recent grub4dos builds:

set /a hdn=*0x475 & 0xff
hdn will be the total number of disks as BIOS reports them. Since numbering starts from 0,
map (hd%hdn%) /someHDimage.img
will map the image to the first available hard disk number.
hd0, hd1- 2 real hard disks, hdn=2, map (hd2)- a new, third hard disk.

The last real hard disk then would be:
set /a hdm=%hdn% - 1

Might also need to adjust the new number of hard disks, since you are adding one:
set /a hdo=%hdn% + 1



map --harddrives=%hdo%



Got the idea?

Further reading:
http://cvwyg-blog.ap...UB4DOS5mlsy.htm
http://reboot.pro/16...post__p__145675
http://reboot.pro/12...post__p__108897


edited: corrected map (%hdn%) to map (hd%hdn%).

#95 k7rim

k7rim

    Newbie

  • Members
  • 12 posts
  •  
    Egypt

Posted 23 January 2012 - 09:35 PM

Hi , I want to ask a question

Is there any way to check if plop is loaded or not and act depending on the result
it's like g4d>>plop>>g4d again (plop is loaded before) >> load menu.lst

in syslinux there is com module called ifplop.c32 that provides the same functionality

thank you

#96 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 23 January 2012 - 10:40 PM

With recent grub4dos builds:

set /a hdn=*0x475 & 0xff
hdn will be the total number of disks as BIOS reports them. Since numbering starts from 0,

map (%hdn%) /someHDimage.img
will map the image to the first available hard disk number.
hd0, hd1- 2 real hard disks, hdn=2, map (hd2)- a new, third hard disk.


This may not work as (%hdn%) will equate to (2) rather than (hd2) - this might be better...

set /a hdn=*0x475 & 0xff

set newhd=(hd%hdn%)

map %newhd% /someHDimage.img



#97 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 23 January 2012 - 11:47 PM

Ohh, thanks, typing in a rush...
Corrected the post above map (%hdn%) to map (hd%hdn%).

#98 Szabolcs Raduly-Zorgo

Szabolcs Raduly-Zorgo
  • Members
  • 7 posts

Posted 24 January 2012 - 08:30 AM

Thank U :)
this was the magic part, that I could not get around: set/a hdn=*0x475&0xff
so now it is ok (and it is workin' as it follows):

title Map as a new HD from test.ima
set /a hdn=*0x475 & 0xff
map --mem (pd)/test.ima (hd%hdn%)
map --hook

Thank U again :)

#99 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 04 February 2012 - 06:14 PM

I have been looking into the grubutils collection and trying to make sense of it. Here are some notes in English rather than Chinese.
If anyone can add to this please let me know. There does not seem to be any readme on any (in any language) which is really frustrating.
http://www.rmprepus...rials/grubutils

#100 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 04 February 2012 - 08:39 PM

I have been looking into the grubutils collection and trying to make sense of it. Here are some notes in English rather than Chinese.
If anyone can add to this please let me know. There does not seem to be any readme on any (in any language) which is really frustrating.
https://www.rmprepus...rials/grubutils

Many thanks Steve, that's quite helpful :good:

Added: With https in the link above the connection here times out, with http works fine, might want to correct it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users