file without a name

file without a name

Post by peter van » Fri, 13 Feb 2004 16:32:42


who knows how i can remove a file without a name. /root is running low on
diskspace and when i look i see a file comsuming half the space of my
filesystem but that file has no name.
Please advice.
thx in advance
 
 
 

file without a name

Post by Barry Marg » Fri, 13 Feb 2004 16:44:43

In article <c0fa6n$e99$ XXXX@XXXXX.COM >,



Every file has a name. Maybe the name is all spaces.

Try this to see the ASCII codes of the filenames:

cd /root
for file in *; do
echo "$file" | od -c
done

Once you've determined the name of the file, you should be able to
remove it by typing that name enclosed in single quotes. E.g. if the
name is two spaces, use:

rm " "

--
Barry Margolin, XXXX@XXXXX.COM
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

 
 
 

file without a name

Post by hoh » Fri, 13 Feb 2004 18:50:00

In article < XXXX@XXXXX.COM >,



This is not true. A file that is held open by a process but had all
its names removed (link count is zero) has no name. This should be
known by all Unix admins.

Situations with nameless files often happens when a process creates a
quickly growing logfile and an admin removes the logfile in an attempt
to free up disk space. The file will continue to exist, and grow,
nameless until the process closes the file or dies.

--
Gan Larsson http://www.yqcomputer.com/
 
 
 

file without a name

Post by Lew.Pitche » Fri, 13 Feb 2004 22:09:29


From my Linux Newbies cluesheet #3, I offer this...

Have you ever found yourself in this position: you notice that
/var/log/messages (or some other syslog-owned file) has grown too big, and
you
rm /var/log/messages
touch /var/log/messages
to reclaim the space, but the used space doesn't reappear? This is because,
although you've deleted the filename part, there's a process that's got the
data part open still (syslogd), and the OS won't release the space for the
data until the process closes it. In order to complete your space
reclamation, you have to
kill -SIGHUP `cat /var/run/syslogd.pid`
to get syslogd to close and reopen the file

You can use this to your advantage in programs: have you ever wondered how
you could _hide_ a temporary file? Well, you

{
FILE *fp;

fp = fopen("some.hidden.file","w");
unlink("some.hidden.file"); /* deletes the filename part */

/* some.hidden.file no longer has a filename and is truely hidden */
fprintf(fp,"This data won't be found\n"); /* access the data part */
/*etc*/
fclose(fp); /* finally release the data part */
}





--
Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')
 
 
 

file without a name

Post by dfreybu » Sat, 14 Feb 2004 00:14:33


"ls -lb" will help on this, as will "rm -i *".

But every file does not have a name. This sounds a bit like one of the
standard FAQ questions: I deleted my huge log file but no space freed
up, what's the deal?

If a file is deleted from a directory, the inode only wiped and the
associated blocks are only moved to the free space chain if no process
has the file open.

If this is the problem, start with "lsof" to find deleted files that
are still open, and "ps" to figure out what program has them open.
Then kill and restart the program or otherwise figure out how to get it
to close its files.
 
 
 

file without a name

Post by Barry Marg » Sat, 14 Feb 2004 02:53:40

In article < XXXX@XXXXX.COM >, XXXX@XXXXX.COM (Goran Larsson)




The OP mentioned a directory listing. Every file in a directory listing
*does* have a name.

Other situations may exist, but are irrelevant to this thread. Is it
necessary to confuse things by bringing them up?

--
Barry Margolin, XXXX@XXXXX.COM
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
 
 
 

file without a name

Post by hoh » Sat, 14 Feb 2004 07:22:41

In article < XXXX@XXXXX.COM >,



That was not what you wrote. You wrote "Every file has a name.", a
clear sentence with a very specific meaning.


You argue like those who teaches students to use "void main ( ..."
just because the return value confuse things.

--
Gan Larsson http://www.yqcomputer.com/
 
 
 

file without a name

Post by Bev A. Kup » Sat, 14 Feb 2004 08:07:23

On Thu, 12 Feb 2004 22:22:41 GMT,



..... in the context of the original question. Or does that have
to be spelled out each time?

--
Bev A. Kupf
"The lyfe so short, the craft so long to lerne" -- Chaucer
Tintin turns 75 < http://www.yqcomputer.com/ >
 
 
 

file without a name

Post by Christophe » Sun, 15 Feb 2004 05:44:13


Somewhere a process is holding open that file. Unfortunately, since you
deleted it, it is now difficult for you to find out what process that
is. The space will be released when the process closes the file or
is terminated. If you can, rebooting the box will solve the problem.

Chris Mattern
 
 
 

file without a name

Post by Christophe » Sun, 15 Feb 2004 05:45:39


Wrong. A file that is deleted while a process is holding it open
continues to exist but has no name. The only way to reclaim the
space is to terminate the process.

Chris Mattern
 
 
 

file without a name

Post by Barry Marg » Tue, 17 Feb 2004 09:02:19

In article < XXXX@XXXXX.COM >, XXXX@XXXXX.COM (Goran Larsson)




Every sentence's meaning is only understandable in a specific context.


I disagree. I didn't tell someone to do something wrong.

--
Barry Margolin, XXXX@XXXXX.COM
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
 
 
 

file without a name

Post by Barry Marg » Tue, 17 Feb 2004 09:03:28

In article < XXXX@XXXXX.COM >,





But he said "when I look I see a file consuming half the space". If he
can see it, it's obviously not a file that has been deleted!

--
Barry Margolin, XXXX@XXXXX.COM
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
 
 
 

file without a name

Post by apm3 » Tue, 02 Mar 2004 22:17:43


Another way to avoid the disk filling up by a process logging to it
for ages to to make the file cyclic. The cyclic logfile package
( http://www.yqcomputer.com/ ) can be used to do this, assuming
your process does not use syslog.

Regards,

Andrew Marlow