Bug 503228 - dosfslabel does not set volume label in the right place
dosfslabel does not set volume label in the right place
Product: Fedora
Classification: Fedora
Component: dosfstools (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jaroslav Škarvada
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-05-29 14:39 EDT by Ben Hutchings
Modified: 2010-03-15 11:13 EDT (History)
4 users (show)

See Also:
Fixed In Version: dosfstools-3.0.9-2.fc14
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-03-15 11:13:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
make dosfslabel write volume label if present (2.36 KB, patch)
2009-11-18 10:33 EST, Ben Hutchings
no flags Details | Diff

  None (edit)
Description Ben Hutchings 2009-05-29 14:39:14 EDT
Description of problem:
FAT filesystems can contain volume labels in 2 different places: a reserved location in the boot sector, and a special directory entry in the root directory.  Here's what various libraries and commands do:

FreeDOS label: only gets/sets directory entry
libvolume_id (used by udev before v142):
               gets directory entry if present, otherwise boot sector
libblkid (part of util-linux-ng; previously e2fsprogs; used by many commands):
               gets directory entry if present, otherwise boot sector
mkdosfs -n:    sets directory entry and boot sector
dosfslabel:    only sets boot sector

dosfslabel is clearly the odd one out, not even consistent with mkdosfs from the same package.  It should look for a directory entry with the volume label and update that if present, as well as updating the boot sector.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. dd bs=512 count=2880 </dev/zero >foo
   2880+0 records in
   2880+0 records out
   1474560 bytes (1.5 MB) copied, 0.0121247 s, 122 MB/s
2. mkdosfs -n foo foo
   mkdosfs 3.0.0 (28 Sep 2008)
3. dosfslabel foo bar
4. blkid foo
   foo: SEC_TYPE="msdos" LABEL="foo" UUID="B63E-8D7A" TYPE="vfat" 
Actual results:
foo: SEC_TYPE="msdos" LABEL="foo" UUID="B63E-8D7A" TYPE="vfat" 

Expected results:
foo: SEC_TYPE="msdos" LABEL="bar" UUID="B63E-8D7A" TYPE="vfat" 

Additional info:
Comment 1 cheguaka 2009-11-13 09:29:36 EST
Is blkid looking at the right place?

Comment 2 Ben Hutchings 2009-11-13 09:45:02 EST
(In reply to comment #1)
> Is blkid looking at the right place?
> https://bugzilla.redhat.com/show_bug.cgi?id=533552  

blkid may also be broken in some way, but the intended behaviour of the code is as described in comment 0. I must admit I didn't test any version of Windows.
Comment 3 Bug Zapper 2009-11-18 07:02:40 EST
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 4 Ben Hutchings 2009-11-18 09:06:13 EST
dosfslabel has the same behaviour in 3.0.1-6.fc12.
Comment 5 Ben Hutchings 2009-11-18 10:33:47 EST
Created attachment 370106 [details]
make dosfslabel write volume label if present

This patch applies to 3.0.1-6.fc12 and has been tested on FAT12, FAT16 and FAT32 filesystems created using mkdosfs.
Comment 6 Daniel Baumann 2009-12-24 04:08:56 EST

applied the patch upstream, will be present in 3.0.7 in a few hours.

Comment 7 Jaroslav Škarvada 2010-03-15 11:13:21 EDT
Fixed in dosfstools-3.0.9-2.fc14 in rawhide.

Note You need to log in before you can comment on or make changes to this bug.