install linux on an external drive

Matt Graham mhgraham at crow202.org
Mon Oct 24 14:21:32 MST 2016


On 2016-10-24 08:58, Carruth, Rusty wrote:
> NOTE! WARNING! BEWARE!!! DD will almost certainly copy the UUID from
> the source partition to the destination partition! I do NOT know what
> havoc will result when linux looks for that UUID and finds 2…. (I’d
> guess it takes the first one it finds

Yes, mount goes through all the block devices probably starting with 
the first SCSI disk.  If it's looking for a UUID and finds it on 
/dev/sda3, that's the one it'll use, even if the same UUID is on 
/dev/sdb1 .  I think.  IIRC, the label detection code in mount did that 
the last time I looked at it.

> (I know about the UUID copy because I do that here at work all the
> time. In my case, it’s a feature. In your case, it’s a bug)

If you know you want to have the same UUID on 2 filesystems, you can 
use "dumpe2fs -h /dev/sdNN | grep UUID" , then pass the big hex string 
to the -U option of mkfs when you're making the new filesystem.  Or the 
-U option of tune2fs if you've already done mkfs and copied stuff.

IMHO, using filesystem labels is preferable to using UUIDs in 
/etc/fstab .  Labels can be made short and meaningful to humans, while 
UUIDs really can't.  (OK, -U feedface-dead-beef-0000-123456789abc works, 
but is silly.)  Distros probably go the UUID route because it's 
generally easy to assume that UUIDs are unique, while filesystem labels 
may not be.

-- 
Crow202 Blog: http://crow202.org/wordpress
There is no Darkness in Eternity
But only Light too dim for us to see.


More information about the PLUG-discuss mailing list