Re: SCSI device numbering (was: Re: Ideas for v2.1

Theodore Y. Ts'o (tytso@mit.edu)
Wed, 3 Jul 1996 23:00:24 -0400


Date: Wed, 03 Jul 96 15:09:19 PDT
From: Craig Milo Rogers <rogers@isi.edu>

I've also had SCSI peripherals that I've moved between systems
(including laptops, thanks, David!), especially SCSI hard drives. I
manually run a script to adjust the mount points to the hard drive
I've plugged in. I've considered putting an easily-read volume label
file in each of my partitions ("VOLUME.SYS"? ".volume"?) to automate
mount point selection.

Stephen and I have been planning to add an 128-bit universally unique ID
(UUID) in the ext2 superblock to help automate this process. It's also
useful for his "supermount" for detecting when a removeable disk has
really been changed.

How do you generally a globally unique UUID? Simple. Generate a 128
bit UUID as follows:

32 bits tv_sec of volume creation
32 bits tv_usec of volume creation
32 bits IP address of host which created the volume,
or a random number if not available
32 bits random number

The basic idea of globally unique ID's is stolen from the DCE RPC, and its
predecessor, the Apollo RPC. It's a nice way of picking a universally
unqiue ID in a decentralized manner; while there's a chance you might
have a collision, it's so small as to be virtually non-existent.

Obviously there would have to be a program to map the 128-bit
UUID to the correct mount point, but that's best done in a user-mode
program anyway.

- Ted