# Help! Deleting directory under root?



## cns5p (Feb 26, 2009)

Forgive me as I am inexperienced with using freebsd. I accidentally created a director called "restore" in the root directory and now I want to delete the directory. I try to cd to the directory but it says "not found/" Any ideas?


----------



## graudeejs (Feb 26, 2009)

*rm -R relative/path/to/directory*
or
*rm -R /absolute/path/to/dir*

as root or dir owner


----------



## cns5p (Feb 26, 2009)

Thanks for the quick response? Why can I not cd to the directory to see whats in there before deleting it?


----------



## graudeejs (Feb 26, 2009)

you probably are not owner/group member.... [don't have permissions] of the dir
otherwise 
*cd path/to/dir
ls*

read entire chapter
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/basics.html


----------



## cns5p (Feb 26, 2009)

Hm.. I am logged in as root. I will have to read more into it.


----------



## ale (Feb 26, 2009)

Can we see the command you are typing?


----------



## fronclynne (Feb 27, 2009)

chown u+x /root/restore
perhaps?

_oops, chmod, sorry_


----------



## vivek (Feb 27, 2009)

What is the output of 

```
cd /root
ls -l
```


----------



## cy@ (Feb 27, 2009)

If you're logged in as root and still cannot delete the directory, assuming the filesystem is mounted rw and securelevel is set to -1, you might have some filesystem corruption that is prohibiting you from deleting the directory. I haven't seen this on a FreeBSD system before however I've had to deal with this many times on Solaris systems. In those cases the system ran nicely however at reboot the filesystem in question was so badly corrupted it required a newfs and restore from backup.


----------

