From owner-freebsd-questions Mon Feb 15 18:41:53 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA15895 for freebsd-questions-outgoing; Mon, 15 Feb 1999 18:41:53 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA15882 for ; Mon, 15 Feb 1999 18:41:51 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.8.8/8.8.8) id VAA29879; Mon, 15 Feb 1999 21:42:49 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199902160242.VAA29879@cc942873-a.ewndsr1.nj.home.com> Subject: Re: tar & Jaz disks In-Reply-To: from "Francis A. Vidal" at "Feb 15, 99 08:47:16 pm" To: francis@usls.edu (Francis A. Vidal) Date: Mon, 15 Feb 1999 21:42:49 -0500 (EST) Cc: freebsd-questions@FreeBSD.ORG Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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