Using the MilaX Live CD for failsafe booting

Version 6 by bnsmb
on Jun 14, 2009 11:18.

compared with
Current by bnsmb
on Nov 14, 2009 04:24.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (69)

View page history

 
{section}


{column:width=20%}
 
{include:TOC for Tech Tips}
{column}
 
{column:width=55%}

 
h1. Using the MilaX Live CD for failsafe booting

by Bernd Schemmer, June 2009
{toc}
Homepage: [http://www.bnsmb.de/]
 
*Table of contents*

{toc}
h2. History

|| Version/Date || Changes \\ ||
| June 2009 v1.00/bs \\ | inital release for MilaX 0.3.3 \\ |
| 14.06.2009 v1.01/bs \\ | \- added support for MilaX 0.4 to the script [copy_milax_to_img.sh|#copy_milax_to_img.sh] \\
\- corrected a spelling error: LOFI_DIEV instead of LOFI_DEV \\ |
| 15.06.2009 v1.02/bs \\ | \- corrected a synatx error (lofiadm without the \-a) \\ |
| 08.11.2009 v1.03/bs \\ | \- added a link to the page with information about [how to convert the MilaX Live CD to a WANBOOT image|http://wikis.sun.com/display/BigAdmin/Converting+the+MilaX+Live+CD+for+SPARC+to+a+WANBOOT+image] \\ |
| 14.11.2009 v1.04/bs\\ | \- added a link to the page with information about [how to use the MilaX Live CD for failsafe booting on SPARC machines|http://wikis.sun.com/display/BigAdmin/Using+the+MilaX+Live+CD+for+failsafe+booting+for+SPARC+machines] \\ |

[Adding a Live CD Distribution to an existing Solaris installation|http://wikis.sun.com/display/BigAdmin/Adding+a+Live+CD+Distribution+to+an+existing+Solaris+installation]
[Converting the MilaX Live CD for SPARC to a WANBOOT image|http://wikis.sun.com/display/BigAdmin/Converting+the+MilaX+Live+CD+for+SPARC+to+a+WANBOOT+image]
 
[Using MilaX Live CD for failsafe booting for SPARC machines|http://wikis.sun.com/display/BigAdmin/Using+the+MilaX+Live+CD+for+failsafe+booting+for+SPARC+machines]
h2. Creating a failsafe image with MilaX for the Solaris OS on x86 Platforms
The first step is to create a file for the image:
{code}
# {code}# Note: /mnt/solaris0 is mounted to the internal hard disk in this example
#
(root@milax) # mkfile -n 500m /mnt/solaris0/milax_img
{code}
{code}Next lofi mount the image, create a filesystem on the lofi device, and mount the lofi device:
 
{code}
{code}(root@milax) # LOFI_DEV=$( lofiadm -a /mnt/solaris0/milax_img ) && \
newfs ${LOFI_DEV}

(root@milax) # mount ${LOFI_DEV} /tmp/milax
{code}
{code}Then copy the script *copy_milax_to_img.sh* (see the appendix) [copy_milax_to_img.sh|#copy_milax_to_img.sh] to the machine, make it executable using chmod, and execute it, e .g
 
{code}
{code}(root@milax) # ./copy_milax_to_img.sh /tmp/milax
Starting to copy data from UFS root to /tmp/milax - this may take some time.
/tmp/milax/etc/crypto/certs/SUNWObjectCA linked to /tmp/milax/etc/certs/SUNWObjectCA

###################################################################
{code}
{code}After the script is done, rename the kernel in the image.
 
{code}
{code}(root@milax) # mv /tmp/milax/platform/i86pc/kernel/unix /tmp/milax/platform/i86pc/kernel/milax_unix
{code}
{code}Then umount the image and delete the lofi device:
 
{code}
{code}(root@milax) # umount /tmp/milax

(root@milax) # lofiadm -d ${LOFI_DEV}
{code}
{code}Now copy the image file, */mnt/solaris0/milax_img* in this example, to a save place.

Then lofi mount the image:
{code}
{code}bash-3.2# mkdir /tmp/milax
 
bash-3.2# mount $( lofiadm -a /milax/milax_img ) /tmp/milax
{code}
{code}Copy the kernel from the image to the hard disk.
 
{code}
{code}bash-3.2# cp /tmp/milax/platform/i86pc/kernel/milax_unix /milax/platform/i86pc/kernel/milax_unix
{code}
{code}And umount the image and delete the lofi device:
 
{code}
{code}bash-3.2 # umount /tmp/milax

bash-3.2# lofiadm -d /milax/milax_img
{code}
{code}And last, add an additional entry for MilaX failsafe to the GRUB boot menu:
 
{code}
{code}title MilaX 0.3.3 (32 Bit) (failsafe)
findroot (pool_rpool,0,a)
kernel$ /platform/i86pc/kernel/milax_unix
module$ /milax/milax.img
{code}
{code}That's it; now you can boot the failsafe image with MilaX for maintenance tasks on your main Solaris installation.
 
Note that the MilaX failsafe image is not machine dependent; you can copy it to any x86 machine.
*Update 15.06.2009:*
 
-Note that the MilaX failsafe image is not machine dependent; you can copy it to any x86 machine.-
 
 
h2. Customizing the failsafe image
Lofi mount the image:
{code}
{code}bash-3.2# mkdir /tmp/milax
 
bash-3.2# mount $( lofiadm -a /milax/milax_img ) /tmp/milax
{code}
{code}Now do your customizations.

And finally, umount the image again:
{code}
{code}bash-3.2 # umount /tmp/milax

bash-3.2# lofiadm -d /milax/milax_img
{code}
 
h2. Troubleshooting
To get around this bug simply kill the X Server (using CTRL-ALT-BACKSPACE) and restart the X Server using the command startx, e.g.
{code}(alex@milx) # startx
{code}
(alex@milx) # startx
{code}
h3. How to use more than one MilaX failsafe image
h3. copy_milax_to_img.sh
{code}#!/usr/bin/ksh
#!/usr/bin/ksh
#
# CDDL HEADER START

{column}
 
{section}

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact