Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
wiki:pretce [2011/10/27 00:44] – [Putting tce on an existing RAID or LVM] gerald_clark | wiki:pretce [2013/12/10 11:20] (current) – [Create lvm2-boot.tcz] gerald_clark | ||
---|---|---|---|
Line 5: | Line 5: | ||
The bootcode **pretce=dev/ | The bootcode **pretce=dev/ | ||
- | The following steps assume that the boot partition is **/ | + | The following steps assume that the boot partition is **/ |
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 **/ | Here we are going to be booting out of **/ | ||
* Boot with the options: **tce=sda1/ | * Boot with the options: **tce=sda1/ | ||
+ | * 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 | + | ==== Create |
+ | 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. | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | WORK=work-mdadm-boot | ||
+ | DIR=$WORK/ | ||
+ | PKG=mdadm-boot | ||
+ | FILE=$PKG.tcz | ||
+ | cd /tmp | ||
+ | rm -rf $WORK $FILE | ||
+ | mkdir -p $DIR | ||
+ | echo -e "# | ||
+ | chmod -R 775 $WORK | ||
+ | chown -R root:staff $WORK | ||
+ | mksquashfs $WORK/ $FILE | ||
+ | </ | ||
+ | |||
+ | * Run **tce-load -iw squashfs-tools**. | ||
+ | * Run **mount / | ||
+ | * Save the above script to **/ | ||
+ | * Run **cd /tmp**. | ||
+ | * Run **sh mkmdadm-boot**. | ||
+ | * Mv **mdadm-boot.tcz** to **/ | ||
+ | * Add the line **mdadm-boot.tcz** to the end of **/ | ||
+ | * If you do not want the pretce device to remain mounted, be sure to add the **copy2fs.flg** file to the pretce directory. | ||
+ | |||
+ | ==== Create | ||
+ | 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. | ||
< | < | ||
Line 41: | Line 76: | ||
* Mv **lvm2-boot.tcz** to **/ | * Mv **lvm2-boot.tcz** to **/ | ||
* Add the line **lvm2-boot.tcz** to the end of **/ | * Add the line **lvm2-boot.tcz** to the end of **/ | ||
+ | * 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/ | + | For RAID, add the boot options **pretce=sda1/ |
+ | |||
+ | For LVM, add the boot options **pretce=sda1/ | ||
- | Reboot and verify that / | + | Reboot and verify that / |