[Arm-dev] UUID for partitions

Thu Dec 24 15:12:20 UTC 2015
Robert Moskowitz <rgm at htt-consult.com>


On 12/23/2015 08:20 AM, Robert Moskowitz wrote:
>
>
> On 12/23/2015 07:59 AM, Karanbir Singh wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 22/12/15 02:10, Mandar Joshi wrote:
>>>> So every installation from an image will have the same UUIDs.
>>> Yes
>> this is a bad idea, it means you cant ( or will haveto do some work )
>> if you ever intend to share media. onprem, lesser issue ( likely only
>> when disaster recovery is involved ), but this is a much bigger issue
>> in offprem, where block device mobility is part of the larger picture
>> and taken for granted.
>>
>> so, we should fix it.
>
> This simple answer is to add to the, yet to be provided, 
> centos-arm-installer a step that relabels the partitions.  I don't see 
> this as an option in parted, but I suspect there is SOME tool that 
> will change a partition's UUID.
>
> Thing is what to do with /etc/fstab.  Edit it with SED?  Use 
> /dev/device rather than UUID= ?  But the <device> varies by board.

I did a basic google search and found that something like:

uuidgen

along with

sudo tune2fs /dev/sd__ -U ______

Of course you have to provide the device and uuidgen output.

would do the trick.  Should be a way to piple uuidgen output into tune2fs.

Still how to programatically edit /etc/fstab.

And I should point out that this can be done on a live system (with 
careful editting of fstab!).

sudo blkid

will give you what you currently have so you can correctly do this.

And there might be better ways...