Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

How to make a stand-alone _bootable_ recovery DVD from Solaris 10

VIEWS: 22 PAGES: 4

									How to make a stand-alone (bootable) recovery DVD from Solaris 10 install.
Solaris Flash Archives

Sun has an archiving utility included with Solaris 10 called "flarcreate". It is a command line tool that can create a
"Solaris Flash Archive" snapshot of your disk. This image snapshot can then be copied to an NFS shared file-system.
To build a new workstation that is to be a copy of the original node, all one has to do is physically connect the new/
blank machine to the network so it can access the NFS mounted image and boot it off a Solaris 10 installation DVD.
Briefly put, the installation process will detect the network and ask the appropriate questions of what type of install
you want (flash archive) and what location to pull the image from (NFS file-system).

Considerations & Concerns

This was only a partial solution for me because Solaris 10 did not natively support the on-board NIC in the Intel
D201GLY motherboard on my system. NFS mounting anything during a build was out of the question. As mentioned
above, however, one of the questions asked during an install is what location to pull the image from. From the given
choices, you can select the local file-system, which means Solaris will pull it from the very boot media being used.
The trick is to put a flash archive in the installation DVD. It so happens that on the web there are various how-to
guides and FAQs explaining how to build such a stand-alone Solaris installation DVD. All of them, however, were for
older versions of Solaris like Solaris 8 or 9. This new OS is quite different in structure from previous versions and after
studying most of the how-to literature, I realized the enormity of adapting/upgrading said procedures to Solaris 10.

After even more research, I managed to find one individual who after requesting assistance from Sun and being told
"this isn't supported" figured it out for himself. His procedure is listed at efnet.net. I will be using a version of his
procedure modified to work on my system and I'll go through the flash image creation process as well. A few things of
note; the procedures assume you're logged in as the root user, the commands to type in are blue and you must
modify the steps to suit your particular machine's file-system names and layout.

Create The Flash Archive

It's important to select a partition slice that is at least large enough to hold the entire installed Solaris 10 image. The /
opt file-system on my test box was created in a separate slice (c0d0s7) for such operations. It is separate from the root
slice and has a generous 133 gigabyte capacity. Keep in mind that a DVD typically only holds about 4.7 Gigabytes,
so the flash archive plus the install kernel and tools must all fit within that limit. In addition, the author of the previously
mentioned procedure claims, "Intel systems seem to have issues with FLAR's over 2 GB in length." As a
consequence, it is best to create a flash archive soon after the node is built, drivers loaded, video, sound and
everything else configured, but before extra software is loaded so that the image size is still relatively small. Generally
speaking, the flash archive created in compressed format came in at 1.9 gigabytes and the boot image plus tools (I
deleted a lot of unnecessary packages from the install DVD) at an additional 0.93 gigabytes. Besides compression,
the flarcreate utility also allows you to exclude directories from the archive with the "-x" option to help in reducing the
size. I tend to install software, like Sun does, in the /opt directory, which makes it easy to find and exclude files using
flarcreate. In the following set of commands in italics, I create a subdirectory in /export called flash and create a flash
archive of the system in said directory. The "-x" argument is used to exclude the flash_images directory so that flash
archive does not try to create an archive of itself. More than one directory can excluded, but one "-x" must precede
each directory listed. Other notes about flarcreate arguments; -n indicates the title of the archive, -R indicates the top-
level directory (in this case /), -a indicates the author, -c by itself is compressed format, -e indicates comments, and
the last argument is the name of the file created. If the flarcreate command is run without the "-c" option/argument the
flash image created will be 3.2 Gigabytes in size.

cd /export
mkdir flash
flarcreate -n solaris10_x86_eis1107 -R / -a "stefano.pini@sun.com" -c -e "Solaris 10 X86
with EisDvd Nov 2007" -x /export/flash /export/flash/solaris10_x86_eis1107.flar

Copy The Solaris Installation DVD To The Local Drive

For the same reasons mentioned earlier, create a working directory in the /export to copy the contents of the DVD.
Insert the Solaris 10 installation DVD in the drive and allow the volume manager to mount it (if the volume manager is
disabled, enable it using the command: svcadm restart volfs ).

cd /export
mkdir sol10dvd
cd /cdrom/cdrom0
find . -print | cpio -dump /export/sol10dvd/

The last command will take a long time, but please allow it to finish. To minimize the size of the ISO image, delete
most of the unneeded Solaris software packages (SUNW*) and then copy the flash archive in to the new working
directory.

cd /export/sol10dvd/Solaris_10/Product
rm -rf SUNW*
cp /export/flash/solaris10_x86_eis1107.flar /export/sol10dvd/

Create a Solaris Jumpstart Profile
I'm not sure this step is necessary in order for the flash archive to work, but as a precaution create a
"flashinstall_profle". It is recommended that you use a plain text ASCII editor like vi or gedit for all the file
modifications. Any other kind of editor might leave hidden characters in the documents. Also, please be sure to
always save after editing.

cd /export/sol10dvd/.install_config/
vi flashinstall_profile

Add the lines below to the file. Keep in mind that the "archive location" line reflects the name of my flash archive and
the "filesys" lines reflect my filesystem layout. Modify to suit.

install_type flash_install
archive_location local_file /cdrom/solaris10_x86_eis1107.flar
partitioning explicit
filesys rootdisk.s0 20480 /
filesys rootdisk.s1 20480 swap
filesys rootdisk.s2 all overlap
filesys rootdisk.s5 20480 /var

The "filesys rootdisk.s2 all overlap" line is of particular interest. This is the slice that represents the whole partition
encompassing all the other slices (uses the "all" designation in the size field). It's not mounted like the other slices but
it's part of the layout overhead used by Sun. The last slice has the size designation of "free" which means all the
leftover space once the other slices are created (it turned out to be 133 Gigabytes in my case).

Creating & Validating The Rules File

Again, I'm not sure this step is necessary in order for the flash archive to work, but as a precaution a "rules" file should
be created and checked.

mv rules.ok rules.ok.orig
echo "any - - flashinstall_profile -" > rules
/export/sol10dvd/Solaris_10/Misc/jumpstart_sample/check

The resulting output from the last command should look similar to:

Validating rules...
Validating profile flashinstall_profile...
The custom JumpStart configuration is ok.

Uncompressing & Mounting The Miniroot Environment

The miniroot is a small compressed (gzip) file-system used by the kernel that has necessary tools for an install. It is in
an ISO image format. To access and edit its contents, we must first uncompress (gunzip) it, then mount the resulting
image directly into the file system (/mnt) with the commands of lofiadm, and mount.

cd /export/sol10dvd/boot
mv x86.miniroot x86.miniroot.gz
gunzip x86.miniroot.gz
lofiadm -a `pwd`/x86.miniroot
mount /dev/lofi/1 /mnt

Please note that `pwd` in the fourth command above is not surrounded by apostrophes but graves - the backwards
facing apostrophes usually found on the same key as the tilde (~). Also, the lofiadm instance created will be the
number one (not the letter l), so make sure the last command has /dev/lofi/1.

Editing profind In the Miniroot

Open the file profind (vi /mnt/usr/sbin/install.d/profind) and locate the following section of code and insert the lines
after the comment:

cdrom()
{
    # Factory JumpStart is only allowed with factory
    # stub images, indicated by the file /tmp/.preinstall
    #
    if [ -f /tmp/.preinstall ]; then
    mount -o ro -F lofs ${CD_CONFIG_DIR} ${SI_CONFIG_DIR}>/dev/null 2>&1
    if [ $? -eq 0 ]; then
    verify_config "defaults" "CDROM"
    fi
    fi

     # Added to profind (Stefano Pini Sun)
     gettext "<<< using CD default >>>";echo
     rmdir ${SI_CONFIG_DIR}
     ln -s /cdrom/.install_config ${SI_CONFIG_DIR}
     exit 0
     # End of profind modifications
}

Editing the sysidcfg File

cd /mnt/etc
mv sysidcfg sysidcfg.orig            (IMPORTANTE!!!)
vi sysidcfg

Insert the following lines (modify to suit your environment). Also, copy and paste the encrypted root password (from /
etc/shadow) in the line beginning with "root_password=" as show below.

terminal=vt100
keyboard=US-English
timeserver=localhost
timezone=MET
system_locale=C
security_policy=NONE
nfs4_domain=dynamic
name_service=NONE
root_password=CUaW0QA6cQDrQA           root copied from /etc/shadow


Unmount & Re-compress The Miniroot

cd /
umount /mnt
lofiadm -d /dev/lofi/1
cd /export/sol10dvd/boot
gzip -9 x86.miniroot
mv x86.miniroot.gz x86.miniroot

Create The ISO Image

Type the below lines (each ending with a "\" except the last line) to create a burnable ISO image called
sol10x86dvd.iso.

cd /export
mkisofs -eltorito-boot boot/grub/stage2_eltorito -no-emul-boot \
-boot-load-size 4 -boot-info-table -r -ldots -disable-deep-relocation \
-full-iso9660-filenames -relaxed-filenames -omit-period \
-omit-version-number -o sol10x86dvd.iso ./sol10dvd

You should see the following output:

Warning: creating filesystem that does not conform to ISO-9660.
Using INTRO000.3TSOL for ./sol10dvd/Solaris_10/ExtraValue/CoBundled/Trusted_Extensions/
Packages/ SUNWtsman/reloc/usr/share/man/man3tsol/intro.3tsol (Intro.3tsol)
Size of boot image is 4 sectors -> No emulation
0.36% done, estimate finish Sat Sep 1 02:27:06 2007
0.71% done, estimate finish Sat Sep 1 02:27:06 2007
<snip>
99.62% done, estimate finish Sat Sep 1 02:29:27 2007
99.97% done, estimate finish Sat Sep 1 02:29:28 2007
Total translation table size: 2048
Total rockridge attributes bytes: 435369
Total directory bytes: 2729984
Path table size(bytes): 19082
Max brk space used 3dc000
1405369 extents written (2744 MB)

Burn The ISO Image to A DVD

Finally, insert a blank DVD and burn the ISO image using the commands below. An alternative is to copy the image
on a thumb-drive or ftp it to a Windows/Mac machine and burn it using a popular CD/DVD burning application.

priocntl –c RT –e –p 59 cdrw –i sol10x86dvd.iso

Boot DVD

Turn on the system and with Grub or OBP add "- install' at the end of the boot line

Results & Conclusions

I must admit I was pretty apprehensive at first about trusting this procedure to produce a viable stand-alone recovery
disk. Since I needed this image to do further research on Solaris 10 and I didn't want to start the tedious process of
recreating it from scratch if the recovery disk failed, I broke down and bought another identical hard drive and
swapped it in place of the original one. Fortunately, the drives were still on sale. As it turned out, the recovery worked
flawlessly - my system was easily booted and "cloned" from the DVD in about 45 minutes.

However, there were some discrepancies that made me question some parts of the procedure. During the recovery
disk's installation process, I was asked the usual questions about node name, root password, IP address, netmask,
disk partitioning and file-system layout. I wonder if I had entered different information if it would have overridden the
information on the flash image. If so, the sections titled "Create A Solaris Jumpstart Profile", "Creating & Validating
The Rules File" and maybe others may not have been necessary. Unless one of my readers knows and writes to tell
us in the forum, that will be another project for me at a future time. One thing that was left undone was the networking
setup. Despite the information already existing in the flash archive and me entering it in the sysidcfg file inside the
miniroot, the system came up without networking configured. The drivers and devices were there, but I had to go
through the usual Sun network setup procedures (ifconfig command) of plumbing and configuring the device, and
entering the appropriate information in the /etc/hosts, /etc/hostname.sfe0, and /etc/netmasks files. Not much work, but
still puzzling.

Overall, the stand-alone recovery disk is a reliable way to ensure you can duplicate the OS plus default software
baseline of your patched and configured node with little time and hassle. Because of the size limitations of current
DVDs, it's recommended that any additional software or important/personal files you wish to keep be backed up on
separate media. Finally, I wish to thank the individual(s) at efnet.net for posting their work titled
"x86_Flash_DVD_for_Sun.htm" on-line so that we could all benefit from their experience.


http://corp.efnet.net/~sporq/x86_Flash_DVD_for_Sun.htm
http://www.sun.com/bigadmin/collections/solarisx86.html

								
To top