[Arm-dev] Works - Re: UUID for partitions - now add resize

Robert Moskowitz rgm at htt-consult.com
Mon Dec 28 13:58:46 UTC 2015



On 12/25/2015 03:30 PM, 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.
>>
>> - - KB
> I just finished writing a script to change UUIDs and LABELs.
> It's changeuuid.py in https://github.com/mndar/rbf/tree/master/commonscripts
> It doesn't depend on anything else in the repo, so you can just
> download that script.
>
> Sample Usage:
>
> # just show what is going to change
> ./changeuuid.py pretend /dev/sdb /tmp/temp/
>
> # actually change
> ./changeuuid.py change /dev/sdb /tmp/temp/
>
> Refer the README for more details. Let me know if you have any issues.

Worked fine after I figured out a way to get the script.  I clicked on 
'raw' and saved, then chmod +x.

I see you tested this on the Fedora23 image.  Are you going to take this 
issue and script over to the Fedora-arm list, or may I?

Next on to resizing the rootfs as part of the same script.  See the 
Fedora-arm-installer script that has:

if [ "$RESIZEFS" != "" ] ; then
     echo "= Resizing $MEDIA ...."
     sync
     echo ", +" | sudo sfdisk -N 3 "$MEDIA"
     sudo fsck.ext4 -fy "$ROOTPART"
     sudo partprobe "$MEDIA"
     sudo resize2fs "$ROOTPART"
fi


Where $MEDIA is where mSD card is (e.g. /dev/sdb) and $ROOTPART is the 
rootfs partition (e.g. /dev/sdb3).

Very fast compared to other methods.




More information about the Arm-dev mailing list