LinuxCommandLibrary

volname

Print filesystem volume label

SYNOPSIS

volname [ -v ] device [ new_volume_label ]

PARAMETERS

-v
    Display the current volume label before setting a new one.

device
    The path to the block device (e.g., /dev/sda1) containing the filesystem.

new_volume_label
    (Optional) The new label to assign to the filesystem. Maximum 16 characters.

DESCRIPTION

volname is a utility designed to interact with the volume labels of ext2, ext3, and ext4 filesystems. When invoked with only a device argument, it will display the current volume label associated with that filesystem. If an optional new_volume_label is also provided, volname will then proceed to set the filesystem's volume label to the specified string.

It's important to note that volume labels are limited to a maximum of 16 characters. Any label exceeding this length will be truncated by the command. The volname utility exists primarily for backward compatibility, specifically with the minix filesystem. For modern ext2/3/4 filesystems, the e2label(8) command is the recommended tool for managing volume labels due to its more robust and feature-rich implementation.

CAVEATS

The volname command is primarily maintained for backward compatibility with the minix filesystem. For ext2, ext3, and ext4 filesystems, it is strongly recommended to use the more modern and robust e2label(8) utility instead. Volume labels are limited to a maximum of 16 characters; longer labels will be truncated without warning.

TRUNCATION BEHAVIOR

When a new_volume_label longer than 16 characters is provided, volname will silently truncate it to 16 characters. Users should be aware of this limitation and ensure their labels fit the specified length.

HISTORY

The volname command originated for managing volume labels on minix filesystems. With the advent and widespread adoption of ext2, ext3, and ext4 filesystems, its functionality was extended to support these, mainly for backward compatibility rather than being the primary tool. Modern e2fsprogs utilities like e2label superseded it for ext family filesystems, offering more comprehensive and safer label management.

SEE ALSO

e2label(8), tune2fs(8), fsck.ext2(8)

Copied to clipboard