Operating System - HP-UX
1839012 Members
2972 Online
110132 Solutions
New Discussion

Re: Can not remove files in /dev/rmt directory

 
SOLVED
Go to solution
Erik Brillon
Advisor

Can not remove files in /dev/rmt directory

All,

I can not seem to remove two files from the /dev/rmt file system. The only thing I CAN do is chown on those files - but otherwise the rm command does not seem to work. They are taking up lots of space on the root volume, and I would like to remove them. The files in question are:

/dev/rmt/0n
/dev/rmt/0m

I will paste the informtion below. Thanks to all for your help!

Erik

HP-UX devapp B.11.11 U 9000/800 921196819
9000/800/rp7420

devapp:/dev/rmt $ ll
total 191840
crw-rw-rw- 1 bin bin 205 0x021080 Sep 22 11:05 0mb
crw-rw-rw- 1 bin bin 205 0x021040 Nov 7 19:27 0mn
crw-rw-rw- 1 bin bin 205 0x0210c0 Sep 22 11:05 0mnb
crw-rw-rw- 2 bin bin 205 0x0a4200 Oct 16 07:54 1m
crw-rw-rw- 2 bin bin 205 0x0a4280 Oct 16 07:54 1mb
crw-rw-rw- 2 bin bin 205 0x0a4240 Oct 16 07:54 1mn
crw-rw-rw- 2 bin bin 205 0x0a42c0 Oct 16 07:54 1mnb
crw-rw-rw- 2 bin bin 205 0x0a4200 Oct 16 07:54 c10t4d2BEST
crw-rw-rw- 2 bin bin 205 0x0a4280 Oct 16 07:54 c10t4d2BESTb
crw-rw-rw- 2 bin bin 205 0x0a4240 Oct 16 07:54 c10t4d2BESTn
crw-rw-rw- 2 bin bin 205 0x0a42c0 Oct 16 07:54 c10t4d2BESTnb
-rw------- 1 bin bin 71114752 Oct 30 12:06 0n
-rw------- 1 bin bin 27090944 Nov 2 12:39 0m
crw-r--r-- 1 bin bin 205 0xfffffe Sep 22 11:05 stape_config


18 REPLIES 18
Peter Godron
Honored Contributor

Re: Can not remove files in /dev/rmt directory

Erik,
to me they look like tape backups gone bad.
Furst of all check whether any backup processes are running/writing to the files.
Can you chmod 777 the files?
If backups are running against these files kill them. Then try the rm again. What message do you get?
You will then have to re-generate the tape device files with insf. See "man insf"
Jonathan Fife
Honored Contributor

Re: Can not remove files in /dev/rmt directory

I assume you are logged in as bin or root.

Does it give you an error when you try to remove them?
Decay is inherent in all compounded things. Strive on with diligence
Erik Brillon
Advisor

Re: Can not remove files in /dev/rmt directory

Peter,

to me they look like tape backups gone bad.
Furst of all check whether any backup processes are running/writing to the files.
< No processing running/writing against the files - did a reboot last night>

Can you chmod 777 the files?
< can not chmod to 777 - the error message is can't access >

If backups are running against these files kill them. Then try the rm again. What message do you get?

You will then have to re-generate the tape device files with insf. See "man insf

< and for the other writer - I am logged in as root while trying to remove those files>

Thanks,
Erik
James R. Ferguson
Acclaimed Contributor

Re: Can not remove files in /dev/rmt directory

Hi:

I'd guess that someone for some (wrong) reason choose to remove the original special files! The '0n' is not a standard tape device file, in fact.

Remove both '0n' and '0m' and use 'insf' to recreate the special files.

Regards!

...JRF...
Erik Brillon
Advisor

Re: Can not remove files in /dev/rmt directory

Hi,

That is my problem - I can not remove either 0n or 0m :-(
Peter Godron
Honored Contributor

Re: Can not remove files in /dev/rmt directory

Erik,
as you logged in as root, you should be able to chmod or rm the files, however:
su - bin
cd /dev/rmt
rm 0n
rm 0m

What is the result ? If they remove ok, re-generate with insf.
Erik Brillon
Advisor

Re: Can not remove files in /dev/rmt directory

Peter,

They still do not remove - the error message is the same as when trying to remove with root.


john korterman
Honored Contributor

Re: Can not remove files in /dev/rmt directory

Hi Erik,

please show the output of:
# ls -ld /dev/rmt

regards,
John K.
it would be nice if you always got a second chance
James R. Ferguson
Acclaimed Contributor

Re: Can not remove files in /dev/rmt directory

Hi (again) Erik:

It makes no sense that you should be able to 'chown' but not 'chmod' nor remove.

Try a remove of the files using their inode number. Perhaps you have a filename with unprintable characters in it:

# ls -il /dev/rmt/0*

# find /dev -xdev -inum -exec rm -i {} \;

...substitute the inode number found in the 'ls' output for .

Regards!

...JRF...
Frank de Vries
Respected Contributor

Re: Can not remove files in /dev/rmt directory

Maybe a stupid remark after all that
was suggested,
what are the directory permissions.

Did you try rm -f as well .
Look before you leap
Victor BERRIDGE
Honored Contributor

Re: Can not remove files in /dev/rmt directory

Erik
As root, go to /dev;
then rm -rf rmt;

Now if this works
Just do insf -e

Alternative:
in /dev
mv rmt rmt.bad
insf -e
Now go in rmt.bad and see if you can remove 0n...


All the best
Victor
P.S.
I would opt for the 1rst unless its because you want to understand whats going on...
Erik Brillon
Advisor

Re: Can not remove files in /dev/rmt directory

drwxr-xr-x 2 bin bin 8192 Nov 7 17:59 /dev/rmt

No matter what I try, I can not remove those files.

The systems keeps giving me a file not found error message (rm: 0n non-existent)

I am not really happy with this situation because it should no be this complex....I tried logging in as bin - and same result - can not remove file.

This is really frustrating
john korterman
Honored Contributor

Re: Can not remove files in /dev/rmt directory

Hi again,

please make a cd to /dev/rmt and show the exeact output of:
# ls -b

regards,
John K.
it would be nice if you always got a second chance
Jonathan Fife
Honored Contributor

Re: Can not remove files in /dev/rmt directory

Can you do an 'ls -ilq /dev/rmt' and post the output?

I suspect James is right and there are hidden characters in those filenames.
Decay is inherent in all compounded things. Strive on with diligence
Peter Nikitka
Honored Contributor
Solution

Re: Can not remove files in /dev/rmt directory

Hi,

like John I think you have filenames containing control characters in thier names.
To selectivly remove these unwanted files, try

cd /dev/rmt
rm -i *0*

and enter a 'y' only for those files you really want to remove!

Do you get error messages with this method as well?


mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Erik Brillon
Advisor

Re: Can not remove files in /dev/rmt directory

Peter/John,

The command to remove those files worked PERFECTLY.

I can not believe the pain this has been.

Thanks to ALL of your responses - I am glad not to be alone in the UNIX world!

Erik
James R. Ferguson
Acclaimed Contributor

Re: Can not remove files in /dev/rmt directory

Hi Erik:

Using shell metacharacters to remove files for which you cannot see non-printing characters is but one way.

You should also familarize yourself with the removal technique using the inode number I posted above. Read the manpages for 'ls' and 'find' too.

Regards!

...JRF...
Erik Brillon
Advisor

Re: Can not remove files in /dev/rmt directory

You guys have been awesome in the help.

Thanks very much for helping me get through this issue - because I did not want to grow the root file system due to these files (which made my root file system 99% full).

Thanks again to all!

Erik