I was doing a scp to copy my Yun's filesystem to my local computer and it kept going for hours - I then found that there's a loop in the file structure:
proc/self/task/1870/fd/3/proc/self/task/1870/fd/3/proc/self/task/1870/fd/3/... and so on.
Can anyone explain why this is the case, and whether there's any reason this recursiveness is needed beyond the first ../fd/3?
/proc/self is a symlink to the process ID of the process trying to read the file. Then file descriptor /fd/3 is the descriptor that you're using to read /proc... and yay recursion.
The better way to handle this would be to run a "mount -l", iterate through the mounts listed, and then only copy those paths that have "normal" filesystem types (ext3, fat, zfs, whatever).
Is it correct then that if I copy everything except /sys and /proc over to a brand new Yun, it'd be identical in terms of function, support, packages, etc.?
They're not true filesystems related to storage devices (unlike ext4), they're dynamic reflections of the state of that particular device at that particular moment, generated by the device drivers and the kernel itself.
Try something simple like cat /process/meminfo over time, and load, and notice how it changes.