Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to remove files created by 'mknod'? (kernel version 2...

 
   Linux (Home) -> Genreal Discussions RSS
Next:  robust OpenLDAP installation using replication in..  
Author Message
knighttof3

External


Since: May 05, 2005
Posts: 18



(Msg. 1) Posted: Thu Jun 23, 2005 11:14 am
Post subject: How to remove files created by 'mknod'? (kernel version 2.4.21)
Archived from groups: comp>os>linux>misc (more info?)

Hi all,
I cannot delete files created by 'mknod'. I used a subdir in my home
directory (NFS mounted) as a staging area for Linux filesystem contents
that were used as inputs to mkfs.* utilities.
Now I am done and want to get rid of all the files, for example, in
...../dev.

MYHOST ~/staging-area % ls -l dev
total 4
crw------- 1 root root 5, 1 Jun 2 21:18 console
crw-rw---- 1 root root 5, 64 Jun 2 21:18 cua0
crw-rw---- 1 root root 5, 65 Jun 2 21:18 cua1
brw-rw---- 1 root root 3, 0 Jun 2 21:18 hda
brw-rw---- 1 root root 3, 1 Jun 2 21:18 hda1
......
crw------- 1 root root 4, 66 Jun 2 21:18 ttyS2
crw------- 1 root root 4, 67 Jun 2 21:18 ttyS3
crw-r--r-- 1 root root 1, 9 Jun 2 21:18 urandom
crw-rw-rw- 1 root root 1, 5 Jun 2 21:18 zero

MYHOST ~/staging-area % sudo rm -ri dev
rm: descend into directory `dev'? y
rm: remove character special file `dev/mem'? y
rm: cannot remove `dev/mem': No such file or directory
rm: remove character special file `dev/kmem'? y
rm: cannot remove `dev/kmem': No such file or directory
rm: remove character special file `dev/null'? y
rm: cannot remove `dev/null': No such file or directory
rm: remove character special file `dev/zero'? y
rm: cannot remove `dev/zero': No such file or directory

MYHOST ~/staging-area % sudo unlink dev/zero
unlink: cannot unlink `dev/zero': No such file or directory

MYHOST ~/staging-area % sudo debugfs .
debugfs 1.32 (09-Nov-2002)
..: Attempt to read block from filesystem resulted in short read while
opening filesystem
debugfs: open dev
dev: Attempt to read block from filesystem resulted in short read while
opening filesystem
debugfs: open .
..: Attempt to read block from filesystem resulted in short read while
opening filesystem
debugfs: rm dev/zero
rm: Filesystem not open

So, how do you remove files created by 'mknod'?
Back to top
Login to vote
Dances With Crows

External


Since: Feb 09, 2005
Posts: 320



(Msg. 2) Posted: Thu Jun 23, 2005 1:48 pm
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 23 Jun 2005 11:14:47 -0700, knighttof3 RemoveThis @yahoo.com staggered into the
Black Sun and said:
> I cannot delete files created by 'mknod'. I used a subdir in my home
> directory (NFS mounted) as a staging area for Linux filesystem
> contents that were used as inputs to mkfs.* utilities.

NFS and device nodes are... interesting. You can create one, sure, but
trying to open() or read() or write() to it may not have the effect you
desire. The general rule is probably something like "don't bother to
have device nodes on NFS" except for weird cases like root-on-NFS.

> MYHOST ~/staging-area % ls -l dev
> crw------- 1 root root 5, 1 Jun 2 21:18 console
> crw-rw---- 1 root root 5, 64 Jun 2 21:18 cua0
[snip]
> MYHOST ~/staging-area % sudo rm -ri dev
> rm: remove character special file `dev/mem'? y
> rm: cannot remove `dev/mem': No such file or directory

....ah. How annoying. ssh in to the machine where the files live and
kill them there; that has a much higher probability of success.

> MYHOST ~/staging-area % sudo debugfs .
> debugfs 1.32 (09-Nov-2002)
> .: Attempt to read block from filesystem resulted in short read while
> opening filesystem
> debugfs: open dev
> dev: Attempt to read block from filesystem resulted in short read while
> opening filesystem

....? debugfs doesn't do NFS. If "dev" is loopback mounted (mount -o
loop /path/to/some/file /mnt/somewhere), no need to fiddle around with
all this, just umount the filesystem and rm /path/to/some/file if you're
done with it. Also, if dev is loopback mounted, debugfs will work
better if you umount the filesystem and run debugfs on the file.

> So, how do you remove files created by 'mknod'?

With rm. Works fine IME. I think NFS and possibly a loopback mount are
throwing monkey wrenches into the whole thing here, though. HTH anyway,

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / Hire me!
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume
Back to top
Login to vote
John-Paul Stewart

External


Since: Mar 29, 2005
Posts: 469



(Msg. 3) Posted: Thu Jun 23, 2005 2:41 pm
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

knighttof3.RemoveThis@yahoo.com wrote:
> Hi all,
> I cannot delete files created by 'mknod'. I used a subdir in my home
> directory (NFS mounted) as a staging area for Linux filesystem contents
> that were used as inputs to mkfs.* utilities.
[snip]
> MYHOST ~/staging-area % sudo debugfs .
> debugfs 1.32 (09-Nov-2002)
> .: Attempt to read block from filesystem resulted in short read while
> opening filesystem

That doesn't surprise me. Debugfs works on the block special device
(/dev/hdXY or somesuch) so trying to debug an NFS mounted filesystem
isn't going to work.

As Peter pointed out, the filesystem is trashed. Running debugfs on the
NFS server would be a better idea (assuming it is an ext2/3 filesystem).
But you need to find some way of fixing the filesystem on the NFS
server if you can't delete the files. Under normal circumstances 'rm'
is all you need...even in the case of an NFS mounted filesystem.
Back to top
Login to vote
Peter T. Breuer

External


Since: Jul 03, 2003
Posts: 209



(Msg. 4) Posted: Thu Jun 23, 2005 8:24 pm
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

knighttof3.DeleteThis@yahoo.com wrote:
> I cannot delete files created by 'mknod'.

Then your filesystem is fubarred.

Peter
Back to top
Login to vote
Michael Heiming

External


Since: Nov 28, 2004
Posts: 2505



(Msg. 5) Posted: Thu Jun 23, 2005 8:39 pm
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In comp.os.linux.misc Peter T. Breuer <ptb RemoveThis @oboe.it.uc3m.es>:
> knighttof3 RemoveThis @yahoo.com wrote:
>> I cannot delete files created by 'mknod'.

> Then your filesystem is fubarred.

Likely, or the partition is mounted with "nodev" now? (remote
guess)

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry RemoveThis @urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 381: Robotic tape changer mistook operator's tie
for a backup tape.
Back to top
Login to vote
John-Paul Stewart

External


Since: Mar 29, 2005
Posts: 469



(Msg. 6) Posted: Thu Jun 23, 2005 8:39 pm
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Michael Heiming wrote:
> In comp.os.linux.misc Peter T. Breuer <ptb.RemoveThis@oboe.it.uc3m.es>:
>
>>knighttof3@yahoo.com wrote:
>>
>>> I cannot delete files created by 'mknod'.
>
>
>>Then your filesystem is fubarred.
>
>
> Likely, or the partition is mounted with "nodev" now? (remote
> guess)

Mounting with "nodev" shouldn't be a problem for deleting the file.
That was my first thought, too, so I tired it and I have no trouble
removing device nodes from a filesystem mounted with nodev. (Opening
them is a different story, of course!)
Back to top
Login to vote
Peter T. Breuer

External


Since: Jul 03, 2003
Posts: 209



(Msg. 7) Posted: Thu Jun 23, 2005 9:35 pm
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Michael Heiming <michael+USENET@www.heiming.de> wrote:
> In comp.os.linux.misc Peter T. Breuer <ptb RemoveThis @oboe.it.uc3m.es>:
>> knighttof3 RemoveThis @yahoo.com wrote:
>>> I cannot delete files created by 'mknod'.
>
>> Then your filesystem is fubarred.
>
> Likely, or the partition is mounted with "nodev" now? (remote
> guess)

That is a guess that I would lay long odds against Smile. But nice
alternative, Michael!

Peter
Back to top
Login to vote
Michael Heiming

External


Since: Nov 28, 2004
Posts: 2505



(Msg. 8) Posted: Thu Jun 23, 2005 10:05 pm
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In comp.os.linux.misc Peter T. Breuer <ptb DeleteThis @oboe.it.uc3m.es>:
> Michael Heiming <michael+USENET@www.heiming.de> wrote:
>> In comp.os.linux.misc Peter T. Breuer <ptb DeleteThis @oboe.it.uc3m.es>:
>>> knighttof3 DeleteThis @yahoo.com wrote:
>>>> I cannot delete files created by 'mknod'.
>>
>>> Then your filesystem is fubarred.
>>
>> Likely, or the partition is mounted with "nodev" now? (remote
>> guess)

> That is a guess that I would lay long odds against Smile. But nice
> alternative, Michael!

Ah, rereading the OP, it's NFS? Strange, wouldn't even think
about putting dev on NFS? Problems are likely. The OP should
umount the fs and remove files from the server.

--
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry DeleteThis @urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 56: Electricians made popcorn in the power supply
Back to top
Login to vote
Villy Kruse

External


Since: Apr 20, 2005
Posts: 5



(Msg. 9) Posted: Fri Jun 24, 2005 8:02 am
Post subject: Re: How to remove files created by 'mknod'? (kernel version 2.4.21) [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 23 Jun 2005 13:48:32 -0500,
Dances With Crows <danSPANceswitTRAPhcrows RemoveThis @gmail.com> wrote:


> On 23 Jun 2005 11:14:47 -0700, knighttof3 RemoveThis @yahoo.com staggered into the
> Black Sun and said:
>> I cannot delete files created by 'mknod'. I used a subdir in my home
>> directory (NFS mounted) as a staging area for Linux filesystem
>> contents that were used as inputs to mkfs.* utilities.
>
> NFS and device nodes are... interesting. You can create one, sure, but
> trying to open() or read() or write() to it may not have the effect you
> desire. The general rule is probably something like "don't bother to
> have device nodes on NFS" except for weird cases like root-on-NFS.
>

It is supposed to work. After all, back when disk units were expensive
you could have Sun boxes without disk units using a NFS mounted root file
system, including /dev. That would require that the usual root to nobody
privilege translation should be disabled so you could operate with root
privileges on the NFS mounted root file system.

Villy
Back to top
Login to vote
Display posts from previous:   
Related Topics:
remove drm from wmv files - Hi all, mplayer sometimes doesn't play wmv files, and I suspect its because they have drm. The screen becomes green and garbled. Does anyone know of a way to remove drm from wmv files? It would have to work on linux. iksrazal

Command line to remove duplicate files? - I have a Fedora 6 system and want to remove some duplicate files. I have about 1,500 jpg images on my XP machine on the LAN and setup the directory containing the photos as a share, then mounted it in Linux with cifs, so now I can use Linux tools on..

confused about kernel version vs. Linux distribution - Hi, Now I am really confused about the relationship between kernel version and Linux version. I've been using RedHat 8 and 9 on my office machines for the last year or so, but in the meantime had to recompile the 2.4 kernel to get it to the latest..

[MULTIPOST] Reuse old kernel config files - Hello. I'm using Linux since 2000, but there are still some little problems I'm not able to solve by myself. For instance: I once downloaded the Linux kernel version 2.6.7, worked for almost two hours configuring it, and finally got my .config, which I...

location of the directory of C header files that match ker.. - I am trying to install VMware Workstation 5. But the end of the installation I get this error: Trying to find a suitable vmmon module for your running kernel. None of the pre-built vmmon modules for VMware Workstation is suitable for your running..
       Linux (Home) -> Genreal Discussions All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
  Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact