Welcome to the Tiny Core Linux Wiki at tinycorelinux.net!

This is an old revision of the document!


Putting tce on an existing LVM

Starting with V 4.1 you can have your tce directory on an LVM. To accomplish this, we need to be able to load LVM before tc-config scans for the tce directory.

The bootcode pretce=dev/dir will allow us to preload a set of extensions. This bootcode does not have a default directory name. If you omit the /dir portion, tc/mc will look for onboot.lst and optional/ in the partition's root directory.

The following steps assume that the boot partition is /dev/sda1, the directory to use i /pre and that the logical volume we will be using is dm-0. It is based on my CentOS 5 installation that boots off /dev/sda1 and has 2 logical volumes ( root and swap ).

Initial Setup

We need to know the boot partition and directory where we are going to store the LVM extensions. Here we are going to be booting out of /dev/sda1 and loading the lvm2 extensions out of /mnt/sda1/pre:

  • Boot with the options: tce=sda1/pre.
  • tce-load -iw lvm2
  • vgchange -ay
  • Identify the LVM name in /mnt that contains the filesystem you want to contain the tce directory. Mine is dm-0.
  • Reboot

Create a lvm2-boot.tcz

We need an extension that activates the lvm2 volumes. The following script will create it.

#!/bin/sh
WORK=work-lvm2-boot
DIR=$WORK/usr/local/tce.installed
PKG=lvm2-boot
FILE=$PKG.tcz
cd /tmp
rm -rf $WORK $FILE
mkdir -p $DIR
echo -e "#!/bin/sh\nsleep 1\n/usr/local/sbin/vgchange -ay\nsleep 1" > $DIR/$PKG
chmod -R 775 $WORK
chown -R root:staff $WORK
mksquashfs $WORK/ $FILE
  • tce-load -iw squashfs-tools
  • mount /mnt/sda1
  • Save the above script to /tmp/mklvm2-boot.
  • cd /tmp
  • sh mklvm2-boot
  • Copy the lvm2-boot.tcz to /mnt/sda1/pre/optional/lvm2-boot.tcz.
  • Add the line lvm2-boot.tcz to the end of /mnt/sda1/pre/onboot.lst

Boot Entry

I am not going to instruct you here on how to add a boot entry to your boot loader config file. You need to be able to boot tc/mc from your hard drive before you can add additional boot options. The format of this entry will depend on the bootloader you are currently using.

Add the boot options pretce=sda1/pre tce=dm0.

Reboot and verify that /opt/.tce_dir contains /mnt/dm-0/tce ( or whatever is correct for your machine ).

Print/export