Bug 503228

Summary: dosfslabel does not set volume label in the right place
Product: [Fedora] Fedora Reporter: Ben Hutchings <bhutchings>
Component: dosfstoolsAssignee: Jaroslav Škarvada <jskarvad>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: cheguaka, daniel, jskarvad, kasal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: dosfstools-3.0.9-2.fc14 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-15 15:13:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
make dosfslabel write volume label if present none

Description Ben Hutchings 2009-05-29 18:39:14 UTC
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):
3.0.0-2

How reproducible:
always

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 14:29:36 UTC
Is blkid looking at the right place?

https://bugzilla.redhat.com/show_bug.cgi?id=533552

Comment 2 Ben Hutchings 2009-11-13 14:45:02 UTC
(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 12:02:40 UTC
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: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Ben Hutchings 2009-11-18 14:06:13 UTC
dosfslabel has the same behaviour in 3.0.1-6.fc12.

Comment 5 Ben Hutchings 2009-11-18 15:33:47 UTC
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 09:08:56 UTC
Hi,

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

Regards,
Daniel

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