I had some trouble getting Linux installed to a particular netbook and had to restart it from scratch multiple times. Re-typing the same commands to set up networking and bootstrap the install was onerous, so I tried to use a USB stick, but couldn't mount it. The system saw the block device, but couldn't understand vfat. At my wits' end, I just used dd to write the tar file directly to the device.

tar -c stuff-i-needed | sudo dd of=/dev/disk3

It took just a second. Then I plugged the usb stick into the target system, pointed tar directly at the block device...

dd if=/dev/sdc | tar -x

and shortly the files I needed appeared. But even though all the files in the tarball were complete, tar -x kept running. And running. And running.

The USB disk has a capacity of 512GB. So I suppose that explains why tar kept reading, at a high level. But doesn't tar have some kind of mechanism to know the end of the tarfile itself has been reached? Why did tar keep on reading from disk, and what was it going to do with all that meaningless data?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.