2

Are disk partition labels or UUIDS stored in the partition area itself or in some other area of the hard disk?

e.g If the dd command is used is used to copy the raw partition image from one partition to another, or even onto a different hard disk. or the tar command is used (if it is stored in some special file) will the new partition have the same UUID or label?

Are they stored in some special area of the original physical disk or in the partition itself?

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
vfclists
  • 1,562
  • 5
  • 20
  • 36
  • 1
    Dude. the partition area IS On the hard disc, so the question can be answered with "yes". Case closed. – TomTom May 07 '13 at 10:20
  • @TomTom The question is whether the UUID is stored in the partition area itself or stored in the partition table on the hard disk - hence the example asking if by using dd to copy the partition image to another partition on the same hard disk or even a different hard disk altogether. – vfclists May 07 '13 at 10:46
  • @SvW Why to you link the question back to itself. – vfclists May 07 '13 at 10:48
  • 1
    Sorry, wrong URL went into clipboard ... http://serverfault.com/questions/54862/where-does-ubuntu-store-partition-uuids-on-disk – Sven May 07 '13 at 10:50
  • @SvW The answer to the linked Ubuntu question does not answer my question. – vfclists May 07 '13 at 10:50
  • Good answers reference the user needs, if they can be discerned even if they are not well articulated. The author of the Ubuntu question comments `I'm not interested in the UUID, but how those UUID to device mappings are built, and expect it to boot`. 372720 refers to something similar. I am also concerned with getting a system to boot on another disk. So either dd or clone the partition or tar.gz and amend the grub.cfg and /etc/fstab on the target computer etc. Questions answered with more appreciation of the context is what makes stack exchanges useful not plain and flippant yes/nos – vfclists May 09 '13 at 13:14

1 Answers1

5

Both the label and the UUID are part of the file system, not the partition or something inherent to the disk.

The question I linked to and that you deemed not helpful, explained that the UUID is stored in the superblock, which is a part of the file system and fully contained within the partition.

So, if you do a dd if=/dev/sda1 of=/dev/sdb1, both sda1 and sdb1 will have the same label and UUID.


Edit: More details.

  1. Google exist and it can tell you what a superblock is. This site is for professionals and I expect you to be able to get that kind of information yourself.

  2. An UUID is quasi-guaranteed to be unique at creation time. There is no explicit or implicit guarantee that it stays unique if it applied to an object and that object is cloned (as it is the case with a dd'ed file system. To make it explicit: If you clone a file system, the UUID will not be unique anymore as it is a part of the cloned filesystem.

  3. A MAC can't be considered unique for a long time now. You can change a MAC at will in many/most cases. The same is true with any aspect of a virtual machine.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • The linked question doesn't say what a superblock is nor where it is located. The reason I ask is UUIDs are supposed to be unique everywhere, but partitions get duplicated, hence the question is to verify if blkids belong to the hard disk itself. If a partition is replicated on another disk or a new partition on the same hard disk will the blkid generated by the partitioning process be retained after the data is copied over? Another way of putting the question is whether blkids are always unique to the hardware like network MAC addresses, or even virtual hardware as may be the case. – vfclists May 07 '13 at 11:36
  • @SwV Your answer is correct, but please edit it and make the answer as direct as possible in the best explanatory manner and more info about what superblocks are if it is important in understanding the answer – vfclists May 07 '13 at 11:41
  • @vfclists: See my edit. – Sven May 07 '13 at 11:53
  • As a comment on your 3rd point. MAC addresses ARE UUIDs. You can just as easily change the UUID of the filesystem. The difference of those UUID's is their permutation space and thus their collision probabilities. – user May 07 '13 at 12:04
  • @user: My point was more along the line that the MAC is not immutable, which is an all-to common misconception. – Sven May 07 '13 at 12:07
  • @SwV The reason I requested for the answer to be edited is so that any person who needs an answer to the question gets a plain answer directed at his needs rather than come across a debate beginning to turn sour. Having to Google to get further clarification only means the answer isn't good enough. Furthermore professionals tend to focus narrowly in one area, at the expense of others. Would the superblock mean much to a Windows professional? People also visit forums because they are pressed for time. Isn't having to Google another detour from their original quest? – vfclists May 07 '13 at 12:22
  • @SwV All I want is a good direct helpful answer so I can mark it correct and move on. I don't want any person seeking an answer to walk into a debate. I believe the mods can clean this up after. – vfclists May 07 '13 at 12:25
  • @vfclists: This is nonsense. I can make no assumption about the knowledge level of anyone reading the question and if I follow your argument, I would need to explain what an UUID is, what a partition is and whatnot. I can (and do) however assume that the readers are professional able to get missing information themselve. If they are not, they are on the wrong site. – Sven May 07 '13 at 12:27
  • Also you forgot one thing: It's my time I spent to answer a question and I won't waste time to explain things that are easily found elsewhere and it's unreasonable to expect anything else, and I couldn't care less if a reader has not much time himself - he comes here for help, not the other way round. But that's it, I wasted too much time on this already. – Sven May 07 '13 at 12:28