Changes the volume label of the specified drive.
DriveSetLabel Drive , NewLabel
Type: String
The drive letter followed by a colon and an optional backslash (might also work on UNC paths and mapped drives).
On Linux and macOS, specify the volume's mount point instead, such as / or /media/user/BACKUP.
Type: String
If omitted, the drive will have no label. Otherwise, specify the new label to set.
An OSError is thrown on failure, including when the operation is refused for lack of privileges, and on Linux when the volume's filesystem is not one of those listed below.
Changing a volume label is a privileged operation on every platform. Expect it to require an elevated process on Windows, and root on Linux and macOS.
Sets the label directly through the .NET drive API.
The mount point is resolved to its backing block device with findmnt, then the label is set with the utility for that filesystem: e2label (ext2/ext3/ext4), btrfs filesystem label, xfs_admin, fatlabel (FAT/FAT32/msdos), ntfslabel (NTFS) or exfatlabel. That utility must be installed; any other filesystem throws.
Renames the volume with diskutil renameVolume.
DriveGetLabel, Drive functions