You are not logged in.

#1 2009-12-24 19:48:45

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

Cannot create / delete files from directories copied from cdrom

I copied my backed up projects (mainly java) from a cdrom. Now all the directories inside have wrong permissions (not writable).

Even if I changed the permissions to +w I cannot delete or create files in them. There are many directories. I copied with mc (F5).

Am I making any mistake ? How should I copy them back ?

regards,
Hardik

Offline

#2 2009-12-24 19:51:41

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Cannot create / delete files from directories copied from cdrom

ls -l a file as an example and paste the result here


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2009-12-24 20:03:06

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

Re: Cannot create / delete files from directories copied from cdrom

If I create the folder and copy other files inside, it works. But still I have to change the permission (+w). Can I copy with default umask ? Should I change something in fstab ?




Here the output ..


[hardik@moonlight: workspace ]$ ll ~/projects/jsf/HelloJsf 
total 76
-r--r--r-- 1 hardik hardik  3370 Aug 30 21:16 HelloJsf.iml
-r--r--r-- 1 hardik hardik 17522 Aug 30 21:16 HelloJsf.ipr
-r--r--r-- 1 hardik hardik 38757 Sep 12 10:04 HelloJsf.iws
-r--r--r-- 1 hardik hardik  2139 Aug 30 21:17 pom.xml
dr-xr-xr-x 3 hardik hardik  4096 Aug 29 07:30 src/
dr-xr-xr-x 7 hardik hardik  4096 Aug 30 22:00 target/
[hardik@moonlight: workspace ]$ ln -sv ~/projects/jsf/HelloJsf .
`./HelloJsf' -> `/home/hardik/projects/jsf/HelloJsf'
[hardik@moonlight: workspace ]$ cd HelloJsf
[hardik@moonlight: HelloJsf ]$ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building HelloJsf Maven Webapp
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory /home/hardik/projects/jsf/HelloJsf/target
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to delete directory: /home/hardik/projects/jsf/HelloJsf/target. Reason: Unable to delete file /home/hardik/projects/jsf/HelloJsf/target/HelloJsf.war

[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Dec 24 20:58:54 CET 2009
[INFO] Final Memory: 4M/9M
[INFO] ------------------------------------------------------------------------
[hardik@moonlight: HelloJsf ]$ ll
total 76
-r--r--r-- 1 hardik hardik  3370 Aug 30 21:16 HelloJsf.iml
-r--r--r-- 1 hardik hardik 17522 Aug 30 21:16 HelloJsf.ipr
-r--r--r-- 1 hardik hardik 38757 Sep 12 10:04 HelloJsf.iws
-r--r--r-- 1 hardik hardik  2139 Aug 30 21:17 pom.xml
dr-xr-xr-x 3 hardik hardik  4096 Aug 29 07:30 src/
dr-xr-xr-x 7 hardik hardik  4096 Aug 30 22:00 target/
[hardik@moonlight: HelloJsf ]$ chmod -v +w -R .

Offline

#4 2009-12-24 20:04:37

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: Cannot create / delete files from directories copied from cdrom

everything's read only tongue


.:[My Blog] || [My GitHub]:.

Offline

#5 2009-12-24 20:07:54

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

Re: Cannot create / delete files from directories copied from cdrom

yes, and I want to change that with the last command ... it works .. but I want to avoid changing the permissions...

Offline

#6 2009-12-24 20:12:30

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: Cannot create / delete files from directories copied from cdrom

try:

sudo chmod -R o+w [insert name of top directory here]

It should recursively change the permission for all files in the directory such that "other" has write privilege.   BE SURE you are acting only on the directory you want to change.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#7 2009-12-24 21:31:18

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Cannot create / delete files from directories copied from cdrom

That's to be expected, read only medium yields read only files, even after copying to a rw medium.
I would suggest chmod -R u+w instead of chmod -R o+w, the owner (you) is the one that needs write permission not everyone else wink .


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#8 2009-12-25 12:32:30

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

Re: Cannot create / delete files from directories copied from cdrom

thanks,

that fixed it.

Offline

#9 2009-12-25 12:53:29

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Cannot create / delete files from directories copied from cdrom


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#10 2009-12-25 18:18:01

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Cannot create / delete files from directories copied from cdrom

R00KIE wrote:

That's to be expected, read only medium yields read only files, even after copying to a rw medium.
I would suggest chmod -R u+w instead of chmod -R o+w, the owner (you) is the one that needs write permission not everyone else wink .

This is linux flaw, but you can run real backup to preserve ACL

Last edited by broch (2009-12-25 18:20:13)

Offline

Board footer

Powered by FluxBB