Results 1 to 4 of 4
Using Debian Lenny
I'm trying to label my usb flash drives.
I checked on the Internet and found a page, but I can't get it to
work: https://help.ubuntu.com/community/RenameUSBDrive
I umounted ...
- 04-10-2010 #1Linux Newbie
- Join Date
- Dec 2008
- Posts
- 135
[SOLVED] Want to label flash drives
Using Debian Lenny
I'm trying to label my usb flash drives.
I checked on the Internet and found a page, but I can't get it to
work: https://help.ubuntu.com/community/RenameUSBDrive
I umounted the usb drive. I checked it with
Debian:~# blkid
/dev/sda1: UUID="B1CC-3C4F" TYPE="vfat"
but when I try to make a label I get this message:
Debian:~# mlabel -i /dev/sda1 ::VFAT_DOC
Can't open /dev/sda1: No such file or directory
Cannot initialize '::'
mlabel: Cannot initialize drive
If I try mlabel -i /dev/sda1 ::VFAT_DOC when the drive is mounted
I get this output:
Debian:~# mlabel -i /dev/sda1 ::VFAT_DOC
Total number of sectors (7855032) not a multiple of sectors per track (62)!
Add mtools_skip_check=1 to your .mtoolsrc file to skip this test
but no label is attaached to the drive.
I added this to /etc/mtools.conf:
drive p: file=/dev/sdb1
and ran this command:
mlabel p:VFAT_DOC
and still can't get it to work
Can't open /dev/sda1: No such file or directory
Cannot initialize 'P:'
mlabel: Cannot initialize drive
Can someone tell me what I am doing wrong?
- 04-10-2010 #2Linux Newbie
- Join Date
- Dec 2008
- Posts
- 135
I tried this again as a normal user and it worked.
It doesn't work as root.
What would be the reason for this?
When I use blkid to get a prinout:
/dev/sda1: UUID="B1CC-3C4F" TYPE="vfat" LABEL="VFAT-DOC"
/dev/sda: UUID="f6d37e07-f1fd-4971-a6c9-b3f54cd66e1a" TYPE="ext2" LABEL="ext2-doc"
it still shows /dev/sda1 as the vfat flash drive even though it is no longer attached. If I mount another flash drive it will put it under /dev/sda. Has linux reserved this device for this flash drive?
Thanks
- 04-10-2010 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,961
Accoding to the man page on my system, mlabel should be used like this: mlabel [-vcsn] [-N serial] drive:[new_label] which makes me think you are using the wrong syntax. What happens if you do this as root?
This is assuming /dev/sda is the flash drive. Normally it would be the system boot drive, so make sure you are using the correct device ID.Code:mlabel /dev/sda1:VFAT_DOC
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 04-12-2010 #4Linux Newbie
- Join Date
- Dec 2008
- Posts
- 135
I did some more work on this and found the solution.
I need a .mtoolsrc for mlabel to work.That is why it
wasn't working as root.
I don't know what the difference is between safely remove and
umount a flash drive, but when I safely remove I can't access the drive with mlabel, but when I umount I can.
The pop-up when Iinsert the flash drive sometimes gives me one
option and sometimes the other.



