View previous topic :: View next topic |
Author |
Message |
FreakWent n00b
Joined: 08 Feb 2004 Posts: 46
|
Posted: Sun Mar 29, 2009 7:52 am Post subject: Lost all file permissions, can _anything_ be done? |
|
|
Hi!
cp -uav / /mnt/backup
/mnt/backup is an NTFS volume!
(warranty replacement here)
cp -uav /mnt/backup /
All copies great! System boots, xorg runs.
However, all the files are owned by root and the permissions lost. Is there an emerge command or another tool, or a script that can extract this infor from portage and apply it to an existing filesystem?
Thanks! |
|
Back to top |
|
|
sasho23 Apprentice
Joined: 28 Dec 2005 Posts: 186 Location: Pamplona , Spain
|
Posted: Sun Mar 29, 2009 10:11 am Post subject: |
|
|
Hi, do this:
Code: |
chmod -R 750 /mnt/backup |
and thats all. |
|
Back to top |
|
|
cwr Veteran
Joined: 17 Dec 2005 Posts: 1969
|
Posted: Sun Mar 29, 2009 11:49 am Post subject: |
|
|
I don't think so; from what I understand NTFS isn't storing the correct permissions,
so there's nothing to copy back. The advantage of tar files is that they can be used
to store permissions regardless of the underlying filesystem, but that's hindsight.
I've had a few problems with permissions on Gentoo, since I don't like the whole
system to be owned by root (which is the default). Some files (about 20 in all,
ISTR) need to have odd permissions or owners; some directory trees (portage,
man) need to be owned by specific groups. Simply changing all ownership to
bin breaks the system, and the only way I've found to keep things working is to
write a script which checks the original filesytem for non-standard permissions
and owners and records the results. Another script can then be run to update
a current filesystem.
Not helpful in your case; I think you're going to have to proceed by trial and
error. The first thing is probably to run a "find" command on /bin, /etc, /sbin,
and /usr to list all files which don't have permissions 644, and all directories
which don't have permissions 755. They are the ones you'll have to look out
for, and deal with individually. It's a pretty tedious process, which is why I've
scripted it.
Will |
|
Back to top |
|
|
FreakWent n00b
Joined: 08 Feb 2004 Posts: 46
|
Posted: Mon Mar 30, 2009 2:07 am Post subject: Too bad I suppose |
|
|
Thanks guys.
I was after a magic emerge incantation, or an additional tool, such as eix is for searching.
Ah well, the lesson ahs been learnt! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|