Go Premium for a chance to win a PS4. Enter to Win


Ghost-like mirroring tool for Sun boxes?

Posted on 2003-10-29
Medium Priority
Last Modified: 2013-12-27
I'm looking for (don't know if it exists) a tool similar to the Symantec Ghost product for Sun boxes?

Any suggestions or pointers would be appreciated.
Question by:soldato
  • 3
  • 2
  • 2
  • +7
LVL 38

Expert Comment

ID: 9646873
Not quite like Ghost (Ghost cann't handle Solaris). To clone a harddisk, if you have 2 identical HD, you
can use the 30 years old UNIX "dd" command to do the job.

boot up the system to single  user mode / (or use Solaris CD to boot up to single user mode).
use "format" command to find out the disk device name BUT DO NOT FORMAT the harddisk.

then use the following command:

dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2

This will copy disk c0t0d0    to c0t1d0.    s2 refer to the whole HD.

If you have two different HDs, you cann't use "dd", you have to use format, ufsdump, ufsrestore to
do the job.

use "format" command to partition the new HD,
you can make it to have the same number of partions (the size of the partition can be the same, or just bigger than the data size, or bigger).

  Assume that your first HD is c0t0d0, 2nd disk is c0t2d0
(use format command to find out the names in your system).

  you can then use "ufsdump + ufsrestore" to dump the partition one by one, then make the diskbootable.

  eg: your first harddisk have /, /var, /usr, /export
      4 filesystems(partitions) refer to /etc/vfstab for details.
       let's say you want to dump the / filesystm to 1st partion of the 2nd HD, you do:

# mount the target partition
mount /dev/dsk/c0t0d0s0 /mnt
/usr/sbin/ufsdump 0cf - / | (cd /mnt; ufsrestore rf -)

where finish file transfer, you do:
rm /mnt/restoresymtable
umount /mnt

repeat the above procedure to cope the other partitions

Perform fsck to all the partions in the 2nd HD.

Make the 2nd HD bootable:

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

That's it. It should work for you.
LVL 34

Expert Comment

ID: 9647746
If you're looking for the ability to "stamp out" Sun boxes using a standard config or set of configs, then what you want is Solaris Jumpstart.
LVL 24

Expert Comment

ID: 9647887
U can try this software, which support many os including solaris.

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 9649110
In addition to the ufsdump/ufs restore method described above, I have successfully cloned live machines by copying each filesystem using cpio, and then doing the installboot thing. Cpio handles the special files better than tar can.
LVL 38

Expert Comment

ID: 9649593
tar is not for system level backup, it can not handle special files (eg, device files).

ufsdump/ufsrestore is a Solaris specific backup command, it have no problem with
system level backup.

cpio can do the job as well. (system level backup, no problem)
LVL 48

Expert Comment

ID: 9653470
later versions of tar do support backing up of special files.

Author Comment

ID: 9655332
Is Jumpstart or Avail similar to Ghost?

I'm looking to "stamp out" clones, but the "standard configuration" file solution is not really an option.  I will have a custom configured application that needs to be imaged and dropped across a dozen or so Sun boxes of the same hardware type (drives, processor, ram, etc).

LVL 24

Expert Comment

ID: 9655365
For that i think the jumpstart with work fine.

LVL 38

Expert Comment

ID: 9655675
" I will have a custom configured application that needs to be imaged and dropped across a dozen or so Sun boxes of the same hardware type (drives, processor, ram, etc)."

dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2

willl do the job for you, exactly image.

Expert Comment

ID: 9657124
The closest tool to Ghost and easiest is Solaris' 'fssnap'  It allows you to take a snapshot of a filesystem, but does not require as much up front configuration as Jumpstart.  It is also easier to manage than 'dd' (although I use dd with a lot of small backups...)  

The best thing about fssnap is that you can take a snap of your base filesystem, and then a snap of a webserver, ftp server, etc.  Then, you just lay down the base filesystem (root, etc.) and then any others you want to build.
LVL 16

Accepted Solution

Hanno P.S. earned 1000 total points
ID: 9658399

Use the ufsdump + ufsrestore (best together with fssnap) and do the installboot afterwards.
The steps required are:
1) Copy VTOC from source to target disk (or do manual formatting using "format")
2) for each filesystem, dump it using ufsdump and put it on the target disk using ufsrestore (you can connect ufsdump and ufsrestore using a pipe). If you wish you can use fssnap to read off live filesystems with ufsdump.
3) Do the installboot for the root slice on the target disk
If you want to boot from the target disk make sure you change the moutn entries in /etc/vfstab accordingly!

Here's a small script to clone a disk using these standard UNIX tools:


if [ "$#" != 2 ] ; then
  echo "usage: $0 sdisk tdisk"
  echo "where: sdisk is the source disk (e.g. c0t0d0)"
  echo "       tdisk is the target disk (e.g. c0t1d0)"
  echo "Note:  Please omit slice numbers!"
  exit 1

format</dev/null | grep "\.[       ]$1" >/dev/null 2>&1 && S=$1
format</dev/null | grep "\.[       ]$2" >/dev/null 2>&1 && T=$2
if [ -z "$S" ] ; then
  echo "ERROR: Source disk $1 does not exist -- exit!" ; exit 2
elif [ -z "$T" ] ; then
  echo "ERROR: Target disk $2 does not exist -- exit!" ; exit 3

clear ; echo "
  ATTENTION: This script will copy the whole disk $S to $T
             If this is NOT what you intended to do, abort
             by pressing Ctrl-C now!

  Are you ready now [N] ? \c"
read ans mist ; echo ""
[ "$ans" != "J" -a "$ans" != "j" -a "$ans" != "Y" -a "$ans" != "y" ] && exit 1

prtvtoc /dev/rdsk/${S}s2|fmthard -s - /dev/rdsk/${T}s2      # copy VTOC
for i in `tail -r /etc/mnttab|grep /a|awk '{print $2}'`      # make sure nothing is
  do umount -f $i >/dev/null 2>&1                  # mounted under /a ...
[ -d /a ] || mkdir /a                              # create /a if not here

SD=/dev/rdsk/$S ; TD=/dev/rdsk/$T                  # the raw disk devices
fs=`df -kl | grep \`echo $SD | sed -e 's/rdsk/dsk/'\` |\
    grep /dsk/ | sed -e 's/^.*\(s[0-9]* \).*/\1/'`      # fs on boot disk used

for i in $fs;do
  echo "creating file system on ${TD}$i ...\c"
  echo y | newfs ${TD}$i >/dev/null 2>&1 ; echo ""      # create filesystems

for i in $fs ; do                              # mount new disk under
 echo "copying all data from slice $S$i to $T$i ..."      # /a and copy all data
 M=/a`df -kl|grep ${S}$i|awk '{print $6}'|sed -e 's!/$!!'`
 F=`df -kl|grep ${S}$i|awk '{print $6}'`            # from source disk
 mount `echo ${TD}$i|sed -e 's/rdsk/dsk/'` $M            # to target disk
 ( /etc/init.d/xntpd stop ; sleep 30 ; /etc/init.d/xntpd start ) &
 ufsdump 0f - `fssnap -F ufs -o raw,bs=$M,unlink ${F}`|\
   ( cd $M ; ufsrestore rf - ) >/dev/null 2>&1            # (using ufsdump
 fssnap -F ufs -d ${F} >/dev/null 2>&1                  # with UFS snapshot)
 echo ""

# Okay, now let's make the new disk bootable:
installboot /usr/platform/`uname -m`/lib/fs/ufs/bootblk \
    `df -kl /a | sed -ne 's/\(\/dev\/\)\(dsk\/[^       ]*\).*/\1r\2/p'`

# and modify the mount entries in /etc/vfstab on new disk:
sed -e "s/${S}/${T}/g" /etc/vfstab > /a/etc/vfstab
LVL 16

Expert Comment

by:Hanno P.S.
ID: 9658403
P.S.: You may call the script I've just posted "ghost" if you want ;-)

Expert Comment

ID: 9665497
Hi soldato

Solaris 8 2/02 and later has a "Ghost" like feature.  ie the ability to clone one machine and install it onto any other machine... it's called "WebStart Flash Archive".

This allows you to create an image of say a E250 and install the same image onto a SunBlade 100, or a SunFire 4800 via jumpstart, tape, CD/DVD or HTTP.  This is by far the easiest method compared to all the other detailed and it does just the job you require. IMO it does a better job than Ghost does especially as it's a fully supported option provided by the OS manufacturer :-)

You can also do a lot more with Flash archive than you can with the other methods or even Ghost and it's faster too :-) (IMO).

Check out details of "Flash Archive" at http://docs.sun.com/db/doc/816-2411/6m8ou8s8t?a=view


Expert Comment

ID: 9665506
Oh I also forgot to mention that Flash Archive in Solaris 9 now supports "Layered Archives" as well as the ability to split and merge archives.

The possiblities are quite amazing.  Give it a try, you won't be disappointed (at least if you use Sol 9)

Oh yes, and you can also use LiveUpgrade with flash archives... this allows you to build say a Sol 9 machine, create an archive of it, then update a Sol 7 machine using LiveUpgrade with the only downtime being that of a single reboot...


Expert Comment

ID: 11476272
Has anyone tried udpcast? I've a coworker who has definately won me over. I don't know if it is a native sloaris product, but it is quite extensible. http://www.udpcast.linux.lu/

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question