Live CD boot time can be shortened significantly by laying out files on CD (or more precisely in SquashFS image) in such way that CD-ROM head movements are minimized.


Faster boot time means a better user experience. Inexperienced users might also think time to boot from CD will be the same as time to boot from hard disk.

Use cases

  • Alice gets Ubuntu live CD from friend, boots it, but starting takes 3 minutes, so she gets discouraged and thinks every time Ubuntu boots she will have to wait for 5 minutes.
  • Bob gets the new and optimized version of the live CD. It boots quickly so he is happy and installs Ubuntu.
  • Charlie uses live CD as portable system as it boots quickly, he takes the live CD to friends and encourages them this way to try Ubuntu.


  • Need a way to record which files are opened, together with timing information. This is then post-processed into a weighted list fed to mksquashfs as part of the livefs build process


  • A tool records all open(2) calls through a kernel module using the kprobe interface. Using inotify for a system-wide recording of all open(2) calls is quite cumbersome and the alternative is a kernel patch.
  • The list of files is then retrieved and post-processed into a weighted list of file names. http://blogs.sun.com/roller/page/moinakg/20060426 has an interesting idea of using a non-naive optimisation, but we will have to see how much the initial run gets us.

  • The list of weights is passed to the livefs build process.


  • The kernel need to include support for kprobes (or a custom kernel needs to be used on the live cd when instrumenting)
  • A kprobe which registers all open(2) calls and when they are done is included in the initramfs and loaded early in the boot process.
  • Instrumentation data is recorded when booting and recovered when the probe is rmmod-ed at the end of the boot.
  • The list of files is post-processed, first by a trivial "order by first access" approach, with a possibility for using a "sliding window" approach later and assigned weights in the format required by mksquashfs

  • Said list of files is fed to the livefs build process.

Unresolved Issues

  • How and when will this list be updated? It should be done at least for beta and RC/final to account for changes during the development cycle --MattZimmerman

  • It'll be added to the list of tasks to be done for each milestone (see MilestoneRhythm) -- TollefFogHeen


OptimizedLiveCDLayoutForFasterBoot (last edited 2008-08-06 16:35:04 by localhost)