Linux

  1. Home
  2. Computing & Technology
  3. Linux
Linux / Unix Command: devlabel
Command Library

NAME

devlabel - Consistent/persistent storage device access through symlinking  

SYNOPSIS

devlabel [action] [options]  

DESCRIPTION

devlabel is a script which manages symlinks to storage devices on your system. This is accomplished by utilizing the inherent unique identifiers (UUID) that each device *should* have in order to maintain a correctly pointing symlink in the event that the device name changes (eg. /dev/sdc1 becomes /dev/sdd1). By adding entries using devlabel its users can instead reference all devices by their symlink and no longer care what the true name of their device is. Similary, consistent raw device access can also be guaranteed through use of devlabel as it treats entries in the format of /dev/raw/raw# as a special form of symlink so that each raw device can consistently be bound to the correct storage device.

devlabel works with both IDE and SCSI storage and has been integrated into the hotplug system to allow USB, IEEE1394 (firewire) and PCI detection and consistency.  

ACTIONS

reload
Affirms the mappings of symlinks to storage devices. If a device cannot be found by its UUID, the existing symlink will be deleted. If the device name has changed, it will update the symlink. Both start and restart are synonyms for this command.
add [-d device] [-s symlink]
Adds the entry symlink -> device and determines the UUID. Alternatively, you can add by UUID if the correct UUID of the device is known. For this type of add you specify the [-s symlink] and the [-u UUID] Note that you must use the option [--partnum partition#] to specify which partition of the device with that UUID should have a symlink pointed to it. If no partnum is specified, the symlink is pointed just to the name of the disk itself.
remove [-s symlink]
Removes the entry symlink
status
Returns the current status of all symlinks that are set to be configured. If the symlink is a raw device, it will return what major/minor combination it is bound to.
printid [-d device]
Returns the identifier that devlabel finds for the device in question.
 

OPTIONS

-d <device>
The name of the device to be used for the specified action.
-s <symlink>
The name of the symlink to be used.
-u <uuid>
The UUID of the device to be used. The -u option is currently only recognized during an add command.
--partnum <partition#>
The partition number parameter is only supported in conjunction with the -u <uuid> option while doing an add command. Since UUIDs are currently disk specific and not partition specific, devlabel must be told through this parameter which partition of the disk to have the symlink pointed at. If no value is given, the symlink will be pointed at just the disk (e.g. /dev/sdc instead of /dev/sdc5).
--automount
This option is only available during an add. If specified, it will cause this device to be automatically mounted every time devlabel is restarted if, within /etc/fstab , a corresponding entry is found for that symlink. If no entry is found, nothing will happen. Automount is stored as an option in the 4th field of the /etc/sysconfig/devlabel configuration file.
-q
Quiet.
 

Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux/Unix Command Library

>> Shell Command Library

Explore Linux

About.com Special Features

Linux

  1. Home
  2. Computing & Technology
  3. Linux

©2009 About.com, a part of The New York Times Company.

All rights reserved.