Re: Cloning A Hard Disk Over The Network Using Ultrix
On 10/21/2017 5:40 AM, Rob Jarratt via cctech wrote: > I have a couple of hard disks I want to make dd copies of. I have Ultrix > running on my DECstation 5000/240 with the disk I want to clone attached to > it. The trouble is that I don't have enough disk space on the machine to > clone the disk and then grab the image using FTP. I have been trying to find > a way to pipe the dd output over the network to a SIMH Ultrix machine that > has plenty of disk space. I tried piping dd into rcp, but rcp doesn't seem > to take input from standard input. I have looked at cpio, but that too > appears not to accept input from standard input. > > > > Unix is not my strong point. Are there any other ways I could pipe the dd > output across the network to a machine that has enough disk space? > > > > Thanks > > > > Rob > > One way would be to attach the drive to an x86 machine that supports the disk drives, and use clonezilla. Another way, which I have used, is to use perl or Python to do the job. They are relatively small, so I just included mine here. I had trouble with the perl version under Linux at some point, so now on the Linux side, I use a Python version. NOTE: I am not very fluent in Python. Also, I don't use the Python server version. #!/usr/bin/perl # # Simple program for piping output (such as tar) from one system to another. # Contains client and server in the same script. # # Usage: tcppipe [ -c server [-i file] ] | [ -s [-o file] ] [-p port] # # The client reads standard input by default and sends it to "server" on "port". # The server writes standard output by default. # # Port defaults to 1025 # # JRJ 12/95 # use Getopt::Std; use Socket; $debug=1; $PROGRAM='tcppipe'; $VERSION='V1.0'; $PORT = 4097; $MTU=65536; $AF_INET=2; $SOCK_STREAM=1; $PF_INET=2; $sockaddr='S n a4 x8'; # # Get and validate options. # getopts('c:si:o:p:') || usage(); if(($opt_c && $opt_s) || (!$opt_c && !$opt_s) || ($opt_c && $opt_o) || ($opt_s && $opt_i)) { usage(); } if(!$opt_p) { $opt_p = $PORT; } # # Call the client or server piece, as appropriate. # if($opt_c) { return(pipe_client($opt_c,$opt_p,$opt_i)); } else { return(pipe_server($opt_p,$opt_o)); } # # Client piece # sub pipe_client { local($server,$client_port,$infile) = @_; if($infile && ! -f $infile) { die "$0: $infile is not a valid file.\n"; } # # Open the file. In binary, if you please... # if($infile) { open(INFILE,$infile) || die "$0: Can't open file $infile: $!"; $fd = INFILE; } else { $fd = STDIN; } binmode $fd; if($debug) { print "Server: $server \n"; } # # Do some work to prepare the socket data structures # ($pname, $paliases, $proto) = getprotobyname('tcp'); ($hname, $haliases, $htype, $hlen, $hip) = gethostbyname($server); if(!defined($hip)) { die "$0: Unknown host: $server : $! "; } if($debug) { @nip = unpack('C4',$hip); print "Host address for $server: @nip \n"; } $netaddr = pack($sockaddr, $AF_INET, $client_port, $hip); socket(SERVER,$PF_INET,$SOCK_STREAM,$proto) || die "Can't create socket: $!"; # # Open the connection to the server. # connect(SERVER,$netaddr) || die "Can't connect to server: $!"; select(SERVER); $|=1; select(stdout); if($debug) { print "Connected to $server\n"; } # # Server indicates it's name and version # $_=; if($debug) { print "Server: $_"; } /^220 $PROGRAM $VERSION\n$/ || die "$0: Unexpected server response: $_"; # # Send the file. # while(read($fd,$buf,$MTU)) { if($debug) { print "Read in " . length($buf) . " bytes.\n"; } print SERVER $buf || die "Can't send data to server: $!"; if($debug) { print "Sent...\n"; } } # # All done # close(SERVER); close($fd); print "Transfer completed.\n"; exit 0; } # # Server piece # sub pipe_server { local($server_port,$outfile) = @_; # # Open the file. In binary, if you please... # if($outfile) { open(OUTFILE,">$outfile") || die "$0: Can't open file $infile: $!"; $fd = OUTFILE; } else { $fd = STDOUT; } binmode $fd; # # Do some work to prepare the sock
RE: Cloning A Hard Disk Over The Network Using Ultrix
The rsh solution worked for me actually. I used this: dd if=/dev/rrz1c conv=noerror,sync | rsh ult1 dd of=/usr/rz1.dd Where “ult1” was the remote node Thanks Rob From: Huw Davies [mailto:huw.dav...@kerberos.davies.net.au] Sent: 23 October 2017 09:32 To: r...@jarratt.me.uk; Rob Jarratt ; General Discussion: On-Topic and Off-Topic Posts Subject: Re: Cloning A Hard Disk Over The Network Using Ultrix On 21 Oct 2017, at 21:40, Rob Jarratt via cctalk mailto:cctalk@classiccmp.org> > wrote: I have a couple of hard disks I want to make dd copies of. I have Ultrix running on my DECstation 5000/240 with the disk I want to clone attached to it. The trouble is that I don't have enough disk space on the machine to clone the disk and then grab the image using FTP. I have been trying to find a way to pipe the dd output over the network to a SIMH Ultrix machine that has plenty of disk space. I tried piping dd into rcp, but rcp doesn't seem to take input from standard input. I have looked at cpio, but that too appears not to accept input from standard input. Unix is not my strong point. Are there any other ways I could pipe the dd output across the network to a machine that has enough disk space? netcat (nc) is the usual tool to do this on Unix type systems. Whether it’s available for Ultrix I don’t know but it may ‘just compile’. If not, it’s not hard to write two simple programs to read from stdin and output to a TCP/IP socket on another host and the second to read from the socket and output to stdout. If I had to write the programs I’d either google for an example to copy or have a read of Stevens “TCP/IP illustrated” book series - the only risk of reading them (there are 3 volumes) is that you can spend 6 months just learning and not doing :-)' Huw Davies | e-mail: huw.dav...@kerberos.davies.net.au <mailto:huw.dav...@kerberos.davies.net.au> Melbourne| "If soccer was meant to be played in the Australia| air, the sky would be painted green"
Re: Cloning A Hard Disk Over The Network Using Ultrix
On Sat, 21 Oct 2017, Rob Jarratt wrote: I have a couple of hard disks I want to make dd copies of. I have Ultrix running on my DECstation 5000/240 with the disk I want to clone attached to it. The trouble is that I don't have enough disk space on the machine to clone the disk and then grab the image using FTP. I have been trying to find a way to pipe the dd output over the network to a SIMH Ultrix machine that has plenty of disk space. I tried piping dd into rcp, but rcp doesn't seem to take input from standard input. I have looked at cpio, but that too appears not to accept input from standard input. You don't use rcp but rsh (or ssh), for example: # dd if=/dev/... bs=32768 conv=noerror,sync | rsh otherhost "cat >/dest/path" You should use a bigger blocksize than the default of 512 bytes, otherwise reading will be quite slow... Or (my preferred way under UNIX), just mount a remote filesystem via NFS ;-) Christian
Re: Cloning A Hard Disk Over The Network Using Ultrix
> On 21 Oct 2017, at 21:40, Rob Jarratt via cctalk > wrote: > > I have a couple of hard disks I want to make dd copies of. I have Ultrix > running on my DECstation 5000/240 with the disk I want to clone attached to > it. The trouble is that I don't have enough disk space on the machine to > clone the disk and then grab the image using FTP. I have been trying to find > a way to pipe the dd output over the network to a SIMH Ultrix machine that > has plenty of disk space. I tried piping dd into rcp, but rcp doesn't seem > to take input from standard input. I have looked at cpio, but that too > appears not to accept input from standard input. > > > > Unix is not my strong point. Are there any other ways I could pipe the dd > output across the network to a machine that has enough disk space? netcat (nc) is the usual tool to do this on Unix type systems. Whether it’s available for Ultrix I don’t know but it may ‘just compile’. If not, it’s not hard to write two simple programs to read from stdin and output to a TCP/IP socket on another host and the second to read from the socket and output to stdout. If I had to write the programs I’d either google for an example to copy or have a read of Stevens “TCP/IP illustrated” book series - the only risk of reading them (there are 3 volumes) is that you can spend 6 months just learning and not doing :-)' Huw Davies | e-mail: huw.dav...@kerberos.davies.net.au Melbourne| "If soccer was meant to be played in the Australia| air, the sky would be painted green"
Cloning A Hard Disk Over The Network Using Ultrix
I have a couple of hard disks I want to make dd copies of. I have Ultrix running on my DECstation 5000/240 with the disk I want to clone attached to it. The trouble is that I don't have enough disk space on the machine to clone the disk and then grab the image using FTP. I have been trying to find a way to pipe the dd output over the network to a SIMH Ultrix machine that has plenty of disk space. I tried piping dd into rcp, but rcp doesn't seem to take input from standard input. I have looked at cpio, but that too appears not to accept input from standard input. Unix is not my strong point. Are there any other ways I could pipe the dd output across the network to a machine that has enough disk space? Thanks Rob