{
    "mode": "man",
    "parameter": "scsidev",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/scsidev/8/json",
    "generated": "2026-06-02T23:35:15Z",
    "synopsis": "scsidev [ -f ] [ -n ] [ -d ] [ -l ] [ -L ] [ -m mode ] [ -c mxms ] [ -A aliasfile ] [ -r ]  [",
    "sections": {
        "NAME": {
            "content": "scsidev - populate /dev/scsi with device names that are persistent against SCSI configuration\nchanges.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "scsidev [ -f ] [ -n ] [ -d ] [ -l ] [ -L ] [ -m mode ] [ -c mxms ] [ -A aliasfile ] [ -r ]  [",
            "subsections": [
                {
                    "name": "-M -e -o -s -v -q -h",
                    "content": "",
                    "flag": "-h"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "scsidev  is a utility that is used to guarantee that the same device node can be used for the\nsame scsi device, no matter what other scsi devices are added or removed from the scsi chain.\nThe  need  for  this tool arose because device numbers are assigned dynamically at boot time,\nand if a new disk were added to the system (or if some disk didn't spin up), then  fixed  de‐\nvice  nodes would cause the wrong filesystems to be mounted, checked, etc.  This can also re‐\nsult in security holes, as some device nodes may have permissions that  allow  general  users\naccess  to  the raw device, and if the mappings were to change, users would be able to access\ndifferent devices.\n\nscsidev is designed to be used once each time the system boots.  It will scan all of the  de‐\ntected  devices on the system, and determine a immutable name that will represent the device.\nIt first checks to see if a node by this name already exists - if this is the case,  then  it\nchecks to see if the major/minor numbers are correct.  If a change in the minor number is re‐\nquired, then a new device is created with the correct major/minor numbers, and  in  addition,\nany ownership and permissions for the old device are applied to the new device.\n\nOnce this process is complete, then scsidev will scan all of the entries in the /dev/scsi di‐\nrectory, and see if any of them are for devices nodes which were added for devices  that  are\nnot active.  The permissions of inactive devices are stored in a .shadow. file and the device\nnode is removed as a security precaution, since these might have permissions that would allow\npeople  to access devices that they should not be able to access.  This is the default behav‐\niour and is considered ideal for most cases, as it preserves the ownership and permissions of\nthe files and is secure.\n\nThe so called sanitizing can be influenced by the options -f -d -n.\n\nWhen  you rescan the bus by using the rescan-scsi-bus.sh script or manually by using commands\nlike\necho \"scsi add-single-device C B T U\" >/proc/scsi/scsi\n(C = Controller (host) no., B = Bus (Channel), T = Target (SCSI ID), U = Unit (SCSI LUN)) af‐\nter  the  system  is booted, then you will have to rerun scsidev so that the device nodes for\nthe newly detected devices are properly updated.\n\nThe device nodes that scsidev creates look something like \"sdh4-334c0i0l0p1\".  In this  case,\nthe various components of the name represent physical attributes about the device or the host\nadapter to which it is connected.  To begin with, the \"h4\" indicates that it is connected  to\nan  Adaptec  1542.  The \"-334\" is a means of identifying which 1542 the device is attached to\n(since linux supports more than one 1542 in the system at the same time) and (in  this  case)\ncorresponds  to  the IO Port number (hex) of the controller (this is the host adapter id num‐\nber).  The \"c0\" represents the channel number (since some host adapters  can  drive  multiple\nscsi  busses).   The \"i0l0\" indicates that this device is scsi ID 0, with lun 0.  Finally the\n\"p1\" indicated partition number 1.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "-f     Flush everything from /dev/scsi prior to scanning the detected  devices.   This  means\nthat new device nodes will be created even if the old ones were OK.\n\n-d     Sanitize  by deletion. The .shadow. backup files will not be created, so you loose all\nnon-default ownership/permissions that may have been set.\n\n-n     Don't touch device nodes for non-existing SCSI devices.  This might have security  im‐\nplications and is therefore not recommended.\n\n-l     Symbolic link mode.  Instead of creating nodes, symbolic links are created which point\nto the older /dev/sda1 types of device nodes. When using this option, the  permissions\nof the /dev/XXX device nodes will be changed to match the ones stored in /dev/scsi/YYY\nfile, if present.\n\n-L     Use symbolic names for the aliases assigned through the /etc/scsi.alias settings  (see\nbelow).\n\n-m mode\nSpecifies the mode (permissions) for new entries that need to be created.\n\n-c maxmiss\nNormally, if scsidev fails to open a generic scsi device, it finishes its scan for de‐\nvices. With this option, it goes on until maxmiss missing devices were found.  This is\nonly used, if you don't have the /proc/scsi/scsi extensions for large disks.\n\n-A aliasfile\nUse an alternative file instead of the default /etc/scsi.alias (see below).\n\n-r     scsidev does first probe the generic and then -- if appropriate -- the other highlevel\ndevices (st, sd, sr). For removable devices (sd, sr, osst),  this  will  fail,  if  no\nmedium is inserted, so scsidev can not ensure, that the device actually corresponds to\nthe one reported by the sg interface. After the first device scan,  the  situation  is\nclear  and  scsidev  will do the right guesses. So using -r in bootup scripts is safe.\nAfter you removed devices from your SCSI config, it isn't safe any  longer.   This  is\nonly needed, if you don't have the /proc/scsi/scsi extensions for large disks.\n\n-M     Multipath  support.   scsidev  normally  does complain if a line in scsi.alias matches\nmore than one device and does not create an alias then. With multipatch support on, it\njust  creates  the  alias  for  the first device found matching the description in the\nscsi.alias description.\n\n-e     Instructs scsidev to use devfs like names, i.e. using the cbtu (controller, bus,  tar‐\nget  unit)  characters instead of hcil (host, channel, scsi Id, scsi Lun) to build the\ndevice name.\n\n-o     Instructs scsidev to use scd instead of sr for the old names of CD-ROM devices  (rele‐\nvant for symlink mode).\n\n-s     Tells scsidev\nto  print  out  the device serial numbers of all detected devices on the system. This\nstring can be useful for forming aliases.  If supported, also the WWID is printed.\n\n-v     Verbosity.  Mainly used for debugging purposes.  Use  multiple  times  for  more  ver‐\nbosity.\n\n-q     Be Quiet.  Only produce output, if there are errors.\n\n-h     Output short usage summary and copyright info and exit.\n",
            "subsections": []
        },
        "ALIASES": {
            "content": "It  was  intended  that  scsidev be useful without any configuration at all.  There are times\nwhen it is much more convenient to have symbolic names for various devices.   These  symbolic\nnames  should track devices as they get moved from controller to another, or even if the SCSI\nid number is changed.\n\nThe general idea is that there is  a  configuration  file  /etc/scsi.alias  which  lists  the\naliases that scsidev will attempt to create.  Each line represents a separate alias, and con‐\nsists of a series of tokens.  Here are a couple of example entries:\nserialnumber=\"DX908FK\", devtype=disk, alias=fourgig\nmanufacturer=WANGTEK, devtype=tape, alias=qictape\nid=2, devtype=generic, alias=cdwriter\nThe minimum requirements are that each line have a alias and a devtype field.  The alias will\nbe  used  to  build  the pathnames, and the devtype must be one of disk, tape, osst, cdrom or\ngeneric.\n\nThe additional qualifiers are optional, and you must specify a sufficient number of them such\nthat the alias will match only one device.  The allowable qualifiers are:\n\nmanufacturer=\nSpecifies  the  name  of the manufacturer.  This is the same string that is printed at\nboot time, and is also available through /proc/scsi.\n\nmodel= Specifies the model number of the device.  This is the same string that is printed  at\nboot time, and is also available through /proc/scsi.\n\nrev=   Specifies  the  revision string of the device. This is the same string that is printed\nat boot time, and is also available through /proc/scsi.\n\nserialnumber=\nSpecifies the serial number of the device.  Not all devices implement  this,  but  for\nthose that do it provides a convenient mechanism to uniquely identify a device no mat‐\nter where it is found on the scsi chain. The serial number is the one reported in  IN‐\nQUIRY page 0x80 with EVPD=1. It is displayed by scsidev -s .\n\nwwid=  Specifies the WWID number of a device. This is a 64bit world wide unique number, which\nis supported by SCSI-3 devices and reported via INQUIRY page 0x83 with EVPD=1. If sup‐\nported, it's displayed by scsidev -s .\n\nid=    Specifies the scsi id number for the device.\n\nlun=   Specifies  the  lun for the device.  Most devices have a lun of 0, and it is only spe‐\ncial devices such as cd changers that implement multiple lun devices.\n\nchan=  Specifies which channel (i.e. which bus) for host adapters that drive  multiple  chan‐\nnels.\n\npartition=\nSpecifies  the partition number for disk drives.  If unspecified, the alias will match\nall partitions on the disk.\n\nhostid=\nSpecifies the host adapter id number (0x334 part of sdh4-334c0i0l0p1 for example).\n\nhostnum=\nSpecifies the unique number that each host adpater  driver  returns.   Generally  this\nnumber  is always 0 except for cases where the driver supports more than one device of\na given type on the system.\n\nhostname=\nSpecifies the host adapter driver name. (Only the given chars need to  match,  so  you\nmay omit the version number.)\n\nNote  that  the  specifiers  which take string arguments can be quoted if the string contains\nwhitespace.\n\nFor disks, aliases for all partitions will be created (unless partition= is  specified).  The\nnames  get  a  -pN  suffix  (N indicating the number of the partition. For tapes (st and osst\ntype), the non-rewinding variant with an n prepended will be created automatically.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "",
            "subsections": [
                {
                    "name": "scsidev",
                    "content": "... was written by Eric Youngdale <eric@aib.com>\n... was enhanced by Kurt Garloff <garloff@suse.de>\n"
                }
            ]
        },
        "BUGS": {
            "content": "Probably there are ...\n\nThe BIOS and LILO do not have the knowledge about the SCSI devices at boot time, so you still\nhave to ensure, your kernel can be loaded when you insert a new disk.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "This  program is free software. You can use it under the terms of the GNU GPL (General Public\nLicense) Version 2 (or any later version, at your option).  Note, that the GNU  GPL  implies,\nthat there is NO WARRANTY at all.  Full text of the GPL can be found in /usr/share/common-li‐\ncenses/GPL file.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "scsidev is available from",
            "subsections": [
                {
                    "name": "http://www.suse.de/~garloff/linux/scsidev/",
                    "content": "and"
                },
                {
                    "name": "http://www.garloff.de/kurt/linux/scsidev/",
                    "content": "and will also be put on standard anonymous ftp servers.\nThe old version is available from"
                },
                {
                    "name": "ftp://tsx-11.mit.edu/pub/linux/BETA/scsi/",
                    "content": "Version 2.29                                  June 2003                                   SCSIDEV(8)"
                }
            ]
        }
    },
    "summary": "scsidev - populate /dev/scsi with device names that are persistent against SCSI configuration changes.",
    "flags": [],
    "examples": [],
    "see_also": []
}