LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 03-16-2016, 06:11 PM   #1
StepNjump
Member
 
Registered: Jul 2011
Posts: 32

Rep: Reputation: Disabled
How to copy to preserve original permissions and ownership after crash


Hi guys,

I have a situation.
I removed compiz the other day and that crashed my system.
So I used a live CD, moved all my data to an external hard drive using cp -avr command in the hope I was going to keep all my permissions.

I kept the same username when I reinstalled linux but the easy move that I had anticipated is not working.

My archives are showing 600 instead of 644 and my directories 700 instead of 755

There are so many layers of directories that I was wondering if there might be anything I could easily do to make the move onto their new home partition other than having to run a script?

Thank you very much in advance,

Step
 
Old 03-16-2016, 07:13 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
when copying with the cp ommand use the -p switch as root to preserve the permisions, better yet if you are moving a lot of data use tar which will keep permissions etc, any thing you may have already copied have probably lost the origanal perns and will now have whatever perms the copy command issuer had.

ALWAYS MAKE A BACKUP before uninstalling system software.
 
1 members found this post helpful.
Old 03-16-2016, 07:56 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Note the as root.
chmod accepts a "recursive" argument, but that may just be opening a whole 'nuther can of worms.
 
Old 03-17-2016, 03:51 PM   #4
StepNjump
Member
 
Registered: Jul 2011
Posts: 32

Original Poster
Rep: Reputation: Disabled
Thank you very much Keith. God bless

Step

Quote:
Originally Posted by Keith Hedger View Post
when copying with the cp ommand use the -p switch as root to preserve the permisions, better yet if you are moving a lot of data use tar which will keep permissions etc, any thing you may have already copied have probably lost the origanal perns and will now have whatever perms the copy command issuer had.

ALWAYS MAKE A BACKUP before uninstalling system software.
 
  


Reply

Tags
chmod, chown, permissions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux:Copy, change permissions and ownership of a file in a command LXer Syndicated Linux News 0 03-15-2016 04:40 AM
NAS over CIFS on an old Fedora Core distro does not preserve file ownership on copy nurikabe Linux - Newbie 12 04-09-2009 03:09 PM
Copy files retaining ownership/permissions stefaandk Linux - Newbie 4 09-07-2006 08:25 PM
Make KDE/Konqueror preserve time, ownership on file copy tisource Linux - Software 2 06-27-2006 01:23 PM
Why doesn't "cp -p <file>" copy <file> and preserve ownership? davidas Linux - Newbie 5 04-12-2004 05:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 07:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration