LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2010, 04:12 PM   #1
goldeneye075
LQ Newbie
 
Registered: Feb 2009
Posts: 18
Blog Entries: 2

Rep: Reputation: 0
copy files with preserving the attributes


I need to copy my data from the pc to an external hard drive with keeping the attributes;
so i used the command

cp -rp ~/sourceDir ~/Destination

but when i am coping it it give the error message
"cp: failde to preserve ownership for 'file' : Operation not permitted

and it copied the files to the destination but the attributes has changed from
-rw-r--r-- to
-rwxr-xr-x

I tried to copy it by loging as the root also but still the same thing happens. If possible please let me know how to copy the files with preserving the attributes

Thanks
 
Old 06-03-2010, 04:24 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
What is the file system type on the external drive?
 
Old 06-03-2010, 04:50 PM   #3
goldeneye075
LQ Newbie
 
Registered: Feb 2009
Posts: 18
Blog Entries: 2

Original Poster
Rep: Reputation: 0
/dev/sdb1 vfat


Quote:
Originally Posted by rweaver View Post
What is the file system type on the external drive?
 
Old 06-03-2010, 05:04 PM   #4
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
vfat doesn't support many features you would normally expect to be in place on a linux drive. Like full support of ownership and permissions/modes... see: http://en.wikipedia.org/wiki/FAT_filesystem_and_Linux for more detail.

Make the drive ext3/4, etc and you won't have as many issues. Long and short, vfat is crap for *nix operating systems.
 
Old 06-03-2010, 05:10 PM   #5
goldeneye075
LQ Newbie
 
Registered: Feb 2009
Posts: 18
Blog Entries: 2

Original Poster
Rep: Reputation: 0
how can i change the file system of my external hard to ext3/4?
 
Old 06-03-2010, 06:05 PM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,508

Rep: Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890Reputation: 2890
Backup the files somewhere and run mkfs.ext[3/4] on drive to format
 
Old 06-03-2010, 07:31 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Just bear in mind that *if* you do that you won't be able to trivially
access the drive from any other OS but Linux; MacOS and Windows
won't be natively able to access it.
 
Old 06-04-2010, 09:35 AM   #8
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
True... but even formating it from windows as ntfs would be a better option provided you've got support for it in linux turned on.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
copy to network drive preserving date/time stamp SBFree Linux - Newbie 8 07-13-2009 04:48 PM
retaining extended attributes of a file after a copy info1686 Linux - General 2 01-18-2009 11:54 PM
Impossible to change files attributes to all files in the folder maiden2 Linux - Software 1 09-30-2008 05:09 AM
preserving dates when backing up files newbiesforever Linux - General 8 08-17-2007 12:17 AM
Preserving personal files between distros thomasfingram Linux - Newbie 1 08-13-2005 09:06 AM


All times are GMT -5. The time now is 02:48 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration