Bootable solaris cd backup


 
Thread Tools Search this Thread
Operating Systems Solaris Bootable solaris cd backup
# 1  
Old 10-11-2005
Bootable solaris cd backup

Hi ppl!
Does anyone know of how to make a bootable solaris cd backup Smilie
i have mkisofs installed and plan to burn the bootable image on pc with cdwriter on it...
thanx
# 2  
Old 10-11-2005
Try this - no clue if it works or not.

Code:
Creating a Bootable Solaris Recovery CD
by Mark A. Hershberger

Solaris, unlike some other Operating Systems, does not ship with a method for creating bootable recovery media. The following procedure is one that I've been able to devise after searching for more help on the matter.

In documenting this process, I will first show you how to create a bootable recovery disk. Once that is successful, I'll describe how to create a bootable CDROM.

Slice 1 - the driver for the recovery

The partition we are going to build is a bit large - 200MB. You could make it smaller by squeezing stuff out, but it is fine for our purposes since the recovery image is generally quite small (less than 100MB for the core install).

I did this with a SCSI disk attached to an UltraSPARC 5. Using format, I created two partitions, a 200MB slice 1 (c1t1d0s1) and a 450MB (c1t1d0s0, to emulate the room remaing on the CD) slice 0. After partitioning the disk with format and with the Solaris 8 Software CD (Disk 1 of 2, 2/02 edition) at c0t2d0, I went through the following steps:

   1. Create a filesystem on slice 1 of the partitioned disk:

    # newfs /dev/rdsk/c1t1d0s1

   2. Mount slice 1 of the disk:

    # mount /dev/dsk/c1t1d0s1 /mnt

   3. Mount slice 1 of the install CD:

    # mount -o ro /dev/dsk/c0t2d0s1 /cdrom

   4. Copy the contents of slice 1 on the CD to the disk:

    # cd /cdrom; tar cf - .tmp_proto . | (cd /mnt; tar xf -)

   5. Unmount the slice 1 of the CD and mount slice 0:

    # umount /cdrom; mount -F hsfs /dev/dsk/c0t2d0s0 /cdrom

   6. Copy the filesystem from Solaris*/Tools/Boot to slice 1 of the disk, taking care not to copy over openwindows:

    # cd /cdrom/Solaris*/Tools/Boot
    # tar cf - a bin a cdrom devices kernel mnt \
      platform reconfigure  tmp var bin dev etc lib opt    \
      proc sbin usr/bin usr/ccs usr/kernel usr/kvm usr/lib \
      usr/old usr/perl5 usr/platform usr/preserve usr/proc \
      usr/pub usr/sadm usr/sbin usr/share usr/snadm        \
      usr/spool usr/src usr/tmp usr/usr usr/xpg4 | (cd /mnt;
      tar xf -)

      You probably don't have to copy all of that stuff, but the important thing is to avoid copying usr/dt and usr/openwin.
   7. Remove /mnt/etc/sysidcfg and replace it with a symlink to ../cdrom/sysidcfg:

    # rm /mnt/etc/sysidcfg
    # ln -s ../cdrom/sysidcfg /mnt/etc/sysidcfg

   8. (This step can be done by applying this patch.) Patch /mnt/sbin/rcS so that it will look at the CD for boot information rather than trying to get the information from the network. To do this, replace these lines:

if [ $USING_DHCP -eq 1 ] ; then
	echo "Using DHCP for network configuration information."
	dhcp_find_and_mount_cdrom
    else
	echo "Using RPC Bootparams for network configuration information."
	bootparams_find_and_mount_cdrom
fi

      with these:

if [ ! -f /cdrom/sysidcfg ]; then
  cdrom=CdRoMmOuNtPoInTgOeShErE
  mount -F hsfs $cdrom /cdrom
  if [ ! -f /cdrom/sysidcfg ]; then
    echo Rescue CD
    if [ ! -z "${dial_pid}" ]; then
        kill $dial_pid >/dev/null 2>&1
    fi
    /usr/bin/bash
    reboot
  fi
fi

      Note: we have "CdRoMmOuNtPoInTgOeShErE" intead of an actual mount point. This is so that we can replace the string later when it is embedded in a binary. If you are testing this with a disk before you burn a CD, you should put your slice 0 mount point in place of this string. Also, note that if the script doesn't find a sysidcfg file, it will run bash (which you will need to copy over with the libraries it needs seperately) and then reboot. This means that if you have a CD with just this slice 1 and no slice 0, you can use the CD as a rescue disk.

      Also, you will need to change /mnt/sbin/suninstall to add the line touch ${PREINSTALL} just before the following statements:

if [ -f ${PREINSTALL} -o -f ${INSTALLBOOT} ]; then
        if [ -f ${JSLOCKFILE} ]; then
                gettext "You must reboot the system to restart a JumpStart install."

   9. Install the boot block onto slice 1:

    # installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk

Slice 1 is now bootable and will launch into jumpstart if /cdrom contains the Jumpstart setup. We will exploit this and the new (in later versions of Solaris 8) Flash installation to create a CD that can recover the core OS with all the configuration intact.
Creating a flash archive
*** FIXME the script needs to ensure that root_password isn't blank.

Here is my mksysidcfg script. Using it takes a little preparation on your part. The script uses flarcreate from the Solaris 8 CDROM to create the Flash Archive. The script expects the file to be in /usr/sbin/flarcreate.

You should create a file named /etc/flar_exclude listing everything on the rootdisk that you don't want in the archive. For example, on our virus scanner, I have the following in /etc/flar_create:

/opt/trend/Plug-Ins/EM/tempdir/
/var/adm/
/var/log/
/var/tmp/
/var/iscan/
/var/iscan/log.
/var/iscan/Archive/
/var/iscan/Quarantine/
/var/iscan/tmp/
/var/iscan/virus/
/var/spool/mqueue/
/var/spool/mqueue-delivery/
/var/spool/clientmqueue/
/home/mah/cdrom

/home/mah/cdrom is where I put the build images. I exclude that because I don't want the build image to contain a copy of itself. In cases where you want the directory, but not the files in the directory, you need to put the pathname with a trailing / as I did in this file. Also, it is a good idea to not copy over log files. Note that I've avoided the log files in the /var/iscan/ directory with /var/iscan/log. and I have just the top of the /var/log and /var/adm path. The logfiles there are touched in a postinstall script.

Mount the 450Mb partition and then run:

    # ./mksysidcfg -b -f /,/var,/usr -m /mnt

    * -b tells it you already have a bootable image and don't need the script to attempt to make one.
    * -f /,/var,/usr tells the script which filesystems to put into the archive. Everything on the root disk should go here. I've not finished the script to figure out which is the root disk and where stuff goes yet.
    * -m /mnt tells the script where to put the image.

When running the script, you may get errors like

    WARNING: computehash not found; cannot generate checksums
    cpio: Error with lstat() of "", errno 2, No such file or directory

which you may safely ignore.

The above command creates a directory, /mnt/cdrom containing a jumpstart setup ready to do a Flash install of the machine you just ran it on. The contents of this directory need to be mounted as /cdrom when slice 1 (created above) boots up. This means that you probably need to move the contents of the subdirectory to the root of the disk.

In this case, I've mounted my disk at /mnt, so to have the disk set up properly, I run:

    # mv /mnt/cdrom/.install_config /mnt/cdrom/* /mnt
    # rmdir /mnt/cdrom

Now, to boot from the slice 1 on the disk, it is very handy to use devalias in the boot prom. My scsi disk is set up as c1t1d0 on a UltraSPARC 5, so the devalias command is:

    ok devalias scsi /pci@1f,0/pci@1/pci@1/SUNW,isptwo@4/sd@1,0

With this alias, I can boot off of the prepped slice (b) using

    ok boot scsi:b

(scsi:b here translates to /pci@1f,0/pci@1/pci@1/SUNW,isptwo@4/sd@1,0:b)

Assuming you've set the cdrom variable in the rcS script correctly, you should see it coming up, rebuilding the system from the flash archive, and rebooting as the restored system.
Creating the CD
The first step to building the recovery CD is to capture slice 1. Sun hardware looks at slice 1 on the CD to boot (that's a gloss-over - it looks at a different slice depending on the architecture, but, for our purposes, it looks at slice 1). This slice contains a complete UFS partition for booting.

In the previous steps, we created a bootable recovery disk; now we will use the slice 1 image to burn CDs for multiple machines.

   1. Copy the slice 1 image to a file:

    # dd if=/dev/rdsk/c1t1d0s1 of=s1.img

      Make sure that your sbin/rcS script has the string "cdrom=CdRoMmOuNtPoInTgOeShErE" in it.

      This image file can be used for different machines of the same architecture, so keep it around. The only thing you need to do is replace the "cdrom=CdRoMmOuNtPoInTgOeShErE" bit with "cdrom=/dev/dsk/???". Make sure to use a string of the same length when editing a binary file. Pad with spaces if you must.
   2. Determine the proper /dev/dsk file for the cdrom. Substitute this for the magic string in the s1.img file above:

    # sed 's/cdrom=CdRoMmOuNtPoInTgOeShErE/cdrom=\/dev\/dsk\/c0t2d0s0/' < s1.img > host.img

   3. Using the JumpStart image mksysidcfg created, the slice 1 image modified in the previous step, and a recent copy of mkisofs (the version of mkisofs available with Solaris 8 won't work), make an ISO image to burn to CD:

    # mkisofs -B host.img,... -o host.iso cdrom

      The above command assumes that you are sitting in the parent directory of the cdrom subdirectory that mksysidcfg created.
   4. Burn the ISO image to disk:

    # cdrecord dev=1,1 host.iso

      That's It!

      If you find this procedure useful, please email me and let me know.
      References
      Building a Bootable JumpStart Installation CD-ROM

# 3  
Old 10-12-2005
Thanks a lot! Smilie
that info was a real pain in da ... to find Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Bootable Encrypted Backup

Is there a utility available to make such a backup? Is this idea even possible? Thanks for the help. (5 Replies)
Discussion started by: rwh2011
5 Replies

2. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

3. Solaris

Looking for help with Solaris bootable CD

Hi Folks, I persued my cousin to purchase couple Sun boxes to learn Unix. He is downloading the media but the CD he burns with the downloaded ISO does not remain bootable :wall: He is lives in Aldershot, Hampshire and pick up bootable Solaris CDs from nearby cities... Any help? Have a... (3 Replies)
Discussion started by: momin
3 Replies

4. Solaris

Burning Solaris 9 Installation ISOs to bootable CDs

Hi everyone, Im new to Solaris and am just about to install Solaris 9 on an old Sparc based machine with Solaris 8. My friend gave me the ISOs for V9, and now, i have them sitting on my Vista, and i have to start writing bootable CDs of the same. But Im not quite sure how to go about doing... (4 Replies)
Discussion started by: agummad
4 Replies

5. Solaris

Help me, please! Solaris 10 hands-off installation from a bootable DVD

Hello, I have a problem with installing the Solaris 10 using a bootable DVD with a flar archive. I want this installation to be totally hands-off, but unfortunately after I run this boot command at the ok prompt: ok boot cdrom - install ... the system is rebooted and the interactive... (5 Replies)
Discussion started by: Przemek
5 Replies

6. Solaris

OS Backup for Solaris

Hi, I'm new to Unix world and would like to know the procedure to do back for OS for Solaris 9. Can anyone guide me on this, please. Thank You (3 Replies)
Discussion started by: raziayub
3 Replies

7. Filesystems, Disks and Memory

Make non-bootable scsi drive, bootable

In our HP/Unix system, our master scsi drive was bootable and our mirrored drive was non-bootable. Are any of these alternatives possible: 1) Make the non-bootable scsi drive bootable? How? 2) Create a bootable scsi drive, then copy the mirrored data to the newly created scsi drive? I seek... (1 Reply)
Discussion started by: bfisk
1 Replies

8. UNIX for Dummies Questions & Answers

How to have bootable backup?

In my present dual boot (Fedora Core 4 & WinXP2003 Server) desktop computer, I have redundant 100GB disk drives. Every so often I boot fedora core 4 and telinit 1 cp /dev/sda /dev/sdb and then I reverse the connections to the drives so I boot from the newly created copy. I just ordered... (2 Replies)
Discussion started by: siegfried
2 Replies

9. Solaris

Sun bootable tape backup

Hi guys & gals, As a newbie, here's my quest: Build a bootable tape backup for my sunos 5.8 sunfire 480v ultrasparc-III+ AiX has such feature: mksysb; by the way, why can't I change/write to /home Any SUN guru out there ? Any idea will be welcomed :-) (4 Replies)
Discussion started by: andryk
4 Replies
Login or Register to Ask a Question