find /sys/block /sys/class -name dev -printf '%h\n' |
while read d
do
    n=${d//*\//}
    i=$(<$d/dev)
    mknod $n ${d:5:1} ${i/:/ }
done