glabel and real disk IDs

Ivan Voras ivoras at freebsd.org
Thu Jul 9 11:53:09 UTC 2009


Hi,

I've been working with glabels for a time and just remembered that ATA 
(ad) drives do in fact export the drive ID, for example:

# diskinfo -v ad4
ad4
         512             # sectorsize
         320072933376    # mediasize in bytes (298G)
         625142448       # mediasize in sectors
         620181          # Cylinders according to firmware.
         16              # Heads according to firmware.
         63              # Sectors according to firmware.
         ad:9QF4H15Y     # Disk ident.

# diskinfo -v ad6
ad6
         512             # sectorsize
         320072933376    # mediasize in bytes (298G)
         625142448       # mediasize in sectors
         620181          # Cylinders according to firmware.
         16              # Heads according to firmware.
         63              # Sectors according to firmware.
         ad:9QF4EP7A     # Disk ident.

# diskinfo -v ad8
ad8
         512             # sectorsize
         320072933376    # mediasize in bytes (298G)
         625142448       # mediasize in sectors
         620181          # Cylinders according to firmware.
         16              # Heads according to firmware.
         63              # Sectors according to firmware.
         ad:9QF4H16L     # Disk ident.

I don't think it would be hard to add a label parser to gather this 
information and export it as a label.

The purpose of this would be to have a unique disk ID without explicitly 
setting a label (e.g. as is commonly advised for ZFS and drive swapping).

Any objections?



More information about the freebsd-geom mailing list