From: Conor Daly (conor.daly at domain oceanfree.net)
Date: Mon 11 Jun 2001 - 22:21:39 IST
On Mon, Jun 11, 2001 at 06:36:16PM +0100 or so it is rumoured hereabouts,
Ruairi Newman thought:
> Hi all,
>
> I have a question that someone might be able to help me with. I have been
> asked if it's possible to take disk images of various WinXX-based machines a
> la Norton Ghost (without buying Ghost) and write them to a CD-Writer across
> the network automatically. The CD-Writer is also on a Windows machine but
> I intend changing that over to Linux as soon as I've got time anyway.
>
> Any thoughts on the best way to go about this? I'm thinking in terms of
> 'dd' but I doubt that I could manage to pipe the dd image directly as it's
> being created to a networked CD-Writer without buffer-underruns.
>
I'd be inclined to run it all *from* the Linux box with the CD-RW. Set up
"file and Print Sharing" on the doze boxes, use
mount -t smbfs //doze-box/share-name /mount/point
to mount the box to clone, then use mkisofs to create an iso image, then
use cdrecord to write the CD. You'd need to figure out how to feed
passwords to the mount command (which must run as root to do the smbfs
stuff, or that's what I've found. If you get this figured out for an
ordinary user, please let me know) but, once that's done, you can easily
automate the process. What to do with that process if the drive goes over
640Mb is left as an exercise for the reader (You can't use split to split
an ISO image though). Overall process is something like:
mount -t smbfs //doze-box/share-name /mount/point
mkisofs -r -J -o doze.iso /mount/point
cdrecord doze.iso
umount /mount/point
A little wrapper for mkisofs is below. Use the "size" option to get the
image size without having to calculate it from the blocks count.
################# cdr-image #######################
#!/bin/bash
if [ $1 ]; then
if [ $1 = "size" ]; then
if [ $# = "1" ]; then
DIR="."
fi
BLKS=`mkisofs -q -J -r -print-$* $DIR 2>&1| cut -f8 -d" "`
KAYS=$(($BLKS * 2))
MEGS=$(($BLKS / 512))
GIGS=$(($BLKS / 512 / 1024))
GIGT=$(($BLKS * 100 / 512 / 1024))
GIGT=$(($GIGT - ($GIGS * 100)))
echo "Blocks: "$BLKS
echo "The size of this image is..."
echo $KAYS"kb"
echo $MEGS"Mb"
echo $GIGS"."$GIGT"Gb"
else
if [ $# = "2" ]; then
DIR="."
fi
mkisofs -J -r $* $DIR
fi
else
echo "Useage: "$0" [size] -o <iso.filename> <Directory> (Default current)"
fi
############### end cdr-image #####################
-- Conor Daly <conor.daly at domain oceanfree.net> Domestic Sysadmin :-) --------------------- Faenor.cod.ie 9:38pm up 23 days, 9:46, 0 users, load average: 0.04, 0.01, 0.00 Hobbiton.cod.ie 9:47pm up 22 days, 10:48, 1 user, load average: 0.16, 0.06, 0.02
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:10:37 GMT