[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

multisession dvd



Dear All,
 
I am fairly new to burning disks under linux.  I have grabbed the script at the end of this message from http://patrick.newedorf.net/backup
 
It works very well if I burn a single session to a DVD+RW (i.e. a full backup), however, if I try and use incremental and create a multisession disk I cannot mount the disk again after it has been written to a second time
 
My system is
 
# uname -a
Linux *.*.*.*.* 2.4.21-20.EL #1 Sat Sep 18 18:37:36 PDT 2004 x86_64 x86_64 x86_64 GNU/Linux
 
# mkisofs --version
mkisofs 2.01a32 (--)
 
# growisofs --version
growisofs 5.3, front-ending to mkisofs 2.01a32 (--)
 
When I try and mount the multisession disk i get
 
]# mount /dev/scd0 /mnt/cdrom/
mount: block device /dev/scd0 is write-protected, mounting read-only
mount: Not a directory
 
/mnt/cdrom is definitely a directory,
 
I ahve also tried
 
# mount -o loop /dev/scd0 /mnt/cdrom/
mount: Not a directory
 
and 
 
# mount -o session=1 /dev/scd0 /mnt/cdrom/
mount: block device /dev/scd0 is write-protected, mounting read-only
mount: Not a directory

Does anyone have any ideas please, I'd really like to get this working so that I can do incremental backups of my system
 
 
Thanks
 
Martyn
 
 
 
#!/bin/bash
#
# Name: backup2dvd.sh
# Date: 21/01/05
# Purpose: backup latest snapshot directory (/.snaphots/hourly.0/) to dvd
#
# Taken from: http://patrick.newedorf.net/backup
# An working example for a script that does
# either a full or incremental backup and
# can verify the backup. It requires growisofs
# and either star or a tar that supports d/--diff
# and -X (GNU tar is okay).
#
# Author: Patrick Ohly, Patrick.Ohly@gmx.de
# License: do whatever you like with it...
#
set -e
#
# Edit this script to customize it:
#
# directories to be backed up - without leading
# slash, but relative to /
dirs=".snapshots/hourly.0/export"
# the DVD writer
dev=/dev/scd0
# intermediate mount point for backup
mnt=/mnt/cdrom
# intermediate file with exclude patterns (not deleted,
# to allow inspection)
exclude=/tmp/backup.exclude
# a logfile of backup/verify process
log=/tmp/backup.log
# the image will have one subdirectory with this
# prefix followed by...
prefix=backup-
# ... the current date/time in this format
current="$prefix`date +%Y-%m-%d-%H:%M`"
# file exclusion patterns, see mkisofs -exclude-list
cat >$exclude <<EOF
*~
EOF
# other mkisofs options - note that -J is not used
# here because it caused mkisofs to abort due to
# filename collisions. It might be useful to read
# the backup under Windows. -D is used to preserve
# the directory structure, even if that requires
# breaking the ISO 9660 standard.
mkisofsopts="-R -D"
case "$1" in
        incremental)
                mode=-M
                mount $dev $mnt
                root="-root $current -old-root `cd $mnt && ls -d $prefix* | tail -1`"
                umount $mnt
                ;;
        full)
                mode=-Z
                root="-root $current"
                ;;
        verify)
                mount $dev $mnt
                # choose the tar command that better suits you...
                cmd="(cd $mnt/`cd $mnt && ls -d $prefix* | tail -1` && tar cf - *) | (cd / && tar df - -X $exclude $dirs ) 2>&1 | tee $log"
                # cmd="(cd $mnt/`cd $mnt && ls -d $prefix* | tail -1` && star -c -f - *) | (cd / && star -diff diffopts=perm,type,uid,gid,size,data,rdev,symlink,mtime,ctime -f - -V `sed -e 's/\(.*\)/pat=\1/' $exclude` $dirs ) 2>&1 | tee $log"
                echo $cmd
                set +e
                eval $cmd
                res=$?
                umount $mnt
                exit $res
                ;;
        *)
                echo "usage: $0 full|incremental|verify"
                exit 1
                ;;
esac
cd /
cmd="growisofs $mode $dev $root -quiet $mkisofsopts -exclude-list $exclude -graft-points `for i in $dirs; do echo $i=$i; done` 2>&1 | tee $
log"
echo $cmd
eval $cmd
exit $?
 



Reply to: