[SLL] How burn 2g+ file to DVD?

Tim Maher tim at consultix-inc.com
Sun Jan 21 14:58:25 PST 2007


I figured out how to do the backup of 4.7g files to DVD, without
using the SCSI emulation of IDE or any other complications.
Here's the basic script, which is pretty stable at this point:

#! /bin/sh
# Copies files named as arguments to DVD drive
# Tim Maher, tim at consultix-inc.com

image=/root.old/tmp/dvd_image

blocks=4489
echo -n 'FS image will be this size: ' ; expr $blocks \* 1024 \* 1024

echo RETURN to create ; read junk

set -x
nice dd if=/dev/zero of=$image bs=1024k count=$blocks
ls -l $image

# Minimizing inode table (-N 4), and maximizing block size
nice mke2fs -b 4096 -N 4 -m 0 -F $image              || exit

umount /mnt 2>/dev/null

mounted=no
for num in 1 2 3 4
do
	mount $image /mnt -t ext2 -o loop=/dev/loop$num &&
		mounted=yes && break
done
test "$mounted" = no && exit 12

df -k /mnt

echo RETURN to copy data to image ; read junk

cp -p "$@" /mnt

ls -ld /mnt/*
df -k /mnt

echo RETURN to burn disk; read junk

umount /mnt
nice +19 growisofs -dvd-compat -Z /dev/hdc=$image

-Tim
*-------------------------------------------------------------------*
|  Tim Maher, PhD  (206) 781-UNIX   http://www.consultix-inc.com    |
|  tim at ( Consultix-Inc, TeachMePerl, or TeachMeUnix ) dot Com    |
*-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-*
| Classes: 2/21: Basic Perl; 3/12: Basic UNIX/Linux; 3/16: Min Perl |
|  * Download free chapters from my Perl book at MinimalPerl.com *  |
*-------------------------------------------------------------------*



More information about the linux-list mailing list