DDS tape backup multiple directories problem

DDS tape backup multiple directories problem

Post by Zhiliang H » Wed, 03 Apr 2002 08:29:49



I use the following script to do backups of several
directories onto a DDS2 tape device on RedHat 7.0:

#!/bin/bash
FILES="/etc /home /root /var"
for X in $FILES;
do
     /sbin/dump -0 -f /dev/st0 $X >/dev/null
done

However, on the tape only the last directory "var" is
remain.  Could any expert explain why and how to make
sure all directories are dumped in the given order?

Thanks in advance!

Zhiliang

 
 
 

DDS tape backup multiple directories problem

Post by John Kell » Sat, 06 Apr 2002 03:32:36



> I use the following script to do backups of several
> directories onto a DDS2 tape device on RedHat 7.0:

> #!/bin/bash
> FILES="/etc /home /root /var"
> for X in $FILES;
> do
>      /sbin/dump -0 -f /dev/st0 $X >/dev/null
> done

> However, on the tape only the last directory "var" is
> remain.  Could any expert explain why and how to make
> sure all directories are dumped in the given order?

> Thanks in advance!

> Zhiliang

Your tape is rewinding between jobs.  Use the no-rewind tape device
/dev/nst0

Cheers

John

 
 
 

DDS tape backup multiple directories problem

Post by John-Paul Stewar » Sat, 06 Apr 2002 03:42:58



> I use the following script to do backups of several
> directories onto a DDS2 tape device on RedHat 7.0:

> #!/bin/bash
> FILES="/etc /home /root /var"
> for X in $FILES;
> do
>      /sbin/dump -0 -f /dev/st0 $X >/dev/null
> done

> However, on the tape only the last directory "var" is
> remain.  Could any expert explain why and how to make
> sure all directories are dumped in the given order?

Not sure if this is your problem but I think it's the use of
/dev/st0 that's causing the behaviour you're seeing.  Your
script becomes

/sbin/dump -0 -f /dev/st0 /etc >/dev/null
/sbin/dump -0 -f /dev/st0 /home >/dev/null
/sbin/dump -0 -f /dev/st0 /root >/dev/null
/sbin/dump -0 -f /dev/st0 /var >/dev/null

That is, you're calling dump once for each directory using
the _automatically rewinding_ /dev/st0.  Try using
/dev/nst0.  It won't rewind the tape after each call to
dump.  

I'm guessing the automatic rewinding is causing the second
invocation of dump to overwrite the data from the first, and
so on.  Using /dev/nst0 won't rewind the tape, so the second
time dump gets called the tape will already be at the _end_
of the data from the first dump.  You might want to add

mt -f /dev/nst0 rewind

to the end of your script (after 'done') to get the tape
rewound after the final dump.

Alternatively, you could dump all the directories with one
call to 'dump'.  (I'm not a 'dump' user myself, so I can't
help you there.)

But your use of multiple calls to dump with the rewinding
tape device is almost certainly causing the tape to be
overwritten.

HTH,

J-P Stewart

 
 
 

DDS tape backup multiple directories problem

Post by John Wingat » Sat, 06 Apr 2002 05:21:35



> #!/bin/bash
> FILES="/etc /home /root /var"
> for X in $FILES;
> do
>      /sbin/dump -0 -f /dev/st0 $X >/dev/null
> done
> However, on the tape only the last directory "var" is
> remain.  Could any expert explain why and how to make
> sure all directories are dumped in the given order?

/dev/st0 rewinds the tape after closing.  To put more than one
dump file on the tape use the non-rewinding device /dev/nst0.
See the man page st(4).

--
John Wingate                     In the fight between you and the world,

 
 
 

1. How to restore DDS tape data on Sun DDS-3 tape drive?

Hi all,

I have some DDS tapes (DDS-90,4mm 3M)which were backup by command
"tar" 10 years ago.I'd like to restore data from them,but I only have
Sun DDS3 tape dive now.Is that possible to restore DDS data from the
Sun DDS3 tape drive?

Thanks in advance,

2. pppd

3. DDS 3 tape drive and DDS 4 tape

4. can't load sb module into kernel

5. Emergency: DDS-3 tape output can NOT read on DDS-4 driver !!!

6. pkill

7. reading DDS-90 on a DDS-3 tape drive

8. SLS 1.02 Install Notes

9. DAT tape exchange DDS 2 -> DDS 1

10. reading DDS-2 tapes in a DDS-3 drive

11. DDS 3 tape recorded on a DDS 2

12. HP DDS Tape drive backup

13. Backup software with DAT/DDS tapes ...