LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-26-2007, 04:14 PM   #1
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,832

Rep: Reputation: 108Reputation: 108
How to change "volume label" of the USB drives?


Hya,

Question is:
How to change "volume label" on the drives connected through USB? - USB memory stick, external hard drive (ext3), ...

Reason is:
Volume without label is recognized as generic name by udev. This is confusing every once in a while. So I want specific name to each USB stick, external drive...

I know how to set it, using mkfs. (for ext3 mkfs.ext3 -L labelName, for vfat mkfs.vfat -n volumeName) But doing so, drive is initialized.
I tried "mlabel" but does not work well.

For some reason, web search gives me only mlabel.

Is there any way to keep content and change "volume label" ?

I appreciate any suggestion.

Happy Penguins!
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 10-26-2007, 05:40 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I use "mlabel" to do it. You probably need to edit /etc/mtools.conf to be able to assign a dos device name to the pen drive.

Here is an excerpt from a previous message I posted:
Quote:
Install the "mtools" package if you have it. This package supplies the "mlabel" package. Add the following line to
/etc/mtools.conf:
drive p: file="/dev/sdb1". The p: device name is arbitrary. The default config will cover your floppy drives, but adding such a line will probably be needed to assign a dos type device name to a linux device. The /etc/mtools.conf file is well commented with plenty of commented out examples.

Use the appropriate value for the device, either /dev/sda1 or /dev/sdb1 in your case.
Now you can use mlabel to relabel the drive like this:
mlabel p:label
 
Old 10-26-2007, 08:44 PM   #3
Hendronicus
Member
 
Registered: Feb 2006
Location: Oldsmar, Fl. USA
Distribution: Slackware, Ubuntu
Posts: 176

Rep: Reputation: 50
I'd use e2label, like this: e2label device newlabel
 
3 members found this post helpful.
Old 10-31-2007, 04:02 PM   #4
kaz2100
Senior Member
 
Registered: Apr 2005
Location: Penguin land, with apple, no gates
Distribution: SlackWare > Debian testing woody(32) sarge etch lenny squeeze(+64) wheezy .. bullseye bookworm
Posts: 1,832

Original Poster
Rep: Reputation: 108Reputation: 108
Hya,

Thanks, both tricks do.

Also I found that tune2fs can change label.

Happy Penguins!
 
Old 12-07-2008, 02:55 AM   #5
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,364

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Hi,

Quote:
Originally Posted by jschiwal View Post
I use "mlabel" to do it. You probably need to edit /etc/mtools.conf to be able to assign a dos device name to the pen drive.
Thanks for giving me the solution to a problem I wrestled with for about 2 hours :-). I was trying to alter a FAT32 external HDD so of course only mlabel was suitable.

Andrew

Last edited by andrew.46; 12-07-2008 at 02:57 AM.
 
Old 07-10-2012, 08:44 AM   #6
sswam
LQ Newbie
 
Registered: Dec 2009
Posts: 10

Rep: Reputation: 1
ridiculous, wrapper script

That's ridiculous, so I wrote a wrapper script: http://sam.nipl.net/code/nipl-tools/bin/fattag
 
Old 08-29-2012, 09:39 AM   #7
LxQ
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Rep: Reputation: Disabled
Label USB device via GUI

In GPARTED right click on entry. There's an option to label......
 
Old 09-09-2013, 03:07 PM   #8
dax5
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
Disk Utility can also be used

To avoid installing anything and messing with mtools I have just used Disk Utility (it seems installed automatically in Ubuntu 12.4).
 
  


Reply

Tags
label, udev, volume


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gnome, Shortcut for "headphones" instead of "volume" Bollie Linux - General 2 06-07-2007 09:19 PM
Doesn't mount multiple USB drives (one "port") jpantone Linux - Hardware 2 03-08-2007 02:16 PM
How to use Use "USB Flash Drives" in Slackware?? DdOs Linux - Newbie 26 03-31-2006 02:57 PM
lost writing ability on usb-stick / not possible with protocol "drives" - how to fix? ungua SUSE / openSUSE 3 11-24-2004 08:11 PM
Writing to "/dev/usb/hiddev*" and to "/proc/bus/usb/00B/00S" throw an arror EI stpg Programming 0 07-14-2004 05:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration