Change Encrypted Partition Label?

I created an encrypted primary partition on an external USB drive. The process went smoothly and all works well, but I’m wondering if there is a way to change the label that the system gives this drive, which is a long alphanumeric-soup. The names that show up under /var/run/media/myname are nice and compact, except for this new partition, which is around 40 characters long. Since I don’t set a mount point for this USB drive or this partition, I’m not sure how to change the label in the Yast Partitioner, and Gparted does not seem to be able to change labels for Luks encrypted partitions. Am I stuck with the long, ugly label?

The partition is ext4 and I’m running 13.1

That is not the label that is the UUID of the partition. You an assign a label of course but I believe you may have to mount the partition first. Not sure with the encryption. In any case in Yast -partition management you can set a label ant then use by-label to mount.

Each partition has several “by” names you can see them in /dev/disk. By default labels are not set but other ids are used. In any case they are all just links to to the actual /dev/sdX# devices which are the partition. the reason for the odd numbering is that the ID mus be unique in the system and /dev/sdX# nomenclature may not be stable. sdX may not always appear in the same order due to plugged/not plugged device and other factors. but the “by” numbering is always the same no matter were the BIOS puts the drive.

If you do use labels be absolutely sure that you never duplicate the names on a system

On 2015-05-08 05:36, gogalthorp wrote:
>
> That is not the label that is the UUID of the partition. You an assign a
> label of course but I believe you may have to mount the partition first.
> Not sure with the encryption. In any case in Yast -partition management
> you can set a label ant then use by-label to mount.

Yes, you can label encrypted filesystems. As it is ext4, the tool to use
is “e2label”. See the man page for details.

The device is under “/dev/mapper/” after decrypted. I’m unsure if it is
possible to do it while mounted, though.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))