Re: Linux and Windows Disk Drive imaging
- From: dplatt@xxxxxxxxxxxx (Dave Platt)
- Date: Wed, 2 Dec 2009 17:58:46 -0800
In article <PpDRm.72639$mn3.16186@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Joel Koltner <zapwireDASHgroups@xxxxxxxxx> wrote:
Thanks Dave; that's a reasonably simple approach. One last question: Is /grub
part of the "regular old file system" on a given partition (i.e., menu.lst,
etc. are stored within your, say, ext2 filesystem just like any other file),
or is it a special filesystem that GRUB understands but that actually occupies
parts of a partition separate from the rest of your files?
The former.
The only part of GRUB which isn't part of a normal filesystem, is the
boot-sector itself - the very first level. The later stages are all
stored in a standard filesystem.
I ask in that it's never been clear to me how, if menu.lst, etc. are all just
regular files, GRUB manages to access them since first it would have to be
able to find the ext2 or ext3 or reiserfs or jfs or a myriad of other
filesystem driver, which seems like a chick-and-egg problem.
When you run "install-grub", the installer asks your filesystem code
(e.g. ext2) where the later-stage loading files are (that is, their
actual sector offsets within the filesystem partition in which they
live). Specifically, it needs to know where "stage1" is, and the
"stage1_5" files for any filesystem formats you may need to use to
locate your kernel. I'm not sure whether it needs to know where
"stage2" is.
It patches these values into the bootloader and/or into stage1.
When you boot up, the boot-sector code now has enough information to
locate "stage1" on disk (without having to interpret any filesystem
structures) and it loads it. "stage1" has enough information to
locate the filesystem interpreter for EXT2, and loads that (and
"stage2", I think).
The menu.lst file, and any kernels and initial-RAMdisk images needed,
are locate dynamically by (e.g.) "e2fs_stage1_5" - it has enough
knowledge of the filesystem structure to be able to navigate
directories and load file contents (it's a purely read-only beast).
That's why you can navigate through directories dynamically, and boot
a kernel which wasn't even on the machine when you installed GRUB.
What this means, is that you need to re-run the grub installer and
write a new boot sector any time you move the low-level files around
(or update them), but don't need to do this low-level operation when
you edit menu.lst, or add a new kernel to your confirmation, or etc.
It's a more sophisticated system than LILO... which requires that you
re-run the low-level installer any time you change the kernel.
Replace vmlinux, and forget to run LILO again, and at best you'll
end up booting your old kernel rather than your new one. At worst,
you will sooner or later find that your old vmlinux file's sectors
have been re-used for a new file, and the "kernel" you just tried to
boot is actually Aunt Mamie's recipe for mango chutney.
Usually doesn't work too well...
--
Dave Platt <dplatt@xxxxxxxxxxxx> AE6EO
Friends of Jade Warrior home page: http://www.radagast.org/jade-warrior
I do _not_ wish to receive unsolicited commercial email, and I will
boycott any company which has the gall to send me such ads!
.
- Follow-Ups:
- Re: Linux and Windows Disk Drive imaging
- From: Jan Panteltje
- Re: Linux and Windows Disk Drive imaging
- From: Joel Koltner
- Re: Linux and Windows Disk Drive imaging
- References:
- Microsoft is a bunch of crooks and imbeciles, burned my copy of xp
- From: Jan Panteltje
- Re: Linux and Windows Disk Drive imaging
- From: Joel Koltner
- Re: Linux and Windows Disk Drive imaging
- From: Dave Platt
- Re: Linux and Windows Disk Drive imaging
- From: Joel Koltner
- Microsoft is a bunch of crooks and imbeciles, burned my copy of xp
- Prev by Date: Re: Got a 12v gel Cell, need 3.3,5,12,32 volts
- Next by Date: Re: Got a 12v gel Cell, need 3.3,5,12,32 volts
- Previous by thread: Re: Linux and Windows Disk Drive imaging
- Next by thread: Re: Linux and Windows Disk Drive imaging
- Index(es):
Relevant Pages
|