[TriLUG] cp of /dev hangs, but not tar

Jon Carnes jonc at nc.rr.com
Sat Jun 16 11:33:08 EDT 2007


The items in /dev are not files per say. They are created by the system
to help it managed devices. Their is nothing in these "files" rather the
important information is stored in the node space. Each named device has
a Major and Minor Block number associated with it that identifies that
device and what it does. 

Tar handles this well, as it recognizes that you are simply recording
the node info and there isn't really any file "data". Maybe we should
re-write cp so that it understands that as well?

Jon Carnes

On Sat, 2007-06-16 at 09:19, Joseph Mack NA3T wrote:
> Some of my backups involve a disk-to-disk `cp -ruvp`. Some 
> files in /dev (eg console, pty*) and a /var/lib/fifo I have 
> cause the cp to hang. If instead I tar up that directory, it 
> works fine. What's the difference between the read that cp 
> does and tar does?
> 
> Most of my machines are 2.4.x. I tried a 2.6 machine
> 
> This doesn't hang
> /tmp# cp -ruv /dev/console .
> 
> This hangs
> /tmp# cp /dev/console .
> 
> With 2.4, both hang.
> 
> Thanks
> Joe
> 
> -- 
> Joseph Mack NA3T EME(B,D), FM05lw North Carolina
> jmack (at) wm7d (dot) net - azimuthal equidistant map
> generator at http://www.wm7d.net/azproj.shtml
> Homepage http://www.austintek.com/ It's GNU/Linux!




More information about the TriLUG mailing list