I have created a FAT16 formatted partition on my USB stick using

mkdosfs /dev/sdb1

when I plug in my stick, it appears in /dev/ as:


How can I change the UUID of the disk to something else than ABCD-1234 ?


tune2fs does not seem to work:

# tune2fs /dev/sdb1 -U AAAA-1111
tune2fs 1.42.5 (29-Jul-2012)
tune2fs: Bad magic number in super-block while trying to open /dev/sdb1
Couldn't find valid filesystem superblock.


I have installed mtools 4.0.17-1 on Debian Wheezy, but the mlabel command does not work:

# mlabel -N aaaa1111 /dev/sdb1
Mtools version 4.0.17, dated June 29th, 2011
Usage: mlabel [-vscVn] [-N serial] drive:

mtools comes with an utility mlabel which might do the job.

mlabel -N aaaa1111 -i /dev/sdb1 ::

Apart from that you might have to resort to a hex editor. The dosfstools only lets you change the label using the fatlabel command (which mlabel does too, just without the volume id).

If you're willing to re-create the filesystem from scratch, the value can also be supplied via mkfs.vfat -i VOLUME-ID.

  • this does not work. Please see my update – Martin Vegter Feb 10 '16 at 13:16
  • Oh, and if you add a :? – frostschutz Feb 10 '16 at 13:20
  • 1
    The correct syntax would be mlabel -N aaaa1111 -i /dev/sdb1 ::, to specify /dev/sdb1 as the "image" to use. – Stephen Kitt Feb 10 '16 at 13:22
  • This program uses strange DOS drive letter names... mtoolstest might list them. Sorry, I relied too much on the manpage for this one... ;) – frostschutz Feb 10 '16 at 13:27

mtools work:

mlabel -N $(uuidgen | head -c8) f:

You just have to configure /etc/mtools.conf:

drive f: file="/dev/sdb1"

use below command

tune2fs partition_name -U useb_id_what_you_want

use uuidgen to generate random UUID

  • tune2fs does not work. Please see my update for details. – Martin Vegter Feb 10 '16 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.