You are not logged in.
Pages: 1
Hello!
I've just intalled archlinux on my laptop, after using it on my desktop for a while. How ever I wanted the machines to be almost the same, so I copied the home directory.
This went wrong at some point. Maybe because I used sudo at first point for copying the home directory over.
Why I did was:
sudo cp -a /media/mnt/klim /home/klimBut after it were complete I saw root had permissions to everyhing in the directory, so I used chown
sudo chown -R klim:users klim (from /home)What concerns me is that the old directories has some strange permissions / other permissions than the new ones.
As you can see on this screenshot:
http://i.ole.im/img/krvesv.png
The directories ok and usr are created from my laptop. My desktop has the same permissions for all directories as ok and usr
How do I change the permissions back, so it's the right ones?
Last edited by KLIM (2012-01-22 20:17:51)
Offline
The problem is probably because the volume you used to transfer your home directory was formatted with ntfs. Unfortunately, ntfs has no concept of linux permissions. The only way to get around this would be to use tar (or similar) to transfer the directory. You could use chmod -R ... to change each file/directory to match the source.
Last edited by skunktrader (2012-01-21 00:15:35)
Offline
You are absolutely right, I used a NTFS formated drive to move the directory. But if I tar my home directory on my desktop. Can I then use NTFS drive for moving the file to my laptop and extracting it there, and it will still have the same permissions?
Offline
There's a simple way to get the permissions of ok and usr directory on all files and directory. Just execute the following command in your home directory:
chmod -R 755 *But be sure you want these permissions for all the directories/files.
Offline
Can I then use NTFS drive for moving the file to my laptop and extracting it there, and it will still have the same permissions?
Yes, if you create the archive/extract the files with the '-p' ('--preserve-permissions" / '--same permissions') and '--same-owner' option.
Create archive:
tar --same-owner -p -cf <tarname.tar> <directories to tar>Extract archive into current directory:
tar --same-owner -p -xf <tarname.tar>The second command will require superuser privileges if you try to extract files that you do not own. Omitting '--same-owner' will still preserve permissions, but change ownership of all files to the current user. If your home directory only contains files belonging to you, you don't need '--same-owner'.
Last edited by lastchancetosee (2012-01-21 17:30:36)
My ship don't crash! She crashes, you crashed her!
Offline
Thanks a lot for the replies, it's solved now. I used the tar method for moving my files. Had some struggling with the hidden files got it solved though by first extracting the whole home directory to a directory inside my home directory on my laptop. Then afterwards moving the files and used this command for moving the hidden files:
find . -mindepth 1 -maxdepth 1 -exec mv -t.. -- {} +Offline
Pages: 1