1753301 Members
6915 Online
108792 Solutions
New Discussion юеВ

Diff between rmsf and rm

 
SOLVED
Go to solution
amithp
Frequent Advisor

Diff between rmsf and rm

Hi Gents,

Could you please elaborate the difference between removing a device file using rm and rmsf. Man page of rmsf talks about device definition geting deleted using rmsf -a. Please elaborate on the "device definition".

Thanks in advance.
11 REPLIES 11
Jeeshan
Honored Contributor

Re: Diff between rmsf and rm

rm is a file deletion command. it just remove the file name.

rmsf remove the device file with hardware address and kernel driver for it.
a warrior never quits
Johnson Punniyalingam
Honored Contributor

Re: Diff between rmsf and rm

rm command
=========== :- removes the entries for one or more files from a
directory. If an entry was the last link to the file, the file is
destroyed. Removal of a file requires write and search (execute)
permission in its directory, but no permissions on the file itself.
However, if the sticky bit is set on the directory containing the
file, only the owner of the file, the owner of the directory, or a
user having appropriate privileges can remove the file.

rmsf command
============ :-removes one or more special files from the /dev
directory and potentially removes information about the associated
device or devices with H/W type "DEVICE" (see ioscan(1M)) from the
system.

If no options are specified, rmsf removes only the special_files
specified on the command line. The -k option causes rmsf to remove
the definition of the device from the system without removing any
special files. The -a option causes rmsf to remove the device
definition, and all special files that map to it from the /dev
directory

Thx,Johnson
Problems are common to all, but attitude makes the difference
amithp
Frequent Advisor

Re: Diff between rmsf and rm

Thanks Guys.

I ran rmsf -a on the disk device files. but i cant see disk drivers getting removed. It is still showing in the ioscan output. The only thing i can see is both block and raw device files are removed. Could you please elaborate on "device definition" mentioned in the man pages of rmsf.
Dennis Handly
Acclaimed Contributor

Re: Diff between rmsf and rm

>I can't see disk drivers getting removed.

That would require a kernel regen.
amithp
Frequent Advisor

Re: Diff between rmsf and rm

Dennis
I dont want to remove the driver. I said so because i got a reply that rmsf removes kernel drivers.
Could smone elaborate on "device definition" mentioned in the man pages of rmsf.
TTr
Honored Contributor
Solution

Re: Diff between rmsf and rm

> I ran rmsf -a on the disk device files

The "-a" option checks and updates the /etc/ioconfig file. Most likely no updates were made to this file since you did not remove ALL disk devices and you still have dsk devices in your server.

> It is still showing in the ioscan output
If it is the "NO_HW" entries in the ioscan listing that bother you, I don't think you can get rid of them without a reboot. I don't know about 11.31 if you can clear them.
Shoghi Martinez G.
Honored Contributor

Re: Diff between rmsf and rm

"elaborate on device definition"

This refers to the internal OS data structures asociated with the device, this info is recolected by the OS after HW installation, OS installation or OS reboot and completed and maintained by the device driver, rmfs -a force the OS to forget this info, when the system is restarted or an IOSCAN is issued this info is recolected again and if the driver is still part of the kernel then this is complemented again too.

Not all device drivers support the unbind operation to complete the device remotion and the operation fail.

If you want to get a device ignored by the OS, remove the driver.
TTr
Honored Contributor

Re: Diff between rmsf and rm

> If you want to get a device ignored by the OS, remove the driver.

That would leave you with an "UNKNOWN" entry in the ioscan listing. If you want the device to be ignored by the OS, remove the driver and the device itself.
Shoghi Martinez G.
Honored Contributor

Re: Diff between rmsf and rm

"That would leave you with an "UNKNOWN" entry in the ioscan listing"

You are right, my point was as complement after removing the device.