UFS Restoring permissions

In the process of rebuilding a system I copied all my files to a backup device, but on restoration I can't login because the permissions are not correctly set. Is there any way to restore permission? Can I use mtree() to reset permissions on/etc and anything else I need to boot up?
 
So you took an installed system, you backed up and restored "everything" (including /etc and everything else, which probably means /usr), and the restore screwed up the permissions, meaning didn't restore them. At this point, I would say you have a completely broken system and should reinstall.

I know little about mtree. In theory, it might help to just make everything world readable (and perhaps even world writeable): Start in single-user mode, and do "chmod -R a+rw /". But that would be completely insane, and even if it worked (not sure), you would end up with a completely insecure system which must never be exposed to the network. But also, the permissions and ownership on files are not trivial. You can't simply say thing like "everything under /etc is user=0 group=0 permissions=644", its much more complicated than that. So I don't know where you would get the specification for mtree from.

I suggest reinstalling. And stop doing things that hurt.
 
So you took an installed system, you backed up and restored "everything" (including /etc and everything else, which probably means /usr), and the restore screwed up the permissions, meaning didn't restore them. At this point, I could say you have a completely broken system and should reinstall.

I had a working system but wanted to repartition the disk it was on so did a quick copy ( cp -a / /mnt/backup). After repartitioning I copied the files back. The system booted up OK but I couldn't login because the permissions of certain files were incorrectly set. I guess cp() does something I was not aware of...
 
-a Archive mode. Same as -RpP

I didn't notice -p as well as -P... At least I learned something.
 
Back
Top