From: hadi motamedi on
Dear All
One of my solaris8 machines has a 40GB IDE hard disk with some
applications pre-installed. I have another solaris8 machine with 20GB
IDE hard disk that I want to install the same applications on. I
formatted this 20GB IDE disk on my windows machine and then I
installed solaris8 on it. When I installed the applications I didn't
get all of the processes as running so I compared them through 'df -k'
and I found that they have the same filesystem mounted on the same
partitions. On the 40GB one, I don't see any partition with more than
25% occupied so it seems that the problem does not come from different
hard disk sizes. Rather than trying to install the applications one-by-
one on the 20GB one, can you please let me know how to clone the 40GB
hard disk to 20GB one to build the same machine with all of the
applications up and running ?
Thank you
From: hadi motamedi on
On Jul 26, 11:33 am, Michael Vilain <vil...(a)NOspamcop.net> wrote:
> In article
> <c0c870dc-935b-40d4-9998-4f6f582da...(a)c10g2000yqi.googlegroups.com>,
>
> Cloning an entire disk on Solaris usually involves some variation of dd
> and most likely requires identical disks in terms of cylinders, heads,
> etc.  
>
> AFAIK, you can't "clone" a disk thats larger onto a disk that's smaller.  
> You can, however, copy the filesystem from one partition to another if
> the size is smaller than the total destination.  That's a variation of
> the ufsdump | ufsrestore combo that's described in the man page.
>

I have a secondary usb disk with the same size , but formatted on
windows machine. The 'format>verify' output shows different number of
sectors/heads/cylinders on the primary (solaris8 pre-installed) and
secondary disks. Can you please let me know what format utilities are
available that can give me the option of selecting the required number
of sectors/heads/cylinders when formatting?
From: solx on
On 26/07/2010 06:29, hadi motamedi wrote:
> Dear All
> One of my solaris8 machines has a 40GB IDE hard disk with some
> applications pre-installed. I have another solaris8 machine with 20GB
> IDE hard disk that I want to install the same applications on. I
> formatted this 20GB IDE disk on my windows machine and then I
> installed solaris8 on it. When I installed the applications I didn't
> get all of the processes as running so I compared them through 'df -k'
> and I found that they have the same filesystem mounted on the same
> partitions. On the 40GB one, I don't see any partition with more than
> 25% occupied so it seems that the problem does not come from different
> hard disk sizes. Rather than trying to install the applications one-by-
> one on the 20GB one, can you please let me know how to clone the 40GB
> hard disk to 20GB one to build the same machine with all of the
> applications up and running ?
> Thank you

I picked this script a long time ago, it works well for SPARC for
cloning the boot disk. You will need to adapt it for x86.

#!/bin/sh
#
# The script is based completely on Sun InfoDoc 16311
#
# Please note this program MUST be run interactively, you also must have
# partitioned the new disk so it matches the old disk and that the
partitions
# are large enough to accomodate the filesystems
# This needs to run in single user mode

NEWFS=/usr/sbin/newfs
MOUNT=/usr/sbin/mount
UMOUNT=/usr/sbin/umount
DUMP=/usr/sbin/ufsdump
RESTORE=/usr/sbin/ufsrestore
CHECK=/usr/sbin/fsck
BOOTBLK=/usr/sbin/installboot

#
# Newfs option -v = verbose
# -r 7200 = disk rotation speed 10000rpm
#

NEWFS_OPT=" -v -r 7200 "

BOOT_ROOT=/dev/rdsk/c0t0d0s0

COPY_ROOT=/copy.root

COPY_ROOT_RAW=/dev/rdsk/c1t1d0s0
COPY_ROOT_UFS=/dev/dsk/c1t1d0s0

echo "Formatting Mirror Disk Partitions"
${NEWFS} ${NEWFS_OPT} ${COPY_ROOT_RAW}

echo "Mounting Mirror Disk Filesystems"
${MOUNT} -F ufs ${COPY_ROOT_UFS} ${COPY_ROOT}

echo "Going to Root Directory"
cd /
echo "Copying / "
${DUMP} 0f - ${BOOT_ROOT} | ( cd ${COPY_ROOT} ; ${RESTORE} xf - )

echo "Finished Copying"

echo "Unmounting Mirror Disk Filesystems"
${UMOUNT} ${COPY_ROOT}

echo "fsck mirror disk"
${CHECK} -y ${COPY_ROOT_RAW}

echo "Installing Boot Block "
${BOOTBLK} /usr/platform/`uname -i`/lib/fs/ufs/bootblk ${COPY_ROOT_RAW}
From: hadi motamedi on
On Jul 29, 1:36 am, Michael Vilain <vil...(a)NOspamcop.net> wrote:
> In article
> <91a422f0-df32-469c-8da0-4cb7765b7...(a)y11g2000yqm.googlegroups.com>,
>  hadi motamedi <motamed...(a)gmail.com> wrote:
>
>
>
> > On Jul 26, 11:33 am, Michael Vilain <vil...(a)NOspamcop.net> wrote:
> > > In article
> > > <c0c870dc-935b-40d4-9998-4f6f582da...(a)c10g2000yqi.googlegroups.com>,
>
> > > Cloning an entire disk on Solaris usually involves some variation of dd
> > > and most likely requires identical disks in terms of cylinders, heads,
> > > etc.  
>
> > > AFAIK, you can't "clone" a disk thats larger onto a disk that's smaller.  
> > > You can, however, copy the filesystem from one partition to another if
> > > the size is smaller than the total destination.  That's a variation of
> > > the ufsdump | ufsrestore combo that's described in the man page.
>
> > I have a secondary usb disk with the same size , but formatted on
> > windows machine. The 'format>verify' output shows different number of
> > sectors/heads/cylinders on the primary (solaris8 pre-installed) and
> > secondary disks. Can you please let me know what format utilities are
> > available that can give me the option of selecting the required number
> > of sectors/heads/cylinders when formatting?
>
> You can format the disk and prepare a partition or slice in preparation
> to putting UFS filesystem on it.  Then run ufsdump/ufsrestore to copy
> the filesystem over to it.  That's the closest to "cloning" I know of on
> Solaris.
>
> --
> DeeDee, don't press that button!  DeeDee!  NO!  Dee...
> [I filter all Goggle Groups posts, so any reply may be automatically ignored]

My usb disk is auto-mounted under /rmdisk/rmdisk0 , with slices as
s0,s3,s4,s5,s6 . On my solaris8 machine, the /export/home is mounted
on /dev/dsk/c0t0d0s6 . I want to ufsdump/ufsrestore this slice to the
proper on on the usb disk , as :
#ufsdump 0f - /dev/dsk/c0t0d0s6 |ufsrestore -i /rmdisk/rmdisk0/s6 -
But it does not work my case. Can you please correct me on your
proposed procedure?
From: Andrew Gabriel on
In article <1509e625-bdef-4448-92c9-c5bf6bf8b064(a)f33g2000yqe.googlegroups.com>,
hadi motamedi <motamedi24(a)gmail.com> writes:
> My usb disk is auto-mounted under /rmdisk/rmdisk0 , with slices as
> s0,s3,s4,s5,s6 . On my solaris8 machine, the /export/home is mounted
> on /dev/dsk/c0t0d0s6 . I want to ufsdump/ufsrestore this slice to the
> proper on on the usb disk , as :
> #ufsdump 0f - /dev/dsk/c0t0d0s6 |ufsrestore -i /rmdisk/rmdisk0/s6 -
> But it does not work my case. Can you please correct me on your
> proposed procedure?

Assuming /rmdisk/rmdisk0/s6 is an empty filesystem...

cd /rmdisk/rmdisk0/s6
ufsdump 0f - /export/home | ufsrestore rf -

--
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]