Creating an fstab /w Ubuntu 8.04 derivatives

The following tutorial is meant to be used alongside a tutorial for creating a Ubuntu 8.04 derivative. To create a Ubuntu 8.04 derivative from scratch for instance follow these steps: https://help.ubuntu.com/community/LiveCDCustomizationFromScratch.

On most *ix systems a file exists that is used to determine where partitions are found. In Microsoft Windows a USB flash drive shows up as a drive such as “E:\”. On GNU/Linux systems a USB flash drive shows up as a location relative to “/”. For instance the contents of a flash drive might show up in “/mnt/sdb1” or “/media/USB Flash Drive”. What determines this location is specified in the “/etc/fstab” file

A LiveCD is a computer operating system that runs from CD without needing to be installed. Most users install GNU/Linux systems from LiveCD. Most LiveCDs detect the partitions and drives of a system automatically and create an fstab file when booting. This overwrites the “/etc/fstab” file.

Modifying a LiveCD is sometimes called remastering or customizing. When creating a derivative distribution most configuration files are found in the same places they would be located after an install. Although the “/etc/fstab” file will exist in most cases it won’t be utilized when booting from a LiveCD. The reason is a script detects the drives and creates the file automatically.

During the initialization of the LiveCD system a temporary root filesystem is created, and if this filesystem contains a program “/init” then the system boots. In Ubuntu 8.04 the “/init” program is Initiramfs-tools.

Casper is a hook for initramfs-tools to boot live systems. The Casper scripts are contained in a file called initrd.gz. A solution to being unable to modify the “/etc/fstab” manually is to make changes to the Casper scripts which create it instead.

  • chroot chroot_dir /bin/bash
  • nano /usr/share/initramfs-tools/scripts/casper-bottom/12fstab
  • Add any changes for fstab between "cat > $FSTAB <<EOF" and "EOF"
  • mkinitramfs -o /new-initrd.gz `uname -r`
  • If the system you are using uses a different kernel than the one on the LiveCD replace 'uname -r' with the one you are using on the LiveCD.
  • exit
  • mv chroot_dir/new-initrd.gz image/casper/initrd.gz


Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s


%d bloggers like this: