为什么 NTFS 分区 UUID 比正常短?

Iva*_*van 10 partitioning fstab mount ntfs uuid

如果您使用该sudo blkid命令查看带有 uuid 的分区或仅查看/etc/fstab(考虑到您有一些 NTFS 分区),您可能会注意到 NTFS 分区的 UUID 为 16 个字符长且没有破折号,而 ext2/3/4 和交换分区有带破折号的传统 32 字符(16 字节)长 UUID。为什么这样?

Rod*_*ith 11

因为这些值不是 UUID;它们是 NTFS 序列号。它们在/etc/fstab(和其他地方)被标识为 UUID,因为开发人员选择将标识符“UUID”用于基本上非 UUID 数据,而不是使用其他一些标识符。

顺便说一下,FAT 也是如此,但 FAT 序列号甚至比 NTFS 序列号还要短。


mur*_*uru 5

Microsoft 文件系统(NTFS 和 FAT 兄弟)不像 ext*/btrfs/其他 Unixy 文件系统那样支持 UUID。您看到的 UUID 是某种序列号(NTFS 为 64 位,FAT32 为 32 位)。我可以从 Linux 世界中挖掘出的唯一具体信息来自ntfslabel(8)联机帮助页

--new-serial[=ssssssssssssssss], or

--new-half-serial[=ssssssss]
      Set  a  new  serial  number  to  the device, either the argument
      value, or a random one if  no  argument  is  given.  The  serial
      number  is  a  64  bit  number,  represented  as a sixteen-digit
      hexadecimal number, used  to  identify  the  device  during  the
      mounting  process.  As  a consequence, two devices with the same
      serial number cannot be mounted at the same  time  on  the  same
      computer.  This is not the volume UUID used by Windows to locate
      files which have been moved to another volume.

      The option --new-half-serial only changes the upper part of  the
      serial  number,  keeping the lower part which is used by Windows
      unchanged.  In this case the optional argument is an eight-digit
      hexadecimal number.
Run Code Online (Sandbox Code Playgroud)

我怀疑这些“UUID”可能与fsutilWindows 上报告的序列号相同。