Folder like a Ghost...
#1
Question 
Hi, I got a folder acting like a ghost.... I can see it bu I can touch it.

Let me explain,

I tried to copy a directory with different folders with movies inside from my external HDD to my internal one via SSH because my kids was watching a movie at the moment.

I used the cp -rf and it started to copy all the folders from one location to another, but after, let say 5 sec., it gave me an error and I stop the copy process with CTRL+C. (I don't remember the error)

I tried to delete the folder but I couldn't do it ( rm , rm -r, rmdir -r.. )

I checked the directories of my movies library with ls -al and I saw the directory I tried to delete was created by the root user ("drwxr") and all the others was under the xbmc user ("drwxr-xr-x").

Since I log under SSH with the xbmc user and use the sudo command, how can I have created the folder under root? Huh

After I have created the password and logged as root. I still can't delete it. It gives me an error because the folder is not empty and I can't go inside because the folder doesn't exist but show's up under xbmc and with the ls command.

(rmdir -r ... give me an error because it doesn't understand the -r)

How can I remove it? Huh
ZOTAC ION-ITX A-U + LN46C630 = HAPPY 1080P XBMC USER
Reply
#2
Here's how to find out more about the dir and what it does. do
Code:
ls -la
ls -la /path_to_dir
stat /path_to_dir
also.. here's one for the bookmarks http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/


If you're sure you want to delete it, then you should
Code:
rm -Rf /path_to_dir/
The -R is recursive, and the -f is force. Be careful with this command, I once rm -rf'd my /etc/ dir.

You really should mention the name of the dir. I don't know how familiar you are with the Linux filesystem.
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#3
outleradam Wrote:Here's how to find out more about the dir and what it does. do
Code:
ls -la
ls -la /path_to_dir
stat /path_to_dir
also.. here's one for the bookmarks http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/

If you're sure you want to delete it, then you should
Code:
rm -Rf /path_to_dir/
The -R is recursive, and the -f is force. Be careful with this command, I once rm -rf'd my /etc/ dir.

You really should mention the name of the dir. I don't know how familiar you are with the Linux filesystem.

HI Thanks for you input. it's only one folder in the ~/home/xbmc/Movies/OneOfAKindMovie.

To Answer you query, here's the results:

ls -la /path_to_dir:
Code:
drwx------  2 root root 4096 2011-01-24 17:31 Alpha And Omega (2010)
By the way all the others are "drwxr-xr-x" and under the xbmc instead of root.

stat /path_to_dir:
Code:
xbmc@XBMCLive:~/Movies$ stat Alpha\ And\ Omega\ \(2010\)/
  File: `Alpha And Omega (2010)/'
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 803h/2051d      Inode: 35258369    Links: 2
Access: (0700/drwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2011-01-24 17:31:14.549734636 -0500
Modify: 2011-01-24 17:31:15.000317478 -0500
Change: 2011-01-24 17:31:15.000317478 -0500

I tried the rm -rf /path_to_dir/ under the xbmc user and root and it gives me the same error:
Code:
xbmc@XBMCLive:~/Movies$ sudo rm -r /Alpha\ And\ Omega\ \(2010\)/
[sudo] password for xbmc:
rm: cannot remove `/Alpha And Omega (2010)/': No such file or directory
xbmc@XBMCLive:~/Movies$ su -
Password:
root@XBMCLive:~# sudo rm -r /Alpha\ And\ Omega\ \(2010\)/
rm: cannot remove `/Alpha And Omega (2010)/': No such file or directory
root@XBMCLive:~# sudo rm -r ~/home/xbmc/Movies/Alpha\ And\ Omega\ \(2010\)/
rm: cannot remove `/root/home/xbmc/Movies/Alpha And Omega (2010)/': No such file or directory

Anymore hints?
ZOTAC ION-ITX A-U + LN46C630 = HAPPY 1080P XBMC USER
Reply
#4
Nobody else? Huh

I don't want to format my /home because of one folder Sad
ZOTAC ION-ITX A-U + LN46C630 = HAPPY 1080P XBMC USER
Reply
#5
jspot69 Wrote:Nobody else? Huh

I don't want to format my /home because of one folder Sad

Quote:rm -r /Alpha\ And\ Omega\ \(2010\)/
this should be
Quote:rm -r Alpha\ And\ Omega\ \(2010\)/
You might try the complete path as well but if you are in the parent directory, this should work.

I know this is wrong as well. You don't need the tilde when you are specifying the complte path.

Quote:sudo rm -r ~/home/xbmc/Movies/Alpha\ And\ Omega\ \(2010\)/
should be
Quote:sudo rm -r /home/xbmc/Movies/Alpha\ And\ Omega\ \(2010\)/
If you look at the error message, it told you that ~/home/xbmc/Movies/Alpha\ And\ Omega\ \(2010\)/ was interpeeted as
/root/home/xbmc/Movies/Alpha And Omega (2010)/

since you used sudo - without sudo it would have been read as
/home/XBMC/home/xbmc/Movies/Alpha And Omega (2010)/

~ is a shortcut for the users home. Since you are specifying the full path, it is not needed. Also note that sudo home is /root/ instead of /home/xbmc
Reply
#6
jspot69 Wrote:Since I log under SSH with the xbmc user and use the sudo command, how can I have created the folder under root? Huh

In case you're still wondering about this, issuing sudo before any command runs it as root user rather than your regular user. Issuing "mkdir test" creates a folder called test owned by your user while "sudo mkdir test" creates the folder owned by root.

Going on what JackieBrown said above, by issuing "sudo" then using tilde, it translates to the root user's home directory, not yours. Definitely use the full path and command JackieBrown gave, complete with sudo and the folder should disappear.
Reply
#7
IAmNotAUser Wrote:In case you're still wondering about this, issuing sudo before any command runs it as root user rather than your regular user. Issuing "mkdir test" creates a folder called test owned by your user while "sudo mkdir test" creates the folder owned by root.

Going on what JackieBrown said above, by issuing "sudo" then using tilde, it translates to the root user's home directory, not yours. Definitely use the full path and command JackieBrown gave, complete with sudo and the folder should disappear.

Yes true, but I never used the root before. Since I didn't created the password before it happed I wonder why when I used the sudo it created the folder under the root user. Does Putty did something or in some sort "think" sudo = root and nothing else?

-- To everybody else --

Is there anyway I can delete the folder?
ZOTAC ION-ITX A-U + LN46C630 = HAPPY 1080P XBMC USER
Reply
#8
did what I suggest not work?
Reply
#9
JackieBrown Wrote:this should be You might try the complete path as well but if you are in the parent directory, this should work.

I know this is wrong as well. You don't need the tilde when you are specifying the complte path.


should be

If you look at the error message, it told you that ~/home/xbmc/Movies/Alpha\ And\ Omega\ \(2010\)/ was interpeeted as
/root/home/xbmc/Movies/Alpha And Omega (2010)/

since you used sudo - without sudo it would have been read as
/home/XBMC/home/xbmc/Movies/Alpha And Omega (2010)/

~ is a shortcut for the users home. Since you are specifying the full path, it is not needed. Also note that sudo home is /root/ instead of /home/xbmc

Thanks for clarifing it to me. There's no age to stop learning new stuff Wink
ZOTAC ION-ITX A-U + LN46C630 = HAPPY 1080P XBMC USER
Reply
#10
I will try, but I need to RDC into my computer and SSH into the HTPC lol
ZOTAC ION-ITX A-U + LN46C630 = HAPPY 1080P XBMC USER
Reply
#11
Thumbs Up 
JackieBrown Wrote:did what I suggest not work?

My god... all of this because of a typo error Confused

Yes it worked! I used you second "correction"

Code:
sudo rm -r /home/xbmc/Movies/Alpha\ And\ Omega\ \(2010\)/

And now it's gone!

Thank you so much!! Wink

Edit: I found I can give you some Rep point ( in some sort )
ZOTAC ION-ITX A-U + LN46C630 = HAPPY 1080P XBMC USER
Reply
#12
For the future, try using quotes and tab complete.

ie...
rm ./Alpha<tab>.. it will complete the rest of the sentance for you
also rm ./"Alpha and omega" is a perfectly valid way to specify a file.
Use mythicalLibrarian to make a library out of your MythTV files. Leave the recording to MythTV and use XBMC as your library.
Installation and Instructions:http://wiki.xbmc.org/index.php?title=MythicalLibrarian
Technical Support:http://forum.xbmc.org/showthread.php?tid=65644
[url=http://forum.xda-developers.com/showthread.php?tid=1081892][/url]
Reply
#13
outleradam Wrote:For the future, try using quotes and tab complete.

ie...
rm ./Alpha<tab>.. it will complete the rest of the sentance for you
also rm ./"Alpha and omega" is a perfectly valid way to specify a file.

The -r flag was also needed since he was deleting directories. I agree on the tabbing. It is the easiest way to make sure your path is correct and its quicker too.
Reply

Logout Mark Read Team Forum Stats Members Help
Folder like a Ghost...0