[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GRUB problem (long, description of BOOT)



hi ya mike

:-) i'm even more sleepy now :-)

but, some comments

On Tue, 27 Sep 2005, Mike McCarty wrote:

> I think you need a little more information about how
> boot is accomplished on IBM PC style computers.

if a user can't get the machine to boot .. this much
detail is probably more than they need ??

a simple post of their config is enough that shows
	root=   and boot=
along with the output fdisk -l

but ..

> Discs, to be used, must be formatted. The formatting
> takes place in levels. The lowest level (sometimes
> called low-level format) places tracks and sectors on
> each surface usable on the disc. Modern hard discs reserve
> one surface to hold tracking information alone, no
> data.

the "tracking info" is dependant on the filesystem

some intermingle track info ( aka servo data ) with data

> Low-level formatting should not be done on modern
> hard discs except at the factory. 

and then there's the joe-blow-me-too-factories that wipe
out the low level formatting with "dd" or equivalent
includhing windoze ghost

low level format is wiped out when the partition
that used exists before is gone and was overwritten by dd

dd is a very bad thing to use for multiple reasons ..
especially bad blocks

but a you say, with todays disks, the platter is
relatively defect free that dd'ing will "usually" work
except for those that have too many "disk problems"
	- if you did dd, that's bad
	- if you bought-at-el-cheapo-webstore, that's bad
	- if you did not put a cooling fan on it, that bad
	- endless list of why disks are bad, go bad

there are other low level format tools ..
( too lazy to go looking for it, since dd is good enough )

> (Floppy discs have all three levels done at once
> by a single program, usually.

fdformat or superformat ( low level formatting ) is done 
separately from the filesystem formatting

	mkdos, format a:, mkfs.vfat, ...

if your floppy doesn't boot, its probably because
you didn't do fdformat/superformat

or you didn't use rawrite in dos-land or dd in *nix-land

> Each Partition has a type (OS, more or less) and a status.

and an MBR

> The status could be either Bootable (also called Active) or
> non-bootable (Inactive). Only up to one (1) partition may be in
> an Active state, and if so, it must be a Primary Partition.

not 100% sure but we all know any of these are bootable, each having
enough info to make it bootable 
	( maybe a difference in terminology )
	/dev/hda1	windoze
	/dev/hda2	debian
	/dev/hda3	redhat

	each partition has its own MBR allowing it to be bootable

pretty pics
	http://linux-boot.net/MBR/

> > 255 heads, 63 sectors/track, 4865 cylinders

you forgot to describe the cyliner/head/sector mapping  :-)

it's sorta hard to have 255 heads on that itty bitty thingie
that flies over the disk platter  :-)


> > /dev/hda1 * 1 2433 19543041 7 HPFS/NTFS
> 
> Here is your primary partition which is active.

important to note that its active, but is NOT required to boot

set that boot flag with "a 1" in fdisk

> > Device Boot Start End Blocks Id System
> > /dev/hdb1 1 3188 25607578+ c W95 FAT32 (LBA)
> 
> This is a primary partition, not bootable.

it is not flagged .. but it can still be bootable
if lilo has boot=/dev/hdb1 or boot=/dev/hdb

> Now, how does BOOT take place?

more of the gory details ...
	http://linux-boot.net/Boot.Stage/

> After POST, the boot program starts looking for boot devices.
> Using BIOS settings (technically, these are not BIOS settings,
> they are boot program settings, but hardly anyone makes that
> distinction) the devices are searched in order. I am not familiar
> with the details of boot from USB, SCSI, or CDROM devices, so
> I do not deal with them here. Look elsewhere if you want that
> information.

the boot sequence is configurable in the BIOS setting
	scsi
	cdrom
	floppy
	hd0 ( hda )
	hd1 ( hdb)
	usb-hdd
	usb-fdd
	network(lan)

	- you tell it what to check first

> outside of any partition). It then looks for a Boot Marker
> (0x55, 0xAA) as the last two bytes of the first sector.

the important thing to remember ... as part of the MBR
and the 4 disk partitions

	512 bytes
	  2 bytes for boot flag
	 64	4 partitons of 16 bytes each
	----
	446	is the actual mbr 

> If the marker is found, the sector is loaded to a fixed
> location in memory (I forget the exact address, but I
> believe it may be 07C0:0000). Then it is given control.

that is the right addy

all that is stage_0 booting
 
> Otherwise, the OS gets loaded, and hopefully completes
> the bootstrap.

the os loading is stage-1 booting
which is where oyu see "loading vmlinuz......"
 
> Now, you may install GRUB as the MBR boot program, or
> as a BR boot program. If it is installed into the MBR,
> then it manages the boot. If not, then it
> can be installed as the first sector of the partition
> you are using as /boot.

i'm not sure that /boot is the first sector of the partition
... somebody and can go check that ...
 
> in the XP bootable partition). The XP boot program
> can be instructed to load GRUB if you like. This is the
> way I have my system set up. The XP boot manager either
> loads XP (not the default!) 


the baic problem is windoze always overwrits the mbr

whereas in *nix, you can tell it to skipp the bootloader

---

let windoze do its thing ...
	- you use knoppix or other standalong device
	and overwrite windoze's MBR

	- and congif grub or lilo ro ??? as dual-boot
	and yo can boot any distro

> (1) Install GRUB into the MBR, or
> (2) Inform the XP boot manager of GRUB's existence.

afaik, you can't tell windoze to "stop" and leave it alone
 
more fun boot stuff ...

	http://linux-boot.net/Boot.Sequence/

c ya
alvin



Reply to: