[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Is there a way to copy and move the entire con tents of the Hard drive



Here is a script I wrote to work under Solaris. It is scheduled 
under cron and completely copies everything from the main drive 
to a standby once nightly. Think of it as a poor man's RAID1 :^)

You will have to tweak things a little for Linux operability, 
but the script is straight forward and should serve you well.

Take care.

Brandon Wheaton
UNIX Systems Engineer 
ValiCert, Inc.
1215 Terra Bella Ave. 
Mountain View, CA 94043 
650.280.UNIX 
----
Computers are useless; they can only provide answers.
~Pablo Picasso

----begin script----
#!/bin/sh
#echo y|newfs /dev/rdsk/c0t1d0s0
#echo y|newfs /dev/rdsk/c0t1d0s3
#echo y|newfs /dev/rdsk/c0t1d0s4
#echo y|newfs /dev/rdsk/c0t1d0s5
#echo y|newfs /dev/rdsk/c0t1d0s6
#echo y|newfs /dev/rdsk/c0t1d0s7

# mount the / partition and copy it
echo "Clearing / backup area..."
echo y|newfs /dev/rdsk/c0t1d0s0
mkdir /backup_root
mount /dev/dsk/c0t1d0s0 /backup_root
cd /backup_root
ufsdump 0fb - 64 /dev/rdsk/c0t0d0s0 | (cd /backup_root ; ufsrestore ryf - )
# need different /etc/vfstab file for this drive if we want to boot to it.
mv /backup_root/etc/vfstab /backup_root/etc/vfstab.orig.drive
mv /etc/vfstab.backup.drive /backup_root/etc/vfstab 

# mount the /usr partition and copy it
echo "Clearing /backup_root/var backup area..."
echo y|newfs /dev/rdsk/c0t1d0s3
mount /dev/dsk/c0t1d0s3 /backup_root/var
cd /backup_root/var
ufsdump 0fb - 64 /dev/rdsk/c0t0d0s3 | (cd /backup_root/var ; 
ufsrestore ryf - )

# now mount the /usr/openwin partition and copy it 
echo "Clearing /backup_root/oracle backup area..."
echo y|newfs /dev/rdsk/c0t1d0s4
mount /dev/dsk/c0t1d0s4 /backup_root/oracle
cd /backup_root/oracle
ufsdump 0fb - 64 /dev/rdsk/c0t0d0s4 | (cd /backup_root/oracle ; 
ufsrestore ryf - )

# mount the /var partition and copy it
echo "Clearing /opt backup area..."
echo y|newfs /dev/rdsk/c0t1d0s5
mount /dev/dsk/c0t1d0s5 /backup_root/opt
cd /backup_root/opt
ufsdump 0fb - 64 /dev/rdsk/c0t0d0s5 | (cd /backup_root/opt ; 
ufsrestore ryf - )

# mount the /usr partition and copy it
echo "Clearing /usr backup area..."
echo y|newfs /dev/rdsk/c0t1d0s6
mount /dev/dsk/c0t1d0s6 /backup_root/usr
cd /backup_root/usr
ufsdump 0fb - 64 /dev/rdsk/c0t0d0s6 | (cd /backup_root/usr ; 
ufsrestore ryf - )

# mount the /nsr partition and copy it
echo "Clearing /nsr backup area..."
echo y|newfs /dev/rdsk/c0t1d0s7
mount /dev/dsk/c0t1d0s7 /backup_root/nsr
cd /backup_root/nsr
ufsdump 0fb - 64 /dev/rdsk/c0t0d0s7 | (cd /backup_root/nsr ; 
ufsrestore ryf - )

cd /
umount /backup_root/var
umount /backup_root/oracle
umount /backup_root/usr
umount /backup_root/opt
umount /backup_root/nsr
umount /backup_root

echo "Installing Boot Block"
installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0
----end script----




> -----Original Message-----
> From: LightSpeedServers.Net [mailto:admin@xxxxxxxxxxxxxxxxxxxxx]
> Sent: Saturday, December 02, 2000 12:00 PM
> To: cobalt-users@xxxxxxxxxxxxxxx
> Subject: [cobalt-users] Is there a way to copy and move the entire
> contents of the Harddrive
> 
> 
> As you have already seen in my previous posts, I will need to 
> change servers
> soon.  I spent a lot of time adding programs, changing 
> things, and modifying
> things on the RAQ4.  I almost have the RAQ4 to the point I 
> want it and now I
> have to move!!
> 
> Is there a way to copy the complete hard drive into a .tar or 
> some other
> method and just move everything onto the new server?  I know 
> I can migrate,
> but I want to take everything, every program I installed, 
> every modification
> to the config, everything!!  I do not have access to the 
> server so this
> makes things difficult!!
> 
> _______________________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To Subscribe or Unsubscribe, please go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users
>