Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

overhead when using dd?

Status
Not open for further replies.

terrywashington

Technical User
Jun 28, 2001
185
US
I am about to implement a script that will use dd to copy an E450 4GB root disk to the second internal disk daily. Does anyone know if this will use significant overhead or system resources? This is a production system and I want to schedule the disk copy at the appropriate time.
 
have you thought of using ufsdump/ufsrestore to back up the system?

that way it'll only bother copying the changes on the system.
 
There will be some overhead on the source drive so out of hours would be the best option. Use a large blocksize that is a multiple of your disc cylinder size for faster dd. Your disks must be identical. You can stagger the copy by doing a slice at a time rather than the whole disk - can then skip swap slice.

You will need to fsck the paritions on the target disk since they will be marked active. Also edit /etc/vfstab on your new disk to refer to the new mountpoints and remember to call installboot afterwards to make the disk bootable.

Depending on what you're trying to achieve Disksuite mirroring might be a better option.

regards julian
 
Hello,

I don't know about your needs but, did you consider using a volume management software for mirroring? I can think about some points to consider a different solution:

1.- A full copy of the drive will impact the resources of your system. If you use mirroring, the changes will be updated on the fly, so the load will be distributed along the time.

2.- You'll have synchronized copies of the data everytime (maybe you don't want this feature).

3.- You'll have HA against disk failure with mirroring.

4.- I'm not sure, but I think that you can have non-consistent data on the copy if you use dd without umounting the filesystem. You should check this. The problem is important because you talk about the root partition, so you cannot umount it automatically with a script or something similar, so if umounting is needed, you'll have to make the copy at working time, impacting the use of the services on this machine. If you use solaris 8 or later, and if the inconsistency problem is real, you can use fssnap (snapshots) in combination with dd or other command for online copies.

Hope help you. Bye,

jmiturbe
 
Thanks for all of the feedback. I think that I answered my own question. I installed and ran top as the dd was copying the disk. CPU ranged between 0.02-0.09%. The top command used more CPU (0.40%) than that. Anyway I recently tried to talk managnement into using Disksuite but they did not go for it. We use disksuite on several of our other production systems. I was able to successfully boot from the second internal disk after the copy. If anyone is interested I have attached a copy of the script. My root disk consists of a / and swap partition only.

#!/bin/sh
# This script copies an entire disk image to a secondary disk.
# The system can boot from the secondary disk if the primary disk fails.

# Edit SOURCEDISK to reflect the device that you want to copy.
# Make sure that you specify slice 2.

SOURCEDISK=c0t0d0s2
# Edit DESTDISK to reflect the device that you want to copy to.
# Make sure that you specify slice 2.
DESTDISK=c0t1d0s2

echo ====================================
echo Disk Copy script started `date`
echo

dd if=/dev/rdsk/$SOURCEDISK of=/dev/rdsk/$DESTDISK bs=2000k
# Create a file /etc/vfstab.disk2 that mounts the DESTDISK.
# Fsck will be run on the DESTDISK and /etc/vfstab.disk2 will be
# copied to /etc/vfstab on the destination disk.

for disk in $DESTDISK
do
fsck -y /dev/rdsk/$DESTDISK
mount /dev/dsk/$DESTDISK /mnt
cp /mnt/etc/vfstab.disk2 /mnt/etc/vfstab
umount /mnt

done

echo
echo Disk Copy script ended `date`
echo ====================================
echo


 
Beware - the top command only measures CPU utilisation - your dd will be hitting the system disk heavily with little CPU impact. Try running 'sar 5 100' or 'sar -d 5 100' and watch the %wio figures and disk %busy. Given that you only have root and swap on your system disk this shouldn't be an issue unless you are short of memory and your applications are paging heavily.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top