After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608310 - offer option to change UUID when copying partition
offer option to change UUID when copying partition
Status: RESOLVED OBSOLETE
Product: gparted
Classification: Other
Component: application
0.5.1
Other All
: Normal enhancement
: ---
Assigned To: gparted maintainers alias
gparted maintainers alias
Depends on:
Blocks:
 
 
Reported: 2010-01-28 07:01 UTC by Jim Michaels
Modified: 2020-11-13 10:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jim Michaels 2010-01-28 07:01:48 UTC
see http://gparted.sourceforge.net/docs/help-manual/C/gparted_manual.html
under "Copying and Pasting a Partition"

solve as a default option in gparted.

I don't exactly know which OS's definition of the term "Label" you are talking about in the documentation as to changing the label, but I suspect the UUID & label thing applies only to UNIX partition types, you should say so in your documentation. under NTFS it means something completely different, and I don't think the UUID applies, does it?

perhaps your program can generate the new UUID and apply it.
Comment 1 Curtis Gedak 2010-01-28 17:59:06 UTC
Thank you Jim for your interesting in GParted.

(In reply to comment #0)
> see http://gparted.sourceforge.net/docs/help-manual/C/gparted_manual.html
> under "Copying and Pasting a Partition"
> 
> solve as a default option in gparted.

In this situation, there is no single right or wrong way of performing a copy and paste of a partition.  It really depends on the reason why a person is copying a partition and what is the intended purpose of the copy.

For some of the arguments both for and against maintaining the UUID and volume label, see the following GParted forum discussion:
http://gparted-forum.surf4.info/viewtopic.php?id=13285


> I don't exactly know which OS's definition of the term "Label" you are talking
> about in the documentation as to changing the label,

It might help if I stated "volume label".  One of the challenges is that first we need to use the correct term in the English language.  Unfortunately, there are many ways that this "label" can be used.

"Disk Label" can be used as another term for "Partition Table".
http://en.wikipedia.org/wiki/Disklabel

"Volume Label" is probably closest to the type of label intended.
http://en.wikipedia.org/wiki/Volume_label#Volume_label

A second challenge is that the term also needs to be translatable to other languages so that it still makes sense in a variety of written languages.


> but I suspect the UUID &
> label thing applies only to UNIX partition types, you should say so in your
> documentation. under NTFS it means something completely different, and I don't
> think the UUID applies, does it?

NTFS also supports the concept of UUID and Volume Label.  Hence this concept is relevant to all file systems.

To view these values you can use the blkid command in GNU/Linux.  Sample output follows:

/dev/sdd1: LABEL="My Ext Label" UUID="f7396bba-30fd-423c-bb99-5335da3d655b" TYPE="ext2" 
/dev/sdd2: LABEL="My Ext3 FS" UUID="6b32e831-3282-4b06-bab1-51d09a0756ae" SEC_TYPE="ext2" TYPE="ext3" 
/dev/sdd3: SEC_TYPE="msdos" LABEL="My Fat16 Lb" UUID="4B61-CD05" TYPE="vfat" 
/dev/sdd5: LABEL="My Fat32 La" UUID="4B61-CD08" TYPE="vfat" 
/dev/sdd6: LABEL="My JFS Label" UUID="b0395a4a-bd61-4180-a4ef-b69f8fe2a1fd" TYPE="jfs" 
/dev/sdd7: TYPE="swap" LABEL="My Linux-Swap" UUID="1123b919-1661-4763-9705-a148786ddd7b" 
/dev/sdd8: UUID="7D53E0DD37125A82" LABEL="My NTFS Label" TYPE="ntfs" 
/dev/sdd9: UUID="6bb7c66b-64d2-4825-bbb8-9263381335a1" LABEL="My Reiser4 Lbl" TYPE="reiser4" 
/dev/sdd10: UUID="c46be00c-efc2-46dd-b52d-5ea39d67476c" LABEL="My ReiserFS Labe" TYPE="reiserfs" 
/dev/sdd11: LABEL="My XFS Label" UUID="062121e3-6293-4989-ad51-5dc0488b4eb3" TYPE="xfs" 

As can be seen above, partition /dev/sdd8 is formatted as TYPE "ntfs" and has a UUID and a LABEL.

 
> perhaps your program can generate the new UUID and apply it.

File system tools are available for setting the UUID on file systems such as ext2/3/4 (see e2fsprogs).  Unfortunately I am not aware of any free open source software tools for performing the same function on NTFS file systems.  ;(

Do you know of a free open source tool that permits changing the UUID on an NTFS file system?

If you are keen, perhaps you could provide a list of free open source software tools for changing the UUID on each of the file systems supported by GParted?

Such a list would help in implementing the ability to change UUID's from within GParted.
Comment 2 Jim Michaels 2010-01-30 01:30:15 UTC
in the Windows world, UUIDs are called a GUID for Globally Unique IDentifier.  If you were to look for this in the volume ID I think you would find it.

I don't know if it would mangle windows or not. only a test would see. and I can't test since I don't have an extra 1TB hard drive to copy to.

see http://lists.freedesktop.org/archives/hal/2004-August/000769.html

all I did was google "ntfs uuid".

I am not a linux expert. I can just find things.
Comment 3 Curtis Gedak 2010-09-24 21:12:24 UTC
Re-filing this bug report under application instead of livecd.
Comment 4 Phillip Susi 2012-01-04 16:12:23 UTC
I think the status of this bug needs set to NEW and the title changed to "offer option to change UUID when copying partition".
Comment 5 Curtis Gedak 2012-01-04 17:47:11 UTC
Changing title
from "solve duplicate UUID problem when copying partition"
  to "offer option to change UUID when copying partition"
Comment 6 Greg M. 2012-01-30 17:48:30 UTC
For what it is worth this is what I use to change the UUID / GUID on an NTFS partition:

You can boot from a live CD/USB from Ubuntu (for example), go to terminal and use this code:

dd if=/dev/urandom of=/dev/[ntfspartition] bs=8 count=1 seek=9

Replace the [ntfspartition] with the proper partition that you want the UUID changed on (ie: sda1)

!!! WARNING WARNING WARNING !!!
For [ntfspartition] YOU MUST make sure you Identify the PROPER partition!!
ie:  sda1   or   sda2   or  sdb1  or  sdb2  or  sdc1  or sdc2   etc etc etc.
DO NOT put sda in there or you will SCREW your MBR !
Also you will want to run:  sudo blkid to make SURE you are modifying the proper partition.
!!! END OF WARNING WARNING WARNING !!!

then you can re-run sudo blkid in terminal to see what the new UUID is and make the appropriate changes to your Grub2 installation (If you are using it)

I think it would be a very handy feature within GParted.  A check box that gives us the "OPTION" to have the UUID change would be very cool.

I don't know if this is useful, but I hope it helps.
Comment 7 Curtis Gedak 2012-01-30 17:50:47 UTC
Thank you for the tip 2gregandapril.

Work is currently in progress to add the ability to GParted to set a new UUID.

See Bug #667278 - Add support for setting UUID
Comment 8 Greg M. 2012-01-30 17:59:34 UTC
Cool.  I was just updating GParted and came across this, so I thought I'd comment.  I see in the other link there that you found the tread that I had posted the above code on.  It was a pain to find the answer, and so I thought I'd mention it here.

Cheers,

Greg
Comment 9 Curtis Gedak 2012-02-24 18:18:03 UTC
GParted 0.12.0 released on Feb 21, 2012 includes the ability to set a new UUID on file systems for which the tools support this option.

The steps to change the UUID on the source or the copy of the partition would be as follows:

1)  Apply the copy operation
2)  Select either the source or the copy of the partition
3)  Choose the menu option "Partition --> New UUID"
4)  Apply the operation

This is not the same as offering to change the UUID while copying the partition, but should accomplish the same result.
Comment 10 Greg M. 2012-02-26 17:57:12 UTC
Perfect timing!  I was just about to do some playing with this.  Can't wait to try it out.
Comment 11 Greg M. 2012-02-26 18:10:00 UTC
This may be a tad premature but does Gparted have the ability to simply 'select' a partition (without copying/moving data) and "Change" the UUID?  If so, how would you do that?  Thanks
Comment 12 Curtis Gedak 2012-02-26 18:28:15 UTC
Yes, you can change the partition UUID without copying or moving data.

See the GParted Manual section "Changing a Partition UUID" for the steps, and also read the warnings about changing the UUID.

http://gparted.org/display-doc.php?name=help-manual
Comment 13 Phillip Susi 2012-11-05 19:05:03 UTC
Shouldn't this bug report be marked as fixed?
Comment 14 Curtis Gedak 2012-11-05 19:13:32 UTC
Good question Phillip.

The functionality to change a UUID on an existing partition is now a part of GParted.

However, the ability to "Offer option to change UUID when copying partition" is not a current ability of GParted.

Part of the challenge of offering the ability to change the UUID of a not-yet-existing partition (a copy of a partition), is that GParted does not know the path to the partition.  The path is only known after the partition is created.  This need to know the path name before creation causes difficulty when queuing the task to later change the UUID.

Since the original reporter asked for GParted to "solve as a default option in gparted" for UUID, I believe that the request for this feature is still valid.
Comment 15 Leslie Satenstein 2014-01-26 16:57:21 UTC
Gparted should not change the UUID for an existing swap file

I had Linux trying to do a check for a non existent UUID. 

I discovered the problem, and it may be a logic rule in Gparted.  

With Gparted, one can issue a swapon / swapoff, command, and subsequently a format swap.  Gparted, in its design, assigns a new UUID for the swap partition after a format.   

That means that the fstab now points to a non-existant swap partition.

How to correct within Linux?

Use the information tab of gparted, to copy the uuid it has assigned to the fstab. replacing the existing UUID.

alternatively, in fstab use the /dev/sdxn rule, where x is the drive and n is the partition number in that drive. 

My single swap file is shared by three distributions. By changing the UUID, I have to repair three fstabs.
 
I will paste this as a gparted request for improvement.
Comment 16 Curtis Gedak 2014-01-26 20:29:31 UTC
Hi Leslie,

Thank you for your interest in GParted.

This report is an enhancement request to be able to select a new UUID when using the copy operation.  Currently this is not possible in a single step.

Instead the user must first copy the partition, apply the operation (both the source and copy have the same UUID), and then set a new UUID on the partition.

Note that resizing or moving a partition keeps the original UUID.


From comment #15 it seems that there might be some confusion regarding the GParted format operation.

What version of GParted are you using?
Currently the most recent version is 0.17.0.

Regarding the GParted format operation, whenever a partition is formatted, either a new partition or an existing partition, a new UUID _is always_ created.

Curtis
Comment 17 Leslie Satenstein 2014-03-30 18:05:42 UTC
hello Curtis
t
For some reason I missed a feedback about your question to me re Gparted version and the like.  

I am sorry to not have found a follow up email.


fyi, My  current version is 0.18, previous may have been 0.17.x

I have a swapon swapoff test to do, and will look at the previous/new UUID when reformatting an existing partition.

There should be no change, as there has been no partition delete or recreate.

Again, UUID for an existing partition should never be automatically replaced, for a format or for swapon/swapoff.  Yes, a new uuid could be created if the partition is deleted, and then reactivated.

My testing is with Fedora20.  

Regards
Comment 18 Phillip Susi 2014-03-31 02:22:44 UTC
For swapon/off yes, and that's how they always have behaved.  For format, no.  When you format a volume you are creating a new filesystem that is not in any way related to any previous filesystem that may have been there, thus you get a new uuid.

In other words, the uuid is a property of the filesystem, not the partition, so creating a new filesystem gets you a new uuid, even if it is reusing an existing partition.
Comment 19 André Klapper 2020-11-13 10:41:30 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time.

If you still use gparted and if you still see this bug / want this feature in a recent and currently supported version, then please feel free to report it at
https://gitlab.gnome.org/GNOME/gparted/-/issues/
by following the guidelines at
https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines

Thank you for creating this report and we are sorry it could not be implemented so far (volunteer workforce and time is limited).