Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    [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

    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?

  2. #2
    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?


  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    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?
    mlabel /dev/sda1:VFAT_DOC
    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.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. $spacer_open
  5. #4
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts