Hi Mihai
On Mon, 30 Oct 2017 21:23:51 +0200 Mihai Popescu wrote:
> I am trying to setup a solution on an OpenBSD computer, where i want
> to upload and then download large volume of data. I was using ftpd
> daemon to do this, but I wonder if there is another way to do this,
> regarding speed of transfer.
>
If on a trustworthy private network or via a cross over network cable,
netcat can be quiet fast, e.g:
# I started netcat listening on a host with spare space:
<operator@torana:tmp 0>$ umask 077; nc -l 55555 | dd
of=/mnt/kingswood/_home.dump
# On the cramped host, I unmounted & disk dumped to netcat:
<operator@kingswood:tmp 0>$ mktemp
/tmp/operator/tmp.UZEOHQyzDH
<operator@kingswood:tmp 0>$ dump -0anu -f - /dev/rwd1f
2>/tmp/operator/tmp.UZEOHQyzDH |
nc -N -w 15 torana.internal 55555
DUMP: Date of this level 0 dump: Fri Aug 21 12:56:36 2015
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rwd1f (/home) to standard output
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 190840212 tape blocks.
DUMP: Volume 1 started at: Fri Aug 21 12:56:48 2015
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: 0.80% done, finished in 10:21
DUMP: 1.62% done, finished in 10:06
DUMP: 2.44% done, finished in 9:59
DUMP: 3.26% done, finished in 9:52
DUMP: 4.08% done, finished in 9:47
DUMP: 4.91% done, finished in 9:40
.....
....
...
DUMP: 97.54% done, finished in 0:15
DUMP: 98.35% done, finished in 0:10
DUMP: 99.17% done, finished in 0:05
DUMP: 99.99% done, finished in 0:00
DUMP: 190837578 tape blocks
DUMP: Date of this level 0 dump: Fri Aug 21 12:56:36 2015
DUMP: Volume 1 completed at: Fri Aug 21 23:06:51 2015
DUMP: Volume 1 took 10:10:03
DUMP: Volume 1 transfer rate: 5213 KB/s
DUMP: Date this dump completed: Fri Aug 21 23:06:51 2015
DUMP: Average transfer rate: 5213 KB/s
DUMP: level 0 dump on Fri Aug 21 12:56:36 2015
DUMP: DUMP IS DONE
# Netcat to dd on the spacious host logged:
314140569+87238623 records in
381675140+0 records out
195417671680 bytes transferred in 37251.937 secs (5245839 bytes/sec)
<operator@torana:tmp 0>$ df -h /mnt/kingswood
Filesystem Size Used Avail Capacity Mounted on
/dev/sd1g 210G 182G 17.5G 91% /mnt/kingswood
<operator@torana:tmp 0>$ ls -lh /mnt/kingswood/
total 381722816
-rw------- 1 operator operator 182G Aug 21 23:06 _home.dump
....
...
# After rejigging the disks on the cramped host, newfs, etc, I restored:
<root@kingswood:/home 0># nc -l 55555 | restore -ryvf - >
restore.output.$RANDOM 2>&1
# Transfer the dump back to the previously cramped host, via netcat:
<operator@torana:tmp 0>$ dd if=/mnt/kingswood/_home.dump |
nc -v -N -w 15 kingswood.internal 55555
Connection to kingswood.internal 55555 port [tcp/*] succeeded!
381675140+0 records in
381675140+0 records out
195417671680 bytes transferred in 29107.667 secs (6713615 bytes/sec)
<root@kingswood:/home 0># less /home/restore.output.569
Level 0 dump of /home on kingswood.internal:/dev/wd1f
Label: none
Verify tape and initialize maps
Dump date: Fri Aug 21 12:56:36 2015
Dumped from: the epoch
Begin level 0 restore
Initialize symbol table.
Extract directories from tape
Calculate extraction list.
Make node ......
<operator@kingswood:tmp 0>$ df -h /home
Filesystem Size Used Avail Capacity Mounted on
/dev/wd1d 299G 182G 102G 64% /home
182G was restored on the newly formatted and enlarged partition
(now 'd' instead of 'f'), via netcat, from another host.
As well as disk partitions, dump(8) works on files & directories too.
Everything needed is in base OpenBSD.
Ace!
--
Craig Skinner | http://linkd.in/yGqkv7