Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

diskcopy on unix

0 views
Skip to first unread message

Ilan Even-Or

unread,
Oct 15, 1996, 3:00:00 AM10/15/96
to

Hi There

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

unread,
Oct 15, 1996, 3:00:00 AM10/15/96
to

man dd

--
-----------------------------------------------------------------------------
Paul Gimpelev, Systems Administrator
Investment Management Services, Inc

Quote of the year: "Don't eat yellow snow !"
------------------------------------------------------------------------------

Heiner Steven

unread,
Oct 15, 1996, 3:00:00 AM10/15/96
to

Ilan Even-Or (eve...@netvision.net.il) wrote:
> 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.

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 /
------------------------------------------------------------

Ray Cotten

unread,
Oct 15, 1996, 3:00:00 AM10/15/96
to

Ilan Even-Or wrote:
>
> Hi There

>
> 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

man dd

This is the equiv of the dos diskcopy.

ra...@indy.net

Benito Gattuso

unread,
Oct 20, 1996, 3:00:00 AM10/20/96
to

Ilan Even-Or (eve...@netvision.net.il) wrote:
: Hi There

: 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

0 new messages