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

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

wiki:pretce [2011/10/24 16:10]
gerald_clark [Create a lvm2-boot.tcz]
wiki:pretce [2013/12/10 08:20] (current)
gerald_clark [Create lvm2-boot.tcz]
Line 1: Line 1:
-====== Putting tce on an existing LVM ======+====== Putting tce on an existing RAID or 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.+Starting with V 4.1 you can have your tce directory on a RAID or an LVM. To accomplish this, we need to be able to load RAID or LVM drivers 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 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 **/pre** and that the logical volume we will be using is **dm-0**.+The following steps assume that the boot partition is **/dev/sda1**, the directory to use is **/pre** and that the logical volume we will be using is **dm-0**. This has also been tested with **md126** RAID 1 device.
 It is based on my CentOS 5 installation that boots off /dev/sda1 and has 2 logical volumes ( root and swap ). It is based on my CentOS 5 installation that boots off /dev/sda1 and has 2 logical volumes ( root and swap ).
  
Line 12: Line 12:
 Here we are going to be booting out of **/dev/sda1** and loading the lvm2 extensions out of **/mnt/sda1/pre**: 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**.   * Boot with the options: **tce=sda1/pre**.
 +  * Run **tce-load -iw mdadm**.
   * Run **tce-load -iw lvm2**.   * Run **tce-load -iw lvm2**.
   * Run **vgchange -ay**.   * Run **vgchange -ay**.
-  * Identify the LVM name in /mnt that contains the filesystem you want to contain the tce directory. Mine is **dm-0**.+  * Identify the RAID volume or LVM name in /mnt that contains the filesystem you want to contain the tce directory. Mine is **dm-0** or **md126**.
   * Reboot.   * Reboot.
  
-==== Create lvm2-boot.tcz ====+==== Create mdadm-boot.tcz ==== 
 +Starting with dCore and Core 5.1 mdadm-boot.sce is no longer needed. 
 +Instead, you can put the line **mdadm -A --scan ; sleep 2** into an executable shell script named **onpre.sh** in the pretce directory. 
 +The shell script **onpre.sh** is run after all the pretce packages are loaded. 
 + 
 +We need an extension that activates the RAID volumes. The following script will create it. 
 +<code> 
 +#!/bin/sh 
 +WORK=work-mdadm-boot 
 +DIR=$WORK/usr/local/tce.installed 
 +PKG=mdadm-boot 
 +FILE=$PKG.tcz 
 +cd /tmp 
 +rm -rf $WORK $FILE 
 +mkdir -p $DIR 
 +echo -e "#!/bin/sh\n/usr/local/sbin/mdadm -A --scan ; sleep 1" > $DIR/$PKG 
 +chmod -R 775 $WORK 
 +chown -R root:staff $WORK 
 +mksquashfs $WORK/ $FILE 
 +</code> 
 + 
 +  * Run **tce-load -iw squashfs-tools**. 
 +  * Run **mount /mnt/sda1**. 
 +  * Save the above script to **/tmp/mkmdadm-boot**. 
 +  * Run **cd /tmp**. 
 +  * Run **sh mkmdadm-boot**. 
 +  * Mv **mdadm-boot.tcz** to **/mnt/sda1/pre/optional/**. 
 +  * Add the line **mdadm-boot.tcz** to the end of **/mnt/sda1/pre/onboot.lst**. 
 +  * If you do not want the pretce device to remain mounted, be sure to add the **copy2fs.flg** file to the pretce directory. 
 + 
 +==== Create lvm2-boot.tcz ==== 
 +Starting with dCore and core 5.1 lvm2-boot.sce is no longer needed. 
 +Instead, you can put the line **vgchange -ay ; sleep 2** into an executable shell script named **onpre.sh** in the pretce directory. 
 +The shell script **onpre.sh** is run after all the pretce packages are loaded. 
 We need an extension that activates the lvm2 volumes. The following script will create it.  We need an extension that activates the lvm2 volumes. The following script will create it. 
 <code> <code>
Line 41: Line 76:
   * Mv **lvm2-boot.tcz** to **/mnt/sda1/pre/optional/**.   * Mv **lvm2-boot.tcz** to **/mnt/sda1/pre/optional/**.
   * Add the line **lvm2-boot.tcz** to the end of **/mnt/sda1/pre/onboot.lst**.   * Add the line **lvm2-boot.tcz** to the end of **/mnt/sda1/pre/onboot.lst**.
 +  * If you do not want the pretce device to remain mounted, be sure to add the **copy2fs.flg** file to the pretce directory.
 +
  
 ==== Boot Entry ==== ==== Boot Entry ====
Line 47: Line 84:
 The format of this entry will depend on the bootloader you are currently using. The format of this entry will depend on the bootloader you are currently using.
  
-Add the boot options **pretce=sda1/pre tce=dm0**.+For RAID, add the boot options **pretce=sda1/pre tce=md126**. 
 + 
 +For LVM,  add the boot options **pretce=sda1/pre tce=dm-0**.
  
-Reboot and verify that /opt/.tce_dir contains /mnt/dm-0/tce or whatever is correct for your machine ).+Reboot and verify that /opt/.tce_dir contains **/mnt/md126/tce**, or **/mnt/dm-0/tce** , or whatever is correct for your machine.
Print/export