[Wolves] What have I done?

James Turner james at turnersoft.co.uk
Mon Feb 27 22:13:59 GMT 2006


On Monday 27 Feb 2006 19:47, Dick Turpin wrote:
> Evening All
>
> Currently have the SuSE up and running but not fixed.

I'd suggest using the following setup:

 - The BIOS should be set up to boot from the first hard disc (/dev/hda)
 - At least one partition on the first hard disc should be set to active
   (bootable). This isn't actually used by GRUB but many BIOS require it.
 - Boot Linux from CD
 - chroot to your SuSE hard disc install
 - Load your GRUB configuration file into prefered text editor and check it
   (see below). The file should probably be called /boot/grub/grub.conf
   (sometimes varies with distro?).
 - If all is well, reinstall GRUB using "/sbin/grub-install /dev/hda"

If the Windows XP information has gone missing from grub.conf, you may need to 
put something like this at the end to regain access to Windows:

title Windows XP Home
        rootnoverify (hd0,0)
        makeactive
        chainloader +1

You may also need to boot into the XP recovery console and run "FIXBOOT" if 
the boot sector of the XP partition has been corrupted. (if you run "FIXMBR" 
you'll have to switch to Linux via CD again and do 
"/sbin/grub-install /dev/hda" to get GRUB back).

> Stupid question, what should be in the /boot folder? Obviously Grub
> but should there be another boot folder?

I suspect the /boot/boot folder and subfolders may be an artifact of incorrect 
GRUB reinstallation, either manually or by some kind of automated config tool 
that's gone awry. What's in it other than nested /boot directories?

Check grub.conf and if nothing refers to it then it can probably be got rid 
of. (Move it first, just in case it turns out to be necessary after all!)

Remember that the pathnames in grub.conf are relative to the filesystem 
specified in each operating system's "root <device>" command. For example if 
your /boot is on /dev/hda1 (hd0,0 in GRUB terminology) and your kernel and 
initial RAM disc are at:

/boot/vmlinuz-2.6.14-1.1653_FC4
/boot/initrd-2.6.14-1.1653_FC4.img

as viewed from within Linux, you should have GRUB entries like this:

title Peter Cannon Deluxe Linux
	root (hd0,0)
	kernel /vmlinuz-2.6.14-1.1653_FC4 (various kernel options blah blah)
	initrd /initrd-2.6.14-1.1653_FC4.img

Note the absence of /boot in the pathnames. Think of /boot as being a 
"temporary root filesystem" used by GRUB itself when booting each operating 
system. That filesystem's location is specified by the "root" command.

Anatomy of what I reckon your /boot directory contains (or should contain).

/boot
  |
  |- boot
  |   |
  |   \- (mystery)
  |
  |- grub
  |   |- grub.conf   (GRUB config file) 
  |   |- device.map  (device map file, if necessary you can regenerate
  |   |    using "/sbin/grub-install --recheck /dev/hda")
  |   |- splash.xpm.gz (background image to make GRUB menu screen look nicer.
  |   |                 This is distro specific - may not be present, or may
  |   |                 have a different name) 
  |   \- Various "stage" files which make up the installed instance of GRUB
  |      itself. These files are created and refreshed using the
  |      "/sbin/grub-install" command and are called during boot-up from
  |      code contained in the MBR. There are generally several
  |      "<filesystem-type>_stage1_5" files to support booting from different
  |      kinds of filesystem.
  |
  |                 Minimum Linux kernel files needed to boot
  |                 -----------------------------------------
  |
  |- initrd-<version>   (initial RAM disc for specified kernel version)
  |- vmlinuz-<version>  (kernel image, compressed version)
  |
  |                 Other optional files (not 100% standardised,
  |                 generally used for development, debugging, or to
  |                 support use of 3rd party kernel modules)
  |                 ------------------------------------------------
  |
  |- vmlinux-<version>  (kernel image, uncompressed version)
  |- System.map-<version>  (lists functions and their memory addresses within
  |                        the kernel)
  |- backup_mbr          (presumably a backup of the MBR contents)
  |- config-<version>   (copy of the config file used to build the kernel,
  |                     so that you can see what it's config options
  |                     or use it to rebuild a new, similar kernel.
  |- initrd         (initial RAM disc image with no version number, probably a
  |                  symlink to the numbered version of the file?)
  |- vmlinuz        (kernel image with no version number, probably a symlink
  |                  to the numbered version of the file?)
  |- message           (text of message displayed when system booted?)
  \- symvers-<version>  (holds kernel function symbol information)

If you move the "stage" files about within /boot/grub you'll probably find 
that GRUB stops working and you have to re-run "/sbin/grub-install /dev/hda", 
as their on-disc addresses are embedded in the MBR (i.e. this part of the 
boot sequence works below filesystem level).

Regards,

James



More information about the Wolves mailing list