How to make a UUID for a new hard drive

Craig Hagerman craighagerman at gmail.com
Mon Apr 23 00:46:58 UTC 2007


I just added a new hard drive to my box and I am wondering how to set up
/etc/fstab the 'new' way? i.e. using UUIDs. Here is an example fstab entry
for another disc in my system:

# /dev/sdb1 -- converted during upgrade to edgy
UUID=84db27cb-9fa9-4bf8-99f8-b905cee2a2e0 /media/Music ext3
defaults,user_xattr 0 0


I need a UUID for the new drive. The question is how to I get (or make?)
one? I googled this topic and found the following command which is supposed
to tell you what the UUID is:

vol_id -u /dev/sdb1

It DOES tell me what my existing discs are, but doesn't return anything
about the newly installed disc. Another web page said that Device Manager
(System > Preferences > Hardware Information) has the UUID information, but
I don't see anything like that.

A bit more searching lead me to the tune2fs command. This gives a lot of
information, but doesn't SET the UUID. This is an bit of what it gives in my
case

tune2fs -l /dev/sdb1
tune2fs 1.40-WIP (14-Nov-2006)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          <none>
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal needs_recovery
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
**

So this disc apparently has no UUID.

Yet another way to find out what a UUID is:

*ls -l /dev/disk/by-uuid

*I know UUID has benifits over the previous fstab system, but it is sure
frustrating to set up and use. How do I make a new UUID for a new hard
drive?

Craig Hagerman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20070423/2774e982/attachment.html>


More information about the ubuntu-users mailing list