Difference between revisions of "Talk:Persistent block device naming"

From ArchWiki
Jump to: navigation, search
(rm very old comments)
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Enabling persistent naming in /etc/fstab is easy, just replace the device name in the first column by the new persistent name. In my example I would replace /dev/sda7 by one of the following:
+
== by-path and by-id unsuitable? ==
  
/dev/disk/by-label/home or
+
the article says by-path is unsuitable because it "contain[s] strings to indicate which subsystem they belong to (i.e. "-ide-", for 'by-path', and "ata-" for 'by-id')"
/dev/disk/by-uuid/31f8eb0d-612b-4805-835e-0e6d8b8c5591
+
Do so for all the partitions in your fstab file.
+
  
 +
How does that make it unsuitable? For by-path, that string is the same each boot, because the bus doesn't move (even if the buses get initialized in a different order) -- e.g. suppose you've got two SATA disks, on SATA connector #1 and #2 on your motherboard. #1 may become /dev/sda on one boot, and /dev/sdb the next time. Its by-path name won't change, though -- /dev/disk/by-path/sata-1 will point to /dev/sda in the first case and /dev/sdb in the second case, so it's persistent.
  
... is this really truely ?
+
Furthermore, by-path is actually safer than by-label and by-uuid, because those rely on the disk data to identify the disk. Suppose you and a friend both named your boot drive "root". Your friend's power supply blows, so you plug his drive into your eSATA port to retrieve some data for him -- but oops, your system found his "root" label before yours, and suddenly you're trying to boot to the wrong disk. (I've actually tested this, and it can/does happen. It's most likely to happen when something is wrong, e.g. one of your drives is dying -- which is also when you least *want* it to happen.)
  
I have to use :
+
[[User:Thetrivialstuff|Thetrivialstuff]] 01:04, 13 August 2011 (EDT)
  
UUID=31f8eb0d-612b-4805-835e-0e6d8b8c5591 /home
+
: I am also confused by that statement in the article with respect to "by-id". E.g. elsewhere I see:
 +
: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/persistent_naming.html
 +
:: The World Wide Identifier (WWID) can be used in reliably identifying devices. It is a persistent, system-independent ID that the SCSI Standard requires from all SCSI devices. '''The WWID identifier is guaranteed to be unique for every storage device, and independent of the path that is used to access the device.'''
 +
:: This identifier can be obtained by issuing a SCSI Inquiry to retrieve the Device Identification Vital Product Data (page 0x83) or Unit Serial Number (page 0x80). The mappings from these WWIDs to the current /dev/sd names can be seen in the symlinks maintained in the /dev/disk/by-id/ directory.
 +
:: For example, a device with a page 0x83 identifier would have:
  
or I understood somewhat wrongly.
+
:: scsi-3600508b400105e210000900000490000 -> ../../sda
  
 +
:: Or, a device with a page 0x80 identifier would have:
  
----
+
:: scsi-SSEAGATE_ST373453LW_3HW1RHM6 -> ../../sda
  
piwi
+
:: Red Hat Enterprise Linux 5 automatically maintains the proper mapping from the WWID-based device name to a current /dev/sd name on that system. '''Applications can use the /dev/disk/by-id/ name to reference the data on the disk, even if the path to the device changes, and even when accessing the device from different systems. '''
 
+
: Am I missing something?
:It works, yes. But I prefer LABEL over UUID:
+
: [[User:Goulo|Goulo]] 04:42, 11 January 2012 (EST)
:<tt>LABEL=HOME-jfs /home nodev,nosuid,noatime 0 2</tt>
+
:: I don't know if this could be relevant, at least in the context of using by-id with GRUB on BIOS computers: https://savannah.gnu.org/bugs/index.php?35354#comment3 --[[User:Kit|Kit]] ([[User talk:Kit|talk]]) 17:49, 25 October 2012 (UTC)
: --[[User:Byte|byte]] 08:19, 19 December 2006 (EST)
+
 
+
 
+
----
+
 
+
Found this howto easy & very usefull :)
+
Have got a few HDDs & USBKeys that love to be (disk-label) mounted so easy but still a sure way (by easy i mean, compared to udev rules ;).
+
:--[[User:Kozaki|kozaki]] 15:19, 7 January 2007 (PST)
+

Revision as of 19:46, 8 June 2013

by-path and by-id unsuitable?

the article says by-path is unsuitable because it "contain[s] strings to indicate which subsystem they belong to (i.e. "-ide-", for 'by-path', and "ata-" for 'by-id')"

How does that make it unsuitable? For by-path, that string is the same each boot, because the bus doesn't move (even if the buses get initialized in a different order) -- e.g. suppose you've got two SATA disks, on SATA connector #1 and #2 on your motherboard. #1 may become /dev/sda on one boot, and /dev/sdb the next time. Its by-path name won't change, though -- /dev/disk/by-path/sata-1 will point to /dev/sda in the first case and /dev/sdb in the second case, so it's persistent.

Furthermore, by-path is actually safer than by-label and by-uuid, because those rely on the disk data to identify the disk. Suppose you and a friend both named your boot drive "root". Your friend's power supply blows, so you plug his drive into your eSATA port to retrieve some data for him -- but oops, your system found his "root" label before yours, and suddenly you're trying to boot to the wrong disk. (I've actually tested this, and it can/does happen. It's most likely to happen when something is wrong, e.g. one of your drives is dying -- which is also when you least *want* it to happen.)

Thetrivialstuff 01:04, 13 August 2011 (EDT)

I am also confused by that statement in the article with respect to "by-id". E.g. elsewhere I see:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Online_Storage_Reconfiguration_Guide/persistent_naming.html
The World Wide Identifier (WWID) can be used in reliably identifying devices. It is a persistent, system-independent ID that the SCSI Standard requires from all SCSI devices. The WWID identifier is guaranteed to be unique for every storage device, and independent of the path that is used to access the device.
This identifier can be obtained by issuing a SCSI Inquiry to retrieve the Device Identification Vital Product Data (page 0x83) or Unit Serial Number (page 0x80). The mappings from these WWIDs to the current /dev/sd names can be seen in the symlinks maintained in the /dev/disk/by-id/ directory.
For example, a device with a page 0x83 identifier would have:
scsi-3600508b400105e210000900000490000 -> ../../sda
Or, a device with a page 0x80 identifier would have:
scsi-SSEAGATE_ST373453LW_3HW1RHM6 -> ../../sda
Red Hat Enterprise Linux 5 automatically maintains the proper mapping from the WWID-based device name to a current /dev/sd name on that system. Applications can use the /dev/disk/by-id/ name to reference the data on the disk, even if the path to the device changes, and even when accessing the device from different systems.
Am I missing something?
Goulo 04:42, 11 January 2012 (EST)
I don't know if this could be relevant, at least in the context of using by-id with GRUB on BIOS computers: https://savannah.gnu.org/bugs/index.php?35354#comment3 --Kit (talk) 17:49, 25 October 2012 (UTC)