ufsdump script.

ufsdump script.

Post by Dan Cav » Tue, 27 Jun 2006 19:31:30



Hi All,

I wrote this script a few weeks ago to backup my one way mirrors from
disk suite to my nfs server partition.

I'm sure it's way more customisable..

Based on the following format/df output.
Current partition table (original):
Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       0 -   824        4.00GB    (825/0/0)
8395200
  1       swap    wu     825 -  1649        4.00GB    (825/0/0)
8395200
  2     backup    wm       0 - 14086       68.35GB    (14087/0/0)
143349312
  3 unassigned    wm       0                0         (0/0/0)
  0
  4 unassigned    wm       0                0         (0/0/0)
  0
  5        var    wm    1650 -  2474        4.00GB    (825/0/0)
8395200
  6 unassigned    wm    2475 - 14073       56.28GB    (11599/0/0)
118031424
  7 unassigned    wm   14074 - 14086       64.59MB    (13/0/0)
132288

bash-2.03# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/md/dsk/d0       4133838 1869363 2223137    46%    /
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
/dev/md/dsk/d5       4133838  644891 3447609    16%    /var
swap                 5363656      24 5363632     1%    /var/run
swap                  524288     128  524160     1%    /tmp
/dev/md/dsk/d100     10326764  663552 9559945     7%    /opt/Tivoli

------ script called backup-slices-ufs.sh -----

#!/bin/sh

box=`hostname`
cp ./Full* /backupinfo.txt
disk0=`format < /dev/null |grep -v pci |grep "0." | cut -c 11-16| head
-1`
echo using $disk0
/usr/sbin/ufsdump 0f /net/nfs01/jumpstart/flasharchives/$box.s0
/dev/rdsk/`echo $disk0`s0
/usr/sbin/ufsdump 0f /net/nfs01/jumpstart/flasharchives/$box.s5
/dev/rdsk/`echo $disk0`s5
for fsdev in `df -k | grep d10 | grep -v fd |grep -v "File" |awk
{'print $1}'`
do
        for slice in `df -k | grep d10 | grep -v fd |grep -v "File"
|awk {'print $1}' | cut -c 13-16`
        do
        /usr/sbin/ufsdump 0f
/net/nfs01/jumpstart/flasharchives/$box.$slice $fsdev
        done
done

 
 
 

1. ufsdump script

I want to run alittle script that will really stress the drive on a backup
server that has just had the boot disk replaced twice.

This is a solaris 2.6 on a E3500

This is what I got so far...
I would like to tweak it, and add stability.

#!/bin/csh

cd /
ufsdump - /dev/rdsk/c0d0t0s0 | (cd /t2root; ufsrestore xf -)

I will do this to two other slices as well.
Is there a way I can have it mail me if it fails, or the drive dies...

2. Triming Solaris?

3. /usr and / same slice ; ufsdump script

4. PCMCIA or eth0 IRQ Problem. Not Sure?

5. need ufsdump script to run by non-root?

6. APM questions

7. part 2/2 of: running ufsdump under "script ufsdump.log"

8. Seg Fault while booting

9. part 1/2 of: running ufsdump under "script ufsdump.log"

10. Solaris 8 ufsdump much slower than Solaris 7 ufsdump

11. Why so many ufsdump processes after I type "ufsdump 0f /dev/null /"?

12. ufsdump and ufsrestore script

13. Capturing output of ufsdump and mt to a file in a backup script