Posts: 8
Joined: Thu Mar 14, 2013 3:08 pm

USB disk's UUID changing?!

Thu Mar 14, 2013 3:15 pm

I'm trying to add an entry to /etc/fstab so that a USB hard disk is mounted each boot.

The problem is that when I use

Code: Select all

sudo blkid
to get the UUID, and add it to

Code: Select all

in the standard way (i.e.

Code: Select all

), the next time I boot I get a message saying the UUID wasn't recognised and the disk can't be mounted.

When I use blkid to check, I find the UUID of the disk is completely different. I haven't done anything to the disk in-between times — not even unplugged it!

Am I missing something important? I thought UUIDs were supposed to be, well, unique identifiers.

User avatar
Forum Moderator
Forum Moderator
Posts: 4071
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: USB disk's UUID changing?!

Thu Mar 14, 2013 5:46 pm

Hi rspi, I've never used the "blkid" command to get a disk's UUID - my approach is outlined within my webpages at ... ticks.html . The only times I've known a UUID to change is when a (flash)disk is re-formatted and/or partioned (sometimes the UUID is that of the partition) or (under Windows XP) when the partition has been "repaired" by checkdisk (this "screwed-up" dual-booting of my netbook when I'd resized some partitions to make more room for, what was then, Ubuntu Netbook edition.
Hope that's of some help).
Usually running Raspbian Jessie on up to 12 of 13 Pi's (an A, B1, 2xB2, 2xB+, A+, P2B, 3xP0, P0W) and Stretch on my P3B. See:

Posts: 8
Joined: Thu Mar 14, 2013 3:08 pm

Re: USB disk's UUID changing?!

Fri Mar 15, 2013 2:06 pm

Hi Trevor, thanks for the link!

I just tried it again with a fresh install and both blkid and your method of viewing /dev/disk/by-uuid reported the same values.

When I edited fstab and rebooted, everything worked fine.

This time around, however, I rebooted after formatting the new USB disk. I think this helped because I suspect I was seeing an older cached value for the disk that related to the old partition on the disk.

The moral of the story: If adding a new disk to the system and reformatting it, reboot before attempting to find out the UUID to add to /etc/fstab.

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 24 guests