|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
Removing Directory
Yes, I own the directories and they are writeable and executable. I'm logged in as my own username.
Quote:
|
|
#4
|
||||
|
||||
|
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?. |
|
#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:
|
|
#6
|
||||
|
||||
|
Quote:
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). |
|
#7
|
|||
|
|||
|
NFS Mount Resolve
Quote:
So what would you suggest I do in order to resolve this? Thanks, Ankur |
|
#8
|
|||
|
|||
|
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.
|
|
#9
|
||||
|
||||
|
As the man says, use the user not root to do it. And yes we can tell you are using root from the # prompt!
|
|
#10
|
|||
|
|||
|
rm -rfd
you need to say that it is a directory |
|
#11
|
||||
|
||||
|
No, you don't need the 'd' - not in any version of *nix I know of, anyway.
|
|
#12
|
|||
|
|||
|
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. |
|
#13
|
|||
|
|||
|
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.
|
|
#14
|
|||
|
|||
|
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)
|
|
#15
|
|||
|