Find out how different the Unix way of disk handling is from the Windows approach
UUIDs
The mechanism of accessing storage devices by the hardware device name has
worked well for a long time, but its inadequacies have been addressed recently
by the move to Universally Unique Identifiers (UUIDs).
A UUID is a long number, essentially a numerical fingerprint, that is
allocated to each filesystem. Rather than mount a partition based on its device
name, Linux can now mount it based on its UUID instead.
The Linux kernel scans all the filesystems across all available drives, and
keeps a record of the UUID of each one, internally linking it to the associated
device name. This means that no matter what device name a partition has, its
filesystem can always be located by the same identifier, even if the filesystem
has been cloned and moved to another hard drive altogether.
This method is especially useful for booting Linux systems. The Grub bootloader recognises these UUIDs, and can locate and boot any filesystem available, without the complication of having to know which partition, or even which disk, it is located on.
If you install a copy of Ubuntu onto an external drive, so long as that drive is plugged in when the computer is switched on (and the Bios can recognise it), the bootloader can start up the operating system without being configured to look for a specific drive. Rather than being configured to boot, say, the third partition on the second drive, it can be configured just to boot the relevant filesystem by its identifier.
The main drawback of using unique identifiers as opposed to device names is when the partition is reformatted. If you decide to wipe a partition, even if you use the same kind of filesystem as before, the unique identifier will change, although the device name will remain the same.
Again, this is rarely a problem, and also a rare occurrence itself in practice. Where filesystems are automatically mounted in the /etc/fstab file, you can update the UUIDs easily enough to the new codes. Running the command ‘vol_id’ determines a partition’s UUID:
$ sudo vol_id /dev/sda2
A command like this will return the UUID on the partition provided. The identifier follows the tag ‘ID_FS_UUID’ in the command output. This can then be used in the mount command, followed by ‘UUID=’, either with the mount command directly, or in the /etc/fstab file.
Some distributions of Linux will configure existing partitions from any other copies of Linux present on the drive at the time of installation, and so it may be necessary to adjust the identifiers if the other distributions are re-installed or removed.
Labels
Labels offer a simpler alternative to UUIDs, but work in almost exactly the same
way. Supported filesystems, such as NTFS and ext3, can be given an
easy-to-remember label. For NTFS filesystems, the label is what Windows uses to
refer to the drive alongside its drive letter, and can be changed from within
Windows itself, or by using the ‘ntfslabel’ command in Linux.
For ext3 filesystems, change the label with the ‘e2label’ command:
$ sudo e2label /dev/sda2 Ubuntu
Related articles
Q.Why are some of the keys on my keyboard doing strange...
Q.Is my phone’s Bluetooth any use?
Q.Can I switch boot drives so that I can work on older...
St Helena, a 'small British village' in the mid-Atlantic, is seeking support and funding for a broadband connection
|
|
|
|
|
Computeractive Excel (2010) Online tutorialPrice: £19.99 |
Computeractive Word (2010) Online TutorialPrice: £19.99 |
Computeractive Powerpoint (2010) Online TutorialPrice: £19.99 |
Angry BirdsPrice: £9.99 |
Back Issue CD-Rom 14 (2011)Price: £15.99 |