Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Let The Music Play: Join EFF Today

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 72 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here



       scsidev - populate /dev/scsi with device  names  that  are
       persistent against SCSI configuration changes.


       scsidev [ -f ] [ -n ] [ -d ] [ -l ] [ -L ] [ -m ] [ -c ] [
       -r ] [ -M ] [ -e ] [ -o ] [ -s ] [ -v ] [ -q ] [ -h ]


       scsidev is a utility that is used to  guarantee  that  the
       same  device node can be used for the same scsi device, no
       matter what other scsi devices are added or  removed  from
       the  scsi  chain.   The  need  for this tool arose because
       device numbers are assigned dynamicly at boot time, and if
       a  new  disk  were  added  to  the system (or if some disk
       didn't spin up), then fixed device nodes would  cause  the
       wrong  filesystems  to be mounted, checked, etc.  This can
       also result in security holes, as some  device  nodes  may
       have  permissions  that  allow general users access to the
       raw device, and if the  mappings  were  to  change,  users
       would be able to access different devices.

       scsidev  is  designed to be used once each time the system
       boots.  It will scan all of the detected  devices  on  the
       system, and determine a immutable name that will represent
       the device.  It first checks to see if a node by this name
       already  exists  -  if this is the case, then it checks to
       see if the major/minor numbers are correct.  If  a  change
       in the minor number is required, then a new device is cre­
       ated with the correct major/minor numbers,  and  in  addi­
       tion, any ownership and permissions for the old device are
       applied to the new device.

       Once this process is complete, then scsidev will scan  all
       of  the entries in the /dev/scsi directory, and see if any
       of them are for devices nodes which were added for devices
       that  are not active.  The permissions of inactive devices
       are stored in a .shadow.  file  and  the  device  node  is
       removed  as  a security precaution, since these might have
       permissions that would allow people to access devices that
       they  should  not  be able to access.  This is the default
       behaviour and is considered ideal for most  cases,  as  it
       preserves  the  ownership and permissions of the files and
       is secure.

       The so called sanitizing can be influenced by the  options
       -f -d -n.

       When  you  rescan  the bus by using the rescan-scsi-bus.sh
       script or manually by using commands like
       echo "scsi add-single-device C B T U" >/proc/scsi/scsi
       (C = Controller (host) no., B = Bus (Channel), T =  Target
       (SCSI  ID),  U  =  Unit  (SCSI  LUN))  after the system is
       some host adapters can drive multiple scsi  busses).   The
       "i0l0"  indicates  that this device is scsi ID 0, with lun
       0.  Finally the "p1" indicated partition number 1.


       -f     Flush everything from /dev/scsi prior  to  scanning
              the  detected  devices.  This means that new device
              nodes will be created even if the old ones were OK.

       -d     Sanitize  by  deletion.  The  .shadow. backup files
              will not be created, so you loose  all  non-default
              ownership/permissions that may have been set.

       -n     Don't  touch  device  nodes  for  non-existing SCSI
              devices.  This might have security implications and
              is therefore not recommended.

       -l     Symbolic  link  mode.   Instead  of creating nodes,
              symbolic links are created which point to the older
              /dev/sda1  types  of  device nodes. When using this
              option, the  permissions  of  the  /dev/XXX  device
              nodes  will  be changed to match the ones stored in
              /dev/scsi/YYY file, if present.

       -L     Use symbolic names for the aliases assigned through
              the /etc/scsi.alias settings (see below).

       -m mode
              Specifies  the  mode  (permissions) for new entries
              that need to be created.

       -c maxmiss
              Normally, if scsidev fails to open a  generic  scsi
              device, it finishes its scan for devices. With this
              option, it goes on until  maxmiss  missing  devices
              were  found.   This is only used, if you don't have
              the /proc/scsi/scsi extensions for large disks.

       -r     scsidev does first probe the generic and then -- if
              appropriate -- the other highlevel devices (st, sd,
              sr). For removable devices  (sd,  sr,  osst),  this
              will fail, if no medium is inserted, so scsidev can
              not ensure, that the device actually corresponds to
              the  one  reported  by  the sg interface. After the
              first device  scan,  the  situation  is  clear  and
              scsidev  will  do the right guesses. So using -r in
              bootup scripts is safe. After you  removed  devices
              from  your  SCSI  config, it isn't safe any longer.
              This  is  only  needed,  if  you  don't  have   the
              /proc/scsi/scsi extensions for large disks.

       -M     Multipath  support.  scsidev normally does complain

       -s     Tells scsidev
               to  print  out  the  device  serial numbers of all
              detected devices on the system. This string can  be
              useful for forming aliases.  If supported, also the
              WWID is printed.

       -v     Verbosity.  Mainly  used  for  debugging  purposes.
              Use multiple times for more verbosity.

       -q     Be  Quiet.   Only  produce  output,  if  there  are

       -h     Output short usage summary and copyright  info  and


       It was intended that scsidev be useful without any config­
       uration at all.  There are times when it is much more con­
       venient to have symbolic names for various devices.  These
       symbolic names should track devices as they get moved from
       controller  to  another,  or even if the SCSI id number is

       The general idea is that there  is  a  configuration  file
       /etc/scsi.alias  which lists the aliases that scsidev will
       attempt to create.  Each line represents a separate alias,
       and  consists of a series of tokens.  Here are a couple of
       example entries:
       serial_number="DX908FK", devtype=disk, alias=fourgig
       manufacturer=WANGTEK, devtype=tape, alias=qictape
       id=2, devtype=generic, alias=cdwriter
       The minimum requirements are that each line have  a  alias
       and  a devtype field.  The alias will be used to build the
       pathnames, and the devtype must  be  one  of  disk,  tape,
       osst, cdrom or generic.

       The additional qualifiers are optional, and you must spec­
       ify a sufficient number of them such that the  alias  will
       match only one device.  The allowable qualifiers are:

              Specifies  the  name  of the manufacturer.  This is
              the same string that is printed at boot  time,  and
              is also available through /proc/scsi.

       model= Specifies  the model number of the device.  This is
              the same string that is printed at boot  time,  and
              is also available through /proc/scsi.

       rev=   Specifies  the  revision string of the device. This
              is the same string that is printed  at  boot  time,
              0x83 with EVPD=1. If supported, it's  displayed  by
              scsidev -s .

       id=    Specifies the scsi id number for the device.

       lun=   Specifies  the  lun  for  the device.  Most devices
              have a lun of 0, and it  is  only  special  devices
              such  as  cd  changers  that implement multiple lun

       chan=  Specifies which channel (i.e. which bus)  for  host
              adapters that drive multiple channels.

              Specifies the partition number for disk drives.  If
              unspecified, the alias will match all partitions on
              the disk.

              Specifies the host adapter id number.

              Specifies  the unique number that each host adpater
              driver returns.  Generally this number is always  0
              except  for  cases  where  the driver supports more
              than one device of a given type on the system.

              Specifies the host adapter driver name.  (Only  the
              given chars need to match, so you may omit the ver­
              sion number.)

       Note that the specifiers which take string  arguments  can
       be quoted if the string contains whitespace.

       For  disks,  aliases  for  all  partitions will be created
       (unless partition= is specified). The names get a -pN suf­
       fix  (N  indicating the number of the partition. For tapes
       (st and osst type), the non-rewinding variant  with  an  n
       prepended will be created automatically.


        ... was written by Eric Youngdale <eric@aib.com>
        ... was enhanced by Kurt Garloff <garloff@suse.de>


       Probably there are ...

       The BIOS and LILO do not have the knowledge about the SCSI
       devices at boot time, so you still have  to  ensure,  your
       kernel can be loaded when you insert a new disk.
       The old version is available from

Version 2.29                June 2003                  SCSIDEV(8)
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial welcomes your suggestions and ideas.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.09 Seconds