Faster boot

I usually do not care too much about my system boot time. Slackware running on modern hardware, especially with a SSD for / (root file system) will boot very fast without any additional tweaking. My laptop, however, does not have a SSD and although the machine is relatively new, I find it convenient to speed up the booting a little more.

important I just want to state clearly that messing with the boot process is not recommended! Improper editing of rc.M can and will cause problems!

That being said, here’s what I do:

First, I open /etc/lilo.conf and uncomment the following line in the beginning:

# LILO configuration file
# generated by 'liloconfig'
#
# Start LILO global section
boot = /dev/sda

compact        # faster, but won't work on all systems.

The warning speaks for itself, if you uncomment the line make sure to run lilo for the settings to take effect:

lilo -v

Then, I open /etc/rc.d/rc.M and comment out all steps from the boot process, which I think I do not need. In my case, these are the following sections:

  • Update the X font indexes
  • Update any existing icon cache files
  • Update mime database

I copy these sections (uncommented, as they were originally in rc.M) to a new bash script file and save it as a cron job. Let’s name it house-clean.sh:

#!/bin/sh

# Update the X font indexes:
if [ -x /usr/bin/fc-cache ]; then
  echo "Updating X font indexes:  /usr/bin/fc-cache -f &"
  /usr/bin/fc-cache -f &
fi

# Update any existing icon cache files:
if find /usr/share/icons 2> /dev/null | grep -q icon-theme.cache ; then
  for theme_dir in /usr/share/icons/* ; do
    if [ -r ${theme_dir}/icon-theme.cache ]; then
      echo "Updating icon-theme.cache in ${theme_dir}..."
      /usr/bin/gtk-update-icon-cache -t -f ${theme_dir} 1> /dev/null 2> /dev/null &
    fi
  done
  # This would be a large file and probably shouldn't be there.
  if [ -r /usr/share/icons/icon-theme.cache ]; then
    echo "Deleting icon-theme.cache in /usr/share/icons..."
    #/usr/bin/gtk-update-icon-cache -t -f /usr/share/icons 1> /dev/null 2> /dev/null &
    rm -f /usr/share/icons/icon-theme.cache
  fi
fi

# Update mime database:
if [ -x /usr/bin/update-mime-database -a -d /usr/share/mime ]; then
  echo "Updating MIME database:  /usr/bin/update-mime-database /usr/share/mime &"
  /usr/bin/update-mime-database /usr/share/mime 1> /dev/null 2> /dev/null &
fi

and make it executable:

chmod +x house-clean.sh

Now, save it as /etc/cron.daily/house-clean.sh — if you decide to execute it yourself, just run it from the terminal.

I make these tweaks only after I have set up my new system, installed additional fonts, etc. The laptop boots faster, which sometimes can be important.

Here is a LQ discussion concerning this and a post from another blog.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s