1

I have partitions that I would like to rename. What are the terminal commands to do this?

kos
  • 35,535
  • 13
  • 101
  • 151
Sam Arora
  • 13
  • 1
  • 4

2 Answers2

3

You can re-label file systems with Gnome Disks:

Gnome Disks option menu Gnome Disks rename dialogue

If you really want to use the command line, the command depends on the affected file system type. For ext2/3/4 it's

sudo e2label <DEVICE> <NEW_LABEL>

In a similar fashion there are fatlabel, exfatlabel, ntfslabel, btrfs filesystem label, swaplabel for other file system types with the same command syntax.

David Foerster
  • 35,754
  • 55
  • 92
  • 145
0

From the command line :

Install the Labeling Program

Based on the package names listed above for each filesystem type, install the correct package for your partition:

sudo apt-get install <package>

Here are all the different ones:

 sudo apt-get install mtools
 sudo apt-get install ntfsprogs
 sudo apt-get install e2fsprogs
 sudo apt-get install jfsutils
 sudo apt-get install reiserfsprogs
 sudo apt-get install xfsprogs

Iidentify your partition

sudo fdisk -l

Example: partition sdX

for FAT32:

sudo mlabel -i /dev/sdX ::"new_label"

for NTFS:

sudo ntfslabel /dev/sdX new_label

for exFAT:

sudo exfatlabel /dev/sdX new_label

for ext2/3/4:

sudo e2label /dev/sdX new_label
GAD3R
  • 2,821
  • 1
  • 18
  • 30