Figuring out how long the actual content is, isn't trivial, but it's important. And the size of kiosk.img ends up being much larger than necessary.Īgain, the default is for "dd" to copy the entire length of the source storage device, which could be much larger than the actual content. Like this: $ sudo dd if=/dev/disk5 of=kiosk.img bs=(content size in bytes) count=1 & syncįinding out the content size is not trivial (it depends on the source, how it was created, etc.), but the actual content might be 10% of the size of the source, which explains why all reads and writes take so long - much longer than necessary. The sync argument is very important - it flushes final writes to the device at the end of the process, to avoid having an incomplete device.Īnother approach is to find out how long the image is on the source device, and only copy that much data to the image file. The bs argument creates a block read, so it's faster. Here are the options I used: rsync -avz -progress /mysourcefolder /mytargetfolder Im running Ubuntu Server 9.10. There are no other transfers happening on the drive either. Linux considers anything stored on a file system as files, even block devices. That seems incredibly slow for a USB 2.0 enclosure. Permanenter Link des Eintrags.This may help: $ sudo dd if=/dev/disk5 of=kiosk.img bs=4M & sync Its running its first sync at the moment, but its copying files at a rate of only 1-5 MB/s. tar.bz2 of course.įeel free to add your file transfer quick hack here.ĭieser Eintrag wurde veröffentlicht in Allgemein, CommandLine, FileTransfer, Netcat, Network, Tar, Ubuntu von ccm. If you use something like gzip or bzip2 compression you should choose something like. Please note that on the receiver side you are completely free to choose a file name for the. You just setup a very fast file transfer. $ nc -w 10 remotehost 7878 > nameoftar.tar For convenience he also sets a timeout parameter (-w 10): The receiver has to call netcat and tell him to connect to the remote machine and the correct port and redirects the standard output to a file. Netcat is told to start in server mode (-l), listen on port 7878 (-p 7878) and shutdown itself after waiting 10 seconds after having seen an end of file in standard input (-q 10): the report which is displayed once the command finishes, such as: contains the speed which corresponds to the slowest one between: that is if I'm copying data from an USB drive which have a read speed of 5 MB/s to an SSD, dd will actually report 5 MB/s, independently of the speed of the SSD. Then use dd with exactly the following syntax, where x is the letter for the USB drive and y the letter for the internal drive which you have determined in the previous step: sudo dd. The next line tells tar to build a tarball and write it to standard output which is redirected via a pipe to netcat. Use sudo fdisk -l or gparted to find out which block devices your target internal hard disk (usually /dev/sda) and external USB hard disk (usually /dev/sdb) are. The sender has to call netcat in server mode and pipe content into it. I will just show you how to use it without compression for a directory. A very simple and even cross platform solution is using netcat and in case of a directory in combination with tar like the following steps. Both computer owners are just to lazy to setup something like ftp, smb, nfs. Imagine you are on lan party or on the road and quickly want to transfer a file or directory to another computer.
0 Comments
Leave a Reply. |