1

One of my attached disks had xfs filesystem. I formatted the disk to ext4 using: sudo mkfs.ext4 /dev/sdc1

Now when I run sudo -i blkid, I get this output:

/dev/sdc1: UUID="df722345-7e80-4a08-8da1-e6046cc2b0e1" TYPE="ext4" PARTLABEL="xfspart" PARTUUID="1df243b5-2b64-4c39-bd45-4cb31d7ff58e"

I can see that the PARTLABEL is xfspart. Before I make any changes to fstab, just want to make sure that PARTLABEL won't cause any problem, if I add this line to fstab

UUID=df722345-7e80-4a08-8da1-e6046cc2b0e1 /disk3 ext4 defaults,nofail 1 2

  • It shouldn't make any problem in fstab but I suggest to remove this partition and create again and then format it with ext4. maybe there are some meta data in partition level. – binarysta May 28 at 9:07
  • Can you tell me in detail in the answer section? – mlRocks May 28 at 9:09
1

The PARTLABEL is a property of the partition table (GPT), unrelated to partition content (any filesystem or lvm, luks, raid, etc.). Thus it's not overwritten when you mkfs partition content.

If you are not using this value for anything, you can ignore it since it means nothing. Or, to avoid confusion, you can change it with any partition software of your choice.

Example with parted:

# parted /dev/loop0 print
Number  Start   End     Size    File system  Name     Flags
 1      1049kB  94.4MB  93.3MB               xfspart
# blkid /dev/loop0p1                                        
/dev/loop0p1: PARTLABEL="xfspart" PARTUUID="a789cf0a-3a18-4b87-af2a-abfed6ca9028"

Change the PARTLABEL (partition name in parted) of partition 1 to something else:

# parted /dev/loop0 name 1 schnorrgiggl

Afterwards:

# blkid /dev/loop0p1
/dev/loop0p1: PARTLABEL="schnorrgiggl" PARTUUID="a789cf0a-3a18-4b87-af2a-abfed6ca9028"
# parted /dev/loop0 print
Number  Start   End     Size    File system  Name          Flags
 1      1049kB  94.4MB  93.3MB               schnorrgiggl

These names also appear under /dev/disk/by-partlabel which can be a convenient way to refer to partition block devices. Consider meaningful names like grub, boot, root, home, ... instead of xfspart or extpart which could be anything at all. However, if you use duplicate labels on separate disks, it's unclear which one the partlabel will point to.

PARTUUIDs exists to avoid such naming scheme conflicts, and filesystem UUID is the safest way to refer to a filesystem by content (regardless of where it is stored), so for /etc/fstab it's still best to use UUID= instead of any LABEL=, PARTLABEL=, PARTUUID= etc. alternatives.

| improve this answer | |
  • Thank you very much – mlRocks May 28 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.