I sort-of-cloned an existing Debian 7.x distro by copying the contents of the root filesystem (not the special dirs of course) to another HDD. I booted, things seem to run, but - I get some weird errors. One of them - sudo and su wouldn't run, complaining about lack of a setuid permission for the binaries. Well, I fixed that, and now they don't complain, but - maybe there are other files whose permission has been screwed up during the copy? Is there someway to verify and fix all relevant file permissions?
Original host (or another similar freshly installed distro):
getfacl -R / > permissions.acl
That's what God made
I clone my installs using
rsync -avxt --delete-before, then I run
lilo on them to make them independently bootable. Yeah, have to make sure your
fstab doesn't use UUIDs though, or everything goes to hell. I use labels so that it doesn't matter what the disk order (
sdb, etc.) is.
There is no easy way I can think of. One way would be to reinstall each and every package you have in
/var/cache/apt/archives as root (
cd /var/cache/apt/archives for i in *.deb do sudo dpkg -Gi $i done
Next time, use the
-p option of rsync/cp or equivalent of whatever you were using to copy the files.
Use tar to archive the files and then extract them. You p key when extract to keep original partitions
rsync to re-copy the files. I think it will notice that only the permissions need to be copied, so it will fix them up while leaving the contents alone, so it should be relatively quick.