Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 1999 21:42:49 -0500 (EST)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        francis@usls.edu (Francis A. Vidal)
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: tar & Jaz disks
Message-ID:  <199902160242.VAA29879@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <Pine.LNX.4.05.9902152046090.31938-100000@linux1.usls.edu> from "Francis A. Vidal" at "Feb 15, 99 08:47:16 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Francis A. Vidal wrote,
> hi all,
> 
> can i use tar to dump everything to a jaz disk? 

If tar can handle 'everything,' the disk can.

> if that can be done, what
> would be the correct parameters when running tar?

You would need no extra parameters. Assuming that your Jaz drive is
sd0, it would simply be,

# tar cf /dev/sd0 /whatever/you/want/

However, if you are doing a backup of a hard drive, I recommend,

1) Use 'dump' and not 'tar,'

2) Format the Jaz as a UFS.

I recommend (2) since the concept of a no-rewind Jaz is not very
meaningful, and you can only get one tar or dump archive per disk (to
my knowledge). 

If you go by this route, I have a nice shell script for doing backups
in this manner. I invite nit-picking of the script by those more
learned in sh scripts than I. Note that the Jaz disk is UFS, not
MSDOS, and I use four partitions rather than three. I also compress
the dumps to keep the Jaz usage down (which is why I automated it to
run at night, it is fairly slow). It is also checking for disklabel
and fdisk changes on 'wd0' which may or may not be what your drive
is. 

If you need a disktab entry to label a Jaz, I have one as well.

#!/bin/sh
#
# jazdump - Weekly dump to a Jaz disk.
#
# Usage: jazdump level
#
# Toss a Jaz disk in the drive, su to root
# and execute this command. Enter the level
# of the dump. The Jaz disk is expected to
# have a UFS format. Just change the 'mount'
# command if it were *gag* MSDOS,
#
#      mount -t msdos /dev/sd0 /mnt/jaz
#            ^^^^^^^^
# If the fdisk or disklabel info for wd0 has
# changed, those are saved as well.

if [ ! $1 ] || [ $1 -gt 9 ] || [ $1 -lt 0 ]; then
    echo "jazdump: dump level must be 0-9, invalid level: $1"
    exit 1
fi

if ! mount /dev/sd0 /mnt/jaz; then
    echo "jazdump: could not mount Jaz disk, no dumps done"
    exit 1
fi

# Here go the dumps. Remember add or remove any
# additional filesystems here.
cd /mnt/jaz

umask 222

dump -au -$1 -f - /     | gzip -9 > root_$1.dmp.gz
dump -au -$1 -f - /usr  | gzip -9 >  usr_$1.dmp.gz
dump -au -$1 -f - /var  | gzip -9 >  var_$1.dmp.gz
dump -au -$1 -f - /home | gzip -9 > home_$1.dmp.gz

echo ""
echo "jazdump: all dumps complete"

# If the worst should happen (knock on my simulated-
# wood desktop), we would want fdisk and disklabel
# info to totally recreate the filesystems.
echo "jazdump: checking disklabel and fdisk"

DSKLBL=`hostname -s`.dsklbl
FDISK=`hostname -s`.fdisk

disklabel -r wd0 > /tmp/$DSKLBL
fdisk wd0 > /tmp/$FDISK

for file in $DSKLBL $FDISK 
{
    if cmp -s /tmp/$file $file; then
        rm /tmp/$file
    else
        echo "jazdump: $file has changed"
        mv $file $file.prev
        mv /tmp/$file $file
    fi
}

# We need to get out of the directory to umount
# the drive. Might as well go $HOME.
cd

if umount /mnt/jaz; then
    echo "jazdump: Jaz unmounted."
else
    echo "jazdump: could not unmout Jaz disk."
fi

exit 0

-- 
Crist J. Clark                           cjclark@home.com

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902160242.VAA29879>