Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, At which level of booting the boot configurations are saved as last good configuration? What happens if kernel crashes after the good boot has been saved?...
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    9

    last good boot entry in menu.lst

    Hi,

    At which level of booting the boot configurations are saved as last good configuration? What happens if kernel crashes after the good boot has been saved?

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    Are you referring to GRUB's savedefault option? What this does is simply to mark the most recent kernel booted as the default boot option. If you also configure GRUB to treat the last saved boot as its default, it will load this kernel every time until you specify a different one.

    The kernel itself doesn't need to be "saved". There's a permanent copy of it in your /boot directory.

    As for the kernel crashing after the boot, that never happens. Linux is very stable. A kernel that you have built yourself may fail to boot but you almost never have that sort of problem with a pre-compiled stock kernel.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  3. #3
    Just Joined!
    Join Date
    Nov 2010
    Posts
    9
    Thanks for your response, Hazel.
    I am telling about the last good boot option which helps us to boot into the last successfully booted kernel. I have read that "Once the machine is booted successfully, an init script will take notice and copy the existing resources away (out of package control, so it wont be overwritten or removed). Several things are saved:

    * /boot/vmlinuz-KVER
    * /boot/Systemp.map-KVER
    * /boot/initrd.img-KVER
    * /lib/modules/KVER/*

    These are saved to a special location:

    * /boot/last-good-boot/{vmlinuz,System.map,initrd.img}
    * /lib/modules/last-good-boot/*
    * /boot/last-good-boot/version (the real uname -r of the saved kernel for reference)
    * /lib/modules/last-good-boot/modules.dep (munged from original to change module locations) "

    I want to know at which stage of booting these are saved? When a boot is considered as successful?

  4. #4
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    This looks like the kind of thing that happens after installing a new Linux system. Different distributions have different ways of ensuring that the installation was successful. You don't say which one you are using.

    Once a working vmlinuz, system.map and initrd image have been put in /boot, they stay there and are used in every subsequent boot. Unlike the Windows registry, which needs to be saved after every successful boot, these files are used on a read-only basis. Similarly with the kernel modules in /lib/modules.

    If the work is really being done by an init script, then it runs after the real boot is complete. When you boot, first the bootloader loads the kernel, then the kernel does hardware diagnostics and loads the initrd image (if you are using one), then scripts in the initrd find the root partition and mount it (or the kernel may go straight to the root partition if it's been set up to do that). Finally the kernel launches /sbin/init and init launches the cascade of scripts that start up the system services. But the boot proper is already complete by this time.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  5. #5
    Just Joined!
    Join Date
    Nov 2010
    Posts
    9
    And one more question ,
    Where would the last good boot be configured/saved in a system running on SUSE?

  6. #6
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    SUSE may not have the "last good boot" option in GRUB. It seems to be very much an Ubuntu thing. It's also found in Mint, which is an Ubuntu derivative. I don't know how many other distros do this; Debian certainly doesn't.

    Apparently "last good boot" was introduced to solve the problem of the GRUB menu getting clogged up with old kernels that the user has not bothered to remove. Since updating a kernel can lead to boot failure, at least one old kernel needs to be preserved for safety. Saving it as "last good boot" rather than as vmlinuz-KVER ensures that there is only one.

    That seems to me very much in line with the Ubuntu philosophy of making life easy for the user.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...