Ghost-like mirroring tool for Sun boxes?

Posted on 2003-10-29
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.
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


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 Schröder earned 250 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 Schröder
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


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.

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IBM flash storage 840 15 64
Compare if date string is within text file 3 61
remove a combination of patterns from a file 15 68
Bash Script to Analyze Oracle Schemas 11 107
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 …
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

809 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