3 # This script prepares an IOmega disk for use with amanda.
5 # - formats the disk, checking for bad sectors
6 # - mounts the disk and adds a data subdirectory
7 # - makes user amanda owner of this data sub directory
8 # - calls amlabel to label the disk
9 # - unmounts and ejects the disk.
11 # This shell script is not generally usable as is,
12 # because it is relying on a couple of settings of personal taste, such as
13 # - IOmega disks are partitioned and the fourth primary partition
14 # is taking the whole disk. So the disk is visible as /dev/sda4.
15 # - I am preferring to use an ext2 filesystem on the disk
16 # (rather then a dos or vfat file system)
17 # - I am doing a chown of the data sub directory such that - depending
18 # on the umask setting - only user amanda and root can see
19 # the files written to the disk.
21 # It has to be called as root
25 echo "Usage : $0 <backup set> <disk label>"
32 echo "insert tape $2 into slot and press return"
35 mkfs.ext2 -c -L $label /dev/iomega
37 echo "mounting disk ..."
39 if [ ! -d /mnt/iomega/lost+found ]
41 echo "mount did not work properly - please investigate"
45 echo "adding data subdirectory ..."
48 chown -R amanda:disk .
51 echo "attempting to write amanda disk label"
52 su - amanda -c "/usr/sbin/amlabel $backup $label"
55 echo "preparing to eject disk ..."
59 echo "please don't forget to label with $backup $label"