1834149 Members
3848 Online
110064 Solutions
New Discussion

removing device file

 
SOLVED
Go to solution
Rgomes
Valued Contributor

removing device file

Hi All,

I want to remove a device file /dev/rmt/0mn( and it's corresponding files also). Purpose is, my default tape device is /dev/rmt/1mn, but for make_tape_recovery I like to use /dev/rmt/0mn. How can I do that?

Thanks

richard
16 REPLIES 16
Leif Halvarsson_2
Honored Contributor

Re: removing device file

Hi,
Are you using two different tape devices ? In general, if you want to recreate the devicefiles you only need to delete all old files and reboot the computer. The new devicefiles is created automatic.
Bill Hassell
Honored Contributor

Re: removing device file

Use rmsf to (correctly) remove device files. However, since all you want is the 0m device file, you can simply create a single symlink:

ln /dev/rmt/1mn /dev/rmt/0mn

The 1m versus 0m has to do with the number of tape drives that this system has had in the past. The first drive seen on bootup will be 0m, then 1m, 2m, etc. The number is an instance or occurance. Since the kernel remembers the drives by instance number, you need to completely remove the device (not just the device files) using rmsf.

Once removed, you can manually recreate the device file with the desired instance number using insf -I -H options. -I selects the instance and -H points to the exact hardware path. If the instance is not removed with rmsf, then insf will report an error when using -I 0.


Bill Hassell, sysadmin
Rgomes
Valued Contributor

Re: removing device file

Hi Leif,

I tried that one, by removing /dev/rmt/0mn and /dev/rmt/1mn both, but after rebooting system found the next device file, i mean, /dev/rmt/1mn not /dev/rmt/0mn.

Hi Bill,

thanks, yes I am looking for rmsf command and I'll try with it.

Do I need to reboot the server after doing this?

Thanks both of you,

richard
Zafar A. Mohammed_1
Trusted Contributor

Re: removing device file

I don't think you require reboot.

Check this link also in which Bill also explain something in detail

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7b4b68c57f64d4118fee0090279cd0f9,00.html

Thanks
Zafar
Jdamian
Respected Contributor

Re: removing device file

I agree Zafar.

The number (N) of a tape drive assigned to special device files that match the pattern

/dev/rmt/Nm
/dev/rmt/Nmn
/dev/rmt/Nmb
/dev/rmt/Nmnb

is the instance number in the tape class provided by the system.

Thus 'ioinit' command is needed to reassing instance numbers.
Tim Sanko
Trusted Contributor

Re: removing device file

Richard,

This is a quick and dirty, correct solution that requires no reboot.

# find the tape
ioscan -fnC tape
# remove the tape
rmsf -H
# reclaim tape
ioscan -fnC tape
#rebuild devices/drivers
insf
# or if you are a gui man
# (in an Arnold Swartznegger
# voice) use sam.

If you do it from the command lin and do the appropriate links manually there is no reboot. I avoid Gui like it is poison.

cd /dev/rmt
ln -sf /dev/rmt/cxtxdxBEST0m 0m

Hope this helps

Tim
Rgomes
Valued Contributor

Re: removing device file

Hi all,

I tried with Tim's steps:

1)ioscan -C tape
2)rmsf -H < h/w path>
3)ioscan -C tape
4)insf -evC tape

but, still it creates /dev/rmt/1m( associates device files) not the one I required, that is, /dev/rmt/0m.

Do I need to re-build the kernel or have to reboot the system?

Thanks all,

richard
avsrini
Trusted Contributor

Re: removing device file

Hi richard,

First of all how many tape drives do you have?. If you 2 drives, and the drive you wanted as default is second in Instance, then you'll get the device number as 1m only.

can you post the output of

#ioscan -fnC tape
#lssf /dev/rmt/1mn

Srini.

Be on top.
Leif Halvarsson_2
Honored Contributor

Re: removing device file

Hi,
Perhaps the simplest solution. Rename the devicefiles (mv /dev/rmt/XXX /dev/rmt/YYY).
Rgomes
Valued Contributor

Re: removing device file

Hi Srinivasan,

I am using only 1 tape drive. Previously, there was a tape installed, but I removed that one, and now using another ultrium tape drive, now I want to recognise the tape( presently: /dev/rmt/1m)by the system as /dev/rmt/0m. This is only for standerdization.

The outputs:

/ #ioscan -fnC tape
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
tape 1 0/0/1/0.1.0 stape CLAIMED DEVICE HP Ultrium 1-SCSI
/dev/rmt/1m /dev/rmt/c0t1d0BEST
/dev/rmt/1mb /dev/rmt/c0t1d0BESTb
/dev/rmt/1mn /dev/rmt/c0t1d0BESTn
/dev/rmt/1mnb /dev/rmt/c0t1d0BESTnb
pos / #lssf /dev/rmt/*
stape card instance 0 SCSI target 1 SCSI LUN 0 at&t best density available at ad
dress 0/0/1/0.1.0 /dev/rmt/1m
stape card instance 0 SCSI target 1 SCSI LUN 0 berkeley best density available a
t address 0/0/1/0.1.0 /dev/rmt/1mb
stape card instance 0 SCSI target 1 SCSI LUN 0 at&t no rewind best density avail
able at address 0/0/1/0.1.0 /dev/rmt/1mn
stape card instance 0 SCSI target 1 SCSI LUN 0 berkeley no rewind best density a
vailable at address 0/0/1/0.1.0 /dev/rmt/1mnb
stape card instance 0 SCSI target 1 SCSI LUN 0 at&t best density available at ad
dress 0/0/1/0.1.0 /dev/rmt/c0t1d0BEST
stape card instance 0 SCSI target 1 SCSI LUN 0 berkeley best density available a
t address 0/0/1/0.1.0 /dev/rmt/c0t1d0BESTb
stape card instance 0 SCSI target 1 SCSI LUN 0 at&t no rewind best density avail
able at address 0/0/1/0.1.0 /dev/rmt/c0t1d0BESTn
stape card instance 0 SCSI target 1 SCSI LUN 0 berkeley no rewind best density a
vailable at address 0/0/1/0.1.0 /dev/rmt/c0t1d0BESTnb
stape property table configuration device /dev/rmt/stape_config

Thanks,

richard
Rgomes
Valued Contributor

Re: removing device file

Hi Leif,

Maybe, but I don't want to just rename it. I guess I have to run ioinit?

richard
V. Nyga
Honored Contributor

Re: removing device file

Hi Richard,

with your first answer to Leif I think you have not removed all files.
Do you have your old tape to recreate the 0m files and delete it correctly or do you know the old ?

The second best solution is as I think:
create the link from 1m to 0m as Bill mentioned.

Good luck
Volkmar
*** Say 'Thanks' with Kudos ***
Rgomes
Valued Contributor

Re: removing device file

Yes you are right.

First I used to remove the /dev/rmt/0m with only 'rm' but not with 'rmsf'.
I guess that makes things complex.

richard
T G Manikandan
Honored Contributor
Solution

Re: removing device file

Rgomes
Valued Contributor

Re: removing device file

Hi Manikandan,

Trying with your link's attachment.

Thanks

richard
Sunil Sharma_1
Honored Contributor

Re: removing device file

remove the old file using rmsf or rm

then run ioinit

run insf
it should work

S
*** Dream as if you'll live forever. Live as if you'll die today ***