1

I want to create a disk under CoreOS that is automatically mounted at /var/lib/docker

So I created a var-lib-docker.mount unit file to do it and decided to use the by-label path under /dev/disk.

Initially I found my partitions appear under the by-partlabel path. It works great however.

In the process I found out that there is a program called e2label, and also under fdisk expert mode I can also create a partition label.

Having not found e2label initially I found I could label partitions with the word "DOCKER" in fdisk. But they actually come through to the path /dev/disk/by-partlabel and not /dev/disk/by-label

What are the differences between these? should one be favoured over the other?

  • 1
    Don't know why people think it's an off topic question when this is about partitioning on servers in a server farm. anyway.... – Matt Apr 7 '15 at 23:56
1

The ArchLinux wiki has (as always) good documentation on this issue. You wrote:

Having not found e2label initially I found I could label partitions with the word "DOCKER" in fdisk. But they actually come through to the path /dev/disk/by-label

I assume you meant "do NOT come through"? That could be explained by the fact that you created a partition label and your labeled disk should show up under /dev/disk/by-partlabel/ instead. Once you create a filesystem label (e.g. via e2label (tune2fs -L) for ext{2,3,4} file systems), the disk should show up under /dev/disk/by-label.

should one be favoured over the other?

partition labels are only available for GPT disks. For filesystem labels one would need some filesystem tool to apply a label to the partition. All major on-disk file systems seem to have this (tune2fs -L, jfs_tune -L, xfs_admin -L, reiserfstune -l) so unless it's something more exotic, file system labels should work just fine.

  • Right that makes sense. I'm using GPT labels and so they appear as partlabel. Old filesystem labels appear as by-label and is a feature of the filesystem. Thanks for the explanation! – Matt Apr 7 '15 at 23:17

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.