How to use the command 'mlabel' (with examples)

How to use the command 'mlabel' (with examples)

The mlabel command is used to set an MS-DOS volume label for FAT and VFAT filesystems. It allows you to assign a name to a filesystem for easy identification. This command is particularly useful when working with external storage devices such as USB drives or memory cards.

Use case 1: Set a filesystem label

Code:

mlabel -i /dev/sda ::"new_label"

Motivation: Setting a filesystem label is useful when you want to identify a specific drive or partition. By assigning a label, you can easily differentiate between multiple storage devices connected to your system.

Explanation:

  • mlabel: This is the command itself.
  • -i /dev/sda: Specifies the device on which the filesystem label should be set.
  • ::"new_label": The new label to assign to the filesystem. The :: indicates that the label is for the root directory of the filesystem.

Example output:

Volume label for /dev/sda successfully set to "new_label".

Conclusion: The mlabel command provides a straightforward way to set a filesystem label, making it easier to identify specific drives or partitions.

Related Posts

Terraform Command Examples (with examples)

Terraform Command Examples (with examples)

1. Initializing a new or existing Terraform configuration Command: terraform init Motivation: Initializing a Terraform configuration is the first step before using any other Terraform command.

Read More
How to use the command lxc (with examples)

How to use the command lxc (with examples)

The lxc command is used to manage Linux containers using the lxd REST API.

Read More
How to use the command 'git psykorebase' (with examples)

How to use the command 'git psykorebase' (with examples)

Git psykorebase is a command that allows users to rebase a branch on top of another using a merge commit with only one conflict handling.

Read More