45

I'm new at Ubuntu; I installed Ubuntu 12.10 and the partitions appear like 30 GB volume and like 78EF-2C5E in task bar. I tried to rename it but rename and remove buttons are deactivated so I tried by using disks but it gives me error:

(Error setting label: Command-line `mlabel -i "/dev/sdb8" ::"windows"' exited with non-zero exit status 1: Total number of sectors (18550784) not a multiple of sectors per track (63)!
Add mtools_skip_check=1 to your .mtoolsrc file to skip this test
 (udisks-error-quark, 0))

and this happen also to any attached usb to my laptop.

heemayl
  • 91,753
mohamed
  • 451

5 Answers5

71

From the graphical desktop ( >= 12.10)

There is no need to run gparted only to give a partition a label. Just open Disks from the Dash:

enter image description here

Select the drive on the left panel and choose the partition to label in the volumes section. Then click on the highlighted area with the cogwheels for "More Actions" to reveal the menu shown above. This will let you "Edit Filesystem Label..." for the selected partition.


From the graphical desktop ( <= 12.04 LTS)

For release 12.04 LTS and earlier the application Disk Utility can be used for editing partition labels:

enter image description here


Note: after we had changed a label we may have to edit our fstab with the new label in case we mount disks by label.


From the command line

Replace /dev/sdxN with your partition (e.g. /dev/sdc1).

  • for FAT32:

    sudo mlabel -i /dev/sdxN ::"my_label"
    

    or:

    sudo fatlabel /dev/sdxN my_label
    
  • for NTFS:

    sudo ntfslabel /dev/sdxN my_label
    
  • for exFAT:

    sudo exfatlabel /dev/sdxN my_label
    
  • for ext2/3/4:

    sudo e2label /dev/sdxN my_label
    
  • for BTRFS:

    sudo btrfs filesystem label /dev/sdxN my_label
    
Takkat
  • 142,284
  • I am using Lubuntu 15.10 and my partition is ntfs(as windows installed on it earlier, now have removed it completely) I tried using disk utility option as suggested by you but it is showing this "Cannot change label on mounted device of type filesystem:ntfs. what should i do now (udisks-error-quark, 11)" – Onix Feb 26 '16 at 06:18
  • for command it says " the device /dev/sdc1 does not exist. Do I need to unmount it first, the unmount option is in the right click menu of the partition. – Onix Feb 26 '16 at 06:29
  • @Abomm you have to replace sdc1 with your partition descriptor. See edit. – Takkat Feb 26 '16 at 07:20
  • 1
    Note that instead of "Edit Filesystem Label", the option may be called just "Edit Filesystem" due to this bug. – Dan Dascalescu Aug 10 '16 at 04:52
  • 2
    Note: if you don't unmount the disk first, e2label will not change the label (and won't even report an error, which is confusing). – Sridhar Sarnobat Jul 18 '17 at 21:37
  • Yes Sridhar-Sarnobat is right, I still find it a pretty annoying and long way to just rename a USB. It should be part of the default core system. – Miracles Happen Aug 02 '18 at 06:42
  • @Miracles you can alway give a name to partitions or USB keys on formatting. – Takkat Aug 02 '18 at 06:52
  • Thanks Takkat, I actually worked out that you have to unmount the device before changing the label. Gparte crashed for some reason but Disks worked fine! It's not that complicated after all. – Miracles Happen Aug 02 '18 at 12:26
  • Your method worked fine - thank you. I am using Ubuntu 16.04 and the menu appeared slightly different than in your answer. I can send you a photo if you are interested. – Steve Roome Sep 06 '19 at 11:04
  • @SteveRoome: thank you for the notice... in more recent versions including 19.04 the corresponding menu entry is just Edit Filesystem... which is considered to be a bug (see link to LP in answer above) because it still leads to the editing the filesytem label only. – Takkat Sep 06 '19 at 11:54
  • Most popular for external hard drive: sudo exfatlabel /dev/sdxN my_label – Miladiouss Aug 06 '20 at 20:38
8

The easiest way to rename a partition is to install GParted.

sudo apt-get install gparted

Once you have installed this, just launch the program (you will need to enter your sudo password to use the program), find the drive you want to rename, unmount it, click label followed by renaming your partition. You can then just mount your partition again and all should be sorted.

You may find it easier/safer to use a Live CD rather than just via the program itself. As with anything, please remember to back up your data first as you never know, you may run into a bug which causes you to lose data! Thankfully, GParted is a recognised and fairly safe way to deal with partitions.

For more information on what to do, please see this website.

Timlah
  • 637
3

I have recently confronted with the same problem as yours. I am using Zorin, an Ubuntu-based distro, and, every time when I have some problem to solve I turn to the Ubuntu or Linux Mint community in order to find the answer.

For me, the solution was easier than using gparted. I have used Disk Utility, which is pre-installed.

Start - All Applications - Accessories - Disk Utilities

Once opened, you click on the hard drive listed in the left side of the window, and you can see the partitions in the right side of the window. Click on every partition in order to select it (it will turn blue) then, in order to change the name click on the button named "Edit Filesystem Label", and thus you will be able to rename the partition. Do this operation with every of them.

Note that, if you are running Windows on your computer along with Linux, you will notice that the new label will show in windows too.

I hope this helps. (If not for you, then to other users of ubuntu-based distros.)

0

Seeing an error like this while renaming ntfs partitions?

Volume is scheduled for check. Please boot into Windows TWICE, or use the 'force' option. NOTE: If you had not scheduled check and last time accessed this volume using ntfsmount and shutdown system properly, then init scripts in your distribution are broken. Please report to your distribution developers (NOT to us!) that init scripts kill ntfsmount or mount.ntfs-fuse during shutdown instead of proper umount.

Try this sudo ntfslabel --force /dev/sdxN new_label

Note: sdxN refers to your corresponding ntfs drive.

Alif
  • 111
0

In my Kubuntu 16.04, first 'unmount the partition' in KDE Partition Manager then right click->Property, then change label name.

Sunny
  • 1