UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 13th, 2006, 11:57 AM
ankur1216 ankur1216 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 58 ankur1216 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 11 sec
Reputation Power: 5
Solaris 9: Unable to remove dir

Hello,
I'm having the following error when removing the following directory:

# rm -rf dir1/

rm: Unable to remove directory dir1//WYN/tmp/env3ddf/Backup: Permission denied
rm: Unable to remove directory dir1//WYN/tmp/env3ddf: File exists
rm: Unable to remove directory dir1//WYN/tmp: File exists
rm: Unable to remove directory dir1//WYN: File exists
rm: Unable to remove directorydir1/: File exists

When I go all the way down into the directory tree where all the files are and try to remove it says permission denied. However, I'm the owner of these files. please help.

Thanks,

Ankur

Reply With Quote
  #2  
Old July 13th, 2006, 01:18 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,709 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 18 h 11 m
Reputation Power: 338
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
Are you sure that you also own the directories? If so, are they writable and executable?

Lastly, it looks like you're running this as root. Are the directories on an NFS mount? By default the user root becomes the user nobody over an NFS mount.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums.

Reply With Quote
  #3  
Old July 14th, 2006, 03:10 PM
ankur1216 ankur1216 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 58 ankur1216 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 11 sec
Reputation Power: 5
Removing Directory

Yes, I own the directories and they are writeable and executable. I'm logged in as my own username.


Quote:
Originally Posted by stdunbar
Are you sure that you also own the directories? If so, are they writable and executable?

Lastly, it looks like you're running this as root. Are the directories on an NFS mount? By default the user root becomes the user nobody over an NFS mount.

Reply With Quote
  #4  
Old July 14th, 2006, 05:47 PM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 814 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 10 m 43 sec
Reputation Power: 243
The root cause would seem to to be that bottom level directory: dir1//WYN/tmp/env3ddf/Backup
Could you do an ls -ld dir1//WYN/tmp/env3ddf/Backup and also a df dir1//WYN/tmp/env3ddf/Backup and show the results.
__________________
According to Sod's Law, buttered toast lands butter side down, when dropped.
Per nature, cats always land on their feet.
So, what happens when you strap buttered toast to the back of a cat and throw it out a window?
.

Reply With Quote
  #5  
Old July 17th, 2006, 01:51 PM
ankur1216 ankur1216 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 58 ankur1216 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 11 sec
Reputation Power: 5
Solaris 9: Unable to remove directory

I tried the following with results here:

#ls -ld Backup/
drwxrwxrwx 2 as145665 staff 512 Jun 28 11:49 Backup/
as145665@sr1-umpk-04 #cd ~
as145665@sr1-umpk-04 #ls -ld archive/WYN/tmp/env3ddf/Backup/
drwxrwxrwx 2 as145665 staff 512 Jun 28 11:49 archive/WYN/tmp/env3ddf/Backup/
#df archive/WYN/tmp/env3ddf/Backup/
/home/as145665 (server1:/export/geweldig/as145665):240832416 blocks 28614170 files



Quote:
Originally Posted by Ehlanna
The root cause would seem to to be that bottom level directory: dir1//WYN/tmp/env3ddf/Backup
Could you do an ls -ld dir1//WYN/tmp/env3ddf/Backup and also a df dir1//WYN/tmp/env3ddf/Backup and show the results.

Reply With Quote
  #6  
Old July 18th, 2006, 11:41 AM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 814 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 10 m 43 sec
Reputation Power: 243
Quote:
Originally Posted by ankur1216
I tried the following with results here:

#ls -ld Backup/
drwxrwxrwx 2 as145665 staff 512 Jun 28 11:49 Backup/
as145665@sr1-umpk-04 #cd ~
as145665@sr1-umpk-04 #ls -ld archive/WYN/tmp/env3ddf/Backup/
drwxrwxrwx 2 as145665 staff 512 Jun 28 11:49 archive/WYN/tmp/env3ddf/Backup/
#df archive/WYN/tmp/env3ddf/Backup/
/home/as145665 (server1:/export/geweldig/as145665):240832416 blocks 28614170 files


Looks to be an nfs mount, whiuch may explain the issues with lack of permission with deleting as root user (by default root gets no write access across nfs).

Reply With Quote
  #7  
Old July 19th, 2006, 12:53 PM
ankur1216 ankur1216 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 58 ankur1216 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 4 m 11 sec
Reputation Power: 5
NFS Mount Resolve

Quote:
Originally Posted by Ehlanna
Looks to be an nfs mount, whiuch may explain the issues with lack of permission with deleting as root user (by default root gets no write access across nfs).


So what would you suggest I do in order to resolve this?

Thanks,

Ankur

Reply With Quote
  #8  
Old July 19th, 2006, 01:08 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,709 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 18 h 11 m
Reputation Power: 338
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
Again - don't run this as root. As both Ehlanna and I said on an NFS mount you are the user "nobody" from the remote machines perspective. Since the user as145665 owns the files you must either change to that user (do an "su - as145665" as root) or you must have the administrator of the remote server change the NFS settings so that root on your machine has the same permissions as root on the server machine.

Reply With Quote
  #9  
Old July 19th, 2006, 02:22 PM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 814 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 10 m 43 sec
Reputation Power: 243
As the man says, use the user not root to do it. And yes we can tell you are using root from the # prompt!

Reply With Quote
  #10  
Old July 19th, 2006, 02:51 PM
DammitCoetzee DammitCoetzee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 26 DammitCoetzee User rank is Private First Class (20 - 50 Reputation Level)DammitCoetzee User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 12 h 37 m 36 sec
Reputation Power: 0
rm -rfd

you need to say that it is a directory

Reply With Quote
  #11  
Old July 19th, 2006, 03:39 PM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 814 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 10 m 43 sec
Reputation Power: 243
No, you don't need the 'd' - not in any version of *nix I know of, anyway.

Reply With Quote
  #12  
Old July 19th, 2006, 03:45 PM
DammitCoetzee DammitCoetzee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 26 DammitCoetzee User rank is Private First Class (20 - 50 Reputation Level)DammitCoetzee User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 12 h 37 m 36 sec
Reputation Power: 0
Usage: rm [OPTION]... FILE...
Remove (unlink) the FILE(s).

-d, --directory unlink FILE, even if it is a non-empty directory
(super-user only; this works only if your system
supports `unlink' for nonempty directories)
-f, --force ignore nonexistent files, never prompt
-i, --interactive prompt before any removal
--no-preserve-root do not treat `/' specially (the default)
--preserve-root fail to operate recursively on `/'
-r, -R, --recursive remove directories and their contents recursively
-v, --verbose explain what is being done
--help display this help and exit
--version output version information and exit

By default, rm does not remove directories. Use the --recursive (-r or -R)
option to remove each listed directory, too, along with all of its contents.

To remove a file whose name starts with a `-', for example `-foo',
use one of these commands:
rm -- -foo

rm ./-foo

Note that if you use rm to remove a file, it is usually possible to recover
the contents of that file. If you want more assurance that the contents are
truly unrecoverable, consider using shred.

Reply With Quote
  #13  
Old July 19th, 2006, 03:55 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,709 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 18 h 11 m
Reputation Power: 338
Send a message via ICQ to stdunbar Send a message via Yahoo to stdunbar
The original poster isn't on Linux - read the post again. The Solaris 9 rm man page is the reference in this case. The options you are showing are GNU only.

Reply With Quote
  #14  
Old July 19th, 2006, 04:00 PM
DammitCoetzee DammitCoetzee is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Posts: 26 DammitCoetzee User rank is Private First Class (20 - 50 Reputation Level)DammitCoetzee User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 12 h 37 m 36 sec
Reputation Power: 0
yea.. those documents say he needs to do the equivilant of what I said in solaris which is rmdir (with possibly a -p after it)

Reply With Quote
  #15  
Old July 19th, 2006, 04:06 PM
stdunbar stdunbar is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: May 2004
Location: Superior, CO, USA
Posts: 1,709 stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)stdunbar User rank is Major (30000 - 40000 Reputation Level)