(How To) Renaming Partition Volume Label

OS : Ubuntu Linux

I have some trouble when i tried to rename the volume of my disk. after make some study on it, i've found the solution.

1. recognize the disk

sudo fdisk -l


the output should look like this


Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb003b003

Device Boot Start End Blocks Id System
/dev/sda1 * 1 6375 51200000 83 Linux
/dev/sda2 6385 11570 41649152+ f W95 Ext'd (LBA)
/dev/sda3 11570 18493 55608997 7 HPFS/NTFS
/dev/sda4 18494 19409 7357770 83 Linux
/dev/sda5 6385 11570 41649152 7 HPFS/NTFS



from here , i can recognize which part of my partition i'd like to rename. In my case, i'd like to change the name at

/dev/sda3 11570 18493 55608997 7 HPFS/NTFS


2. Create Directory

now i have to create a new directory inside /media with name partition2

sudo mkdir /media/partition2


3. Edit /etc/fstab

better for us to play safe by creating a backup for the file fstab at any directory. In this case , i choose to place it at the same directory as current fstab file.

cp /etc/fstab /etc/fstab.old


ps : cp command is "copy" task

open with any text editor, for example gedit.

sudo gedit /etc/fstab


you should see something like this

proc /proc proc defaults 0 0
# Entry for /dev/sda1 :
UUID=4b5408bd-8826-400b-9456-f58802583f27 / ext4 relatime,errors=remount-ro 0 1
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sda5 /media/New\040Volume ntfs-3g defaults,locale=en_US.UTF-8 0 0


In this case, i am going to rename a partition from /dev/sda3, so i add this line

/dev/sda3 /media/partition2 ntfs-3g defaults,locale=en_US.UTF-8 0 0


ps : if it is already exist, modify the code. dont worry , you have create the backup.

4. remount the device

sudo mount -a


there you go...you have finish with your task :D

0 comments: