Operating System - HP-UX
1833875 Members
1877 Online
110063 Solutions
New Discussion

Removing file in /dev/rmt/

 
SOLVED
Go to solution
Nick D'Angelo
Super Advisor

Removing file in /dev/rmt/

Something went wonky with my backups and a file, a big backup
file was created in the /dev/rmt directory which is called 0m.

Careful, I have device files in that directory. How can I remove the
big file listed below?

**** THIS ONE -rw------- 1 root sys 54345728 Apr 6 07:57
0m ****
crw-rw-rw- 2 bin bin 205 0x020080 Jan 22 2000 0mb
crw-rw-rw- 2 bin bin 205 0x020040 Jan 22 2000 0mn
crw-rw-rw- 2 bin bin 205 0x0200c0 Apr 5 03:22 0mnb

My system is still up at this point in time, HPUX 10.20 on a D350.
Thanks,
Always learning
17 REPLIES 17
Bill McNAMARA_1
Honored Contributor

Re: Removing file in /dev/rmt/

hey,
just rm the file.
It is not a special file and was caused by doing a dd if and of to a file not to a special file. ie you did not have the special file 0m on your system when you did the dd to it. If it was a special file it would have pointed to the h/w through the driver.


rm the file
then insf -eCtape -I 0
to recreate the 0m special file

To remove special files, that are really special files use the rmsf command.

Later,
Bill
It works for me (tm)
Nick D'Angelo
Super Advisor

Re: Removing file in /dev/rmt/

Bill,

THanks, but I can not even do an ll on the filename, ie ll 0m.

I can only do an ll and I get all the files listed, including the big bad one.

Nickd
Always learning
Carsten Krege
Honored Contributor
Solution

Re: Removing file in /dev/rmt/

If you cannot easily remove it, you should try the following:

# cd /dev/rmt
# rm -i *

This will ask you for every single file in the directory whether you want it to be removed or not. Say "Y" if it is your big one.

You can also run

# ls -lb

on the file to check for any special characters in the filename, which I think is the cause why you cannot simply list or remove it.

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Bill McNAMARA_1
Honored Contributor

Re: Removing file in /dev/rmt/

Heres a link to a post showing h 2 delete files by inode number especially related to files that have lots of wierd chars in them

Can you move the file to /tmp ?
..Then delete it?

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x0c87dfe5920fd5118fef0090279cd0f9,00.html
It works for me (tm)
Tracey
Trusted Contributor

Re: Removing file in /dev/rmt/

You may have a space or special character in the name: ls -b show show any special characters. if it is just one/two special characters I usually delete them by ?0m or ??0m
Nick D'Angelo
Super Advisor

Re: Removing file in /dev/rmt/

Hmm, rm -i * did NOT list the file to be removed.

But the ls -lb did give me the (full) name of the file -> .\0100m.

But, I can not ll or attempt to reference the file.
Always learning
Steffi Jones_1
Esteemed Contributor

Re: Removing file in /dev/rmt/

Hello Nick,

pretty unusual problem :-)

Is the backup process done? Maybe something is still writing to that file and that's why you can't delete the file.

But as mentioned above... there is no harm in rm'ing that file and then later using insf to recreate the device files.

You can try the following commands:

1) ls -i *
2) num -exec rm {} \;

Good luck ,

Steffi Jones
Cheryl Griffin
Honored Contributor

Re: Removing file in /dev/rmt/

This is a really common side affect of attempting to write to the tape drive but using the wrong device name.

A large file is created and can be removed with rm. There is no other special procedure for removing these files.
"Downtime is a Crime."
Bill McNAMARA_1
Honored Contributor

Re: Removing file in /dev/rmt/

ll -i (to find the inode number)

substitute the inode number in place of the # below; (be very careful with the syntax, it must be exactly correct)

find . -xdev -inum # -exec ll {} \;
find . -xdev -inum # -exec rm -i {} \;

(ref: Alex Glennie in link above)


It works for me (tm)
Tracey
Trusted Contributor

Re: Removing file in /dev/rmt/

Looks like you have just one special character there, using ls ?0m doesn't show the file?
Nick D'Angelo
Super Advisor

Re: Removing file in /dev/rmt/

Alrighty then,

My actions were as follows:

cd /dev/rmt/
rm * (to get rid of all files)
I ran an ll and the file is still there.

Always learning
Nick D'Angelo
Super Advisor

Re: Removing file in /dev/rmt/

Bill comes though.

Thanks, file removed.

You gotta love this forum.

Many thanks to the participants, full marks to everyone.

Nickd
Always learning
Tracey
Trusted Contributor

Re: Removing file in /dev/rmt/

rm * will only get rid of files with "normal" characters in the begging. Usually it won't delete your .* files etc.
Bill McNAMARA_1
Honored Contributor

Re: Removing file in /dev/rmt/

try rm -Rf
That's a bit disasterous..
you probably have a process accessing the file.

Use the fuser command and check if the inode is in use
It works for me (tm)
Vincenzo Restuccia
Honored Contributor

Re: Removing file in /dev/rmt/

cd /dev/rmt/
rmsf -a *
Joseph A Benaiah_1
Regular Advisor

Re: Removing file in /dev/rmt/

Nick,

You could try this:

1. cd /dev/rmt
2 cp /dev/null 0m
3. rm 0m
4. insf -e -C tape

Cheers,

Joseph.
Nick D'Angelo
Super Advisor

Re: Removing file in /dev/rmt/

All, Thank you for your suggestions/ideas/comments.

This issue is now closed.

Thanks again.

Nickd
Always learning