How do you copy diskettes on a Unix Sun Solaris machine.
I have a set of diskettes I have to copy and I would like to know the
equivalent to a DOS diskcopy.
Thanks
Ilan
--
-----------------------------------------------------------------------------
Paul Gimpelev, Systems Administrator
Investment Management Services, Inc
Quote of the year: "Don't eat yellow snow !"
------------------------------------------------------------------------------
I assume you are copying 3.5" Floppy disks:
##########################################################################
# diskcopy - duplicate a 3.5" floppy disk
# Heiner Steven (hei...@hsysnbg.nbg.sub.org), Public Domain
##########################################################################
PN=`basename $0` # program name
VER='0.1 (beta)'
: ${FLOPPY:=/dev/rfd0}
: ${EJECT:=eject}
DiskBS=18k
FileBS=18k
Tmp=${TMPDIR:=/tmp}/dc$$
Usage () {
echo "$PN - duplicate 3.5\" floppy disks, $VER (hs '95)
usage: $PN source target
The default source device is FLOPPY=$FLOPPY. If no target
device is specified, a temporary file is used. If a target
device is given, a two-drive-copy is assumed." >&2
exit 1
}
Msg () {
for i
do echo "$i" >&2
done
}
Fatal () { Msg "$@"; exit 1; }
GetYN () {
while :
do
Msg "" "$@"
read answer || exit 2
case "$answer" in
[yYjJ]*) return 0;;
[nN]*) return 1;;
[qQ]*) exit 0;
esac
Msg "" "Enter 'y' for yes or 'n' for no" "Please try again"
done
}
EjectFloppy () { $EJECT || EJECT=; }
Out="$Tmp"
while [ $# -gt 0 ]
do
case "$1" in
--) shift; break;;
-h) Usage;;
-*) Usage;;
*) break;; # First file name
esac
shift
done
if [ $# -gt 2 ]
then Usage
elif [ $# -ge 2 ] # Two drive copy
then Out="$2"
elif [ $# -ge 1 ] # One drive, use temporary file
then FLOPPY="$1"
fi
[ "$FLOPPY" = "$Out" ] && Fatal "cannot read and write to the same device"
trap "rm -f $Tmp > /dev/null 2>&1" 0
trap "exit 2" 1 2 3 15
n=1
while GetYN "Copy Disk $n (y/n, q)? \c"
do
Msg "Reading Disk $n..."
if dd if=$FLOPPY of=$Out ibs=$DiskBS obs=$FileBS
then
EjectFloppy
if [ "$Out" = "$Tmp" ]
then
Copy=1
while GetYN "WRITE new Copy $Copy (y/n, q)? \c"
do
Msg "Writing copy $Copy..."
if dd if=$Out ibs=$FileBS of=$FLOPPY obs=$DiskBS
then
Msg "Copy $Copy successfully written."
Copy=`expr ${Copy:-1} + 1`
else
Msg "" "Could not write to floppy disk!" \
"Please check the disk drive, and try again"
fi
EjectFloppy
done
fi
else
Msg "" "Cannot read floppy disk!" \
"Please check the disk drive, and try again"
EjectFloppy
continue
fi
n=`expr ${n:-1} + 1`
done
Heiner
--
-------------------------------------------------------------
/ Heiner Steven h...@bintec.de / The expressed opinions are /
/ BinTec Communications / mine, not BinTec's -- /
/ Willstaetterstr. 30 ------- ...even if they should be ;-)/
/ D-90449 Nuernberg / http://www.bintec.de/english /
------------------------------------------------------------
man dd
This is the equiv of the dos diskcopy.
: How do you copy diskettes on a Unix Sun Solaris machine.
: I have a set of diskettes I have to copy and I would like to know the
: equivalent to a DOS diskcopy.
: Thanks
: Ilan
You can get the "mtools". With them you can copy from diskettes
to hardisk and viceversa.
--
Benito Gattuso
Hamburg, Germany