Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    70
    Rep Power
    14

    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. #2
  3. Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    Superior, CO, USA
    Posts
    2,419
    Rep Power
    1716
    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    70
    Rep Power
    14

    Removing Directory


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


    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.
  6. #4
  7. Not a clue what to put ...
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2006
    Location
    in front of this keyboard
    Posts
    834
    Rep Power
    336
    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?
    .
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    70
    Rep Power
    14

    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



    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.
  10. #6
  11. Not a clue what to put ...
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2006
    Location
    in front of this keyboard
    Posts
    834
    Rep Power
    336
    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).
    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?
    .
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    70
    Rep Power
    14

    NFS Mount Resolve


    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
  14. #8
  15. Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    Superior, CO, USA
    Posts
    2,419
    Rep Power
    1716
    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.
  16. #9
  17. Not a clue what to put ...
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2006
    Location
    in front of this keyboard
    Posts
    834
    Rep Power
    336
    As the man says, use the user not root to do it. And yes we can tell you are using root from the # prompt!
    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?
    .
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    26
    Rep Power
    0
    rm -rfd

    you need to say that it is a directory
  20. #11
  21. Not a clue what to put ...
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2006
    Location
    in front of this keyboard
    Posts
    834
    Rep Power
    336
    No, you don't need the 'd' - not in any version of *nix I know of, anyway.
    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?
    .
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    26
    Rep 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.
  24. #13
  25. Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    Superior, CO, USA
    Posts
    2,419
    Rep Power
    1716
    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.
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    26
    Rep 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)
  28. #15
  29. Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    May 2004
    Location
    Superior, CO, USA
    Posts
    2,419
    Rep Power
    1716
    No, you don't. An rm -rf of a directory removes the directory too. An rmdir is just a convenience, nothing else. You do not need to tell rm that you are removing a directory when you use the recursive option.

    Comments on this post

    • Ehlanna agrees : Someone is listening!!!
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo