No automount for 8GB SDHC card: "FAT: Invalid FSINFO signature: 0x41645252, 0x61417272 (sector = 1)"

Bug #589369 reported by clubsoda
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Fix Released
Undecided
Jeroen Oortwijn

Bug Description

Binary package hint: util-linux

Memory card: Toshiba 8GB micro SDHC
Internal card reader: Alcor
External card reader: Marantz PMD661 audio recorder

Problem: If the card is formatted in the audio recorder, it will not automount in linux and the mount utility doesn't recognise the partition [mount: you must specify the filesystem type]. Mounting manually with "mount -t vfat" works but /var/log/messages includes the line "FAT: Invalid FSINFO signature: 0x41645252, 0x61417272 (sector = 1)".

The card will automount in linux if partitioned with fdisk and formatted with mkdosfs but then the Marantz recorder is unhappy, claiming the card is unformatted.

In either case fdisk sees the same partition table:-

sudo fdisk -lu /dev/sdb
Disk /dev/sdb: 7969 MB, 7969177600 bytes
221 heads, 20 sectors/track, 3521 cylinders, total 15564800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot Start End Blocks Id System
/dev/sdb1 8192 15564799 7778304 b W95 FAT32

Cheers.

=====================================
PS: The audio recorder can be plugged into USB as a card reader. This doesn't solve the above problem but the initial error messages are different, provided here to help others find this bug:-

kernel: [13289.756097] usb 1-1: new full speed USB device using uhci_hcd and address 2
kernel: [13289.927358] usb 1-1: configuration #1 chosen from 1 choice
kernel: [13289.936842] scsi3 : SCSI emulation for USB Mass Storage devices
kernel: [13294.942781] scsi 3:0:0:0: Direct-Access D&M PMD661 0100 PQ: 0 ANSI: 0
kernel: [13294.954092] sd 3:0:0:0: Attached scsi generic sg7 type 0
kernel: [13295.152123] sd 3:0:0:0: [sdf] 15564801 512-byte logical blocks: (7.96 GB/7.42 GiB)
kernel: [13295.158962] sd 3:0:0:0: [sdf] Write Protect is off
kernel: [13295.172984] sdf: sdf1
kernel: [13295.192969] sd 3:0:0:0: [sdf] Attached SCSI removable disk
kernel: [13295.286282] sd 3:0:0:0: [sdf] Unhandled sense code
kernel: [13295.286293] sd 3:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [13295.286302] sd 3:0:0:0: [sdf] Sense Key : Medium Error [current]
kernel: [13295.286313] sd 3:0:0:0: [sdf] Add. Sense: Recorded entity not found
kernel: [13295.286325] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 80 00 00 00 01 00
kernel: [13295.307884] sd 3:0:0:0: [sdf] Unhandled sense code
kernel: [13295.307895] sd 3:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [13295.307904] sd 3:0:0:0: [sdf] Sense Key : Medium Error [current]
kernel: [13295.307915] sd 3:0:0:0: [sdf] Add. Sense: Recorded entity not found
kernel: [13295.307927] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 80 00 00 00 01 00
kernel: [13295.372862] sd 3:0:0:0: [sdf] Unhandled error code
kernel: [13295.372873] sd 3:0:0:0: [sdf] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
kernel: [13295.372883] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 7f ff 00 00 01 00
kernel: [13295.415001] sd 3:0:0:0: [sdf] Unhandled error code
kernel: [13295.415011] sd 3:0:0:0: [sdf] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
kernel: [13295.415021] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 7f ff 00 00 01 00
kernel: [13295.436849] sd 3:0:0:0: [sdf] Unhandled sense code
kernel: [13295.436860] sd 3:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [13295.436869] sd 3:0:0:0: [sdf] Sense Key : Medium Error [current]
kernel: [13295.436881] sd 3:0:0:0: [sdf] Add. Sense: Recorded entity not found
kernel: [13295.436892] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 80 00 00 00 01 00
kernel: [13295.457862] sd 3:0:0:0: [sdf] Unhandled sense code
kernel: [13295.457873] sd 3:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [13295.457883] sd 3:0:0:0: [sdf] Sense Key : Medium Error [current]
kernel: [13295.457894] sd 3:0:0:0: [sdf] Add. Sense: Recorded entity not found
kernel: [13295.457905] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 80 00 00 00 01 00
kernel: [13295.478851] sd 3:0:0:0: [sdf] Unhandled sense code
kernel: [13295.478862] sd 3:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [13295.478872] sd 3:0:0:0: [sdf] Sense Key : Medium Error [current]
kernel: [13295.478883] sd 3:0:0:0: [sdf] Add. Sense: Recorded entity not found
kernel: [13295.478895] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 80 00 00 00 01 00
kernel: [13295.520833] sd 3:0:0:0: [sdf] Unhandled error code
kernel: [13295.520844] sd 3:0:0:0: [sdf] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
kernel: [13295.520854] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 7f ff 00 00 01 00
kernel: [13295.564306] sd 3:0:0:0: [sdf] Unhandled sense code
kernel: [13295.564317] sd 3:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [13295.564326] sd 3:0:0:0: [sdf] Sense Key : Medium Error [current]
kernel: [13295.564337] sd 3:0:0:0: [sdf] Add. Sense: Recorded entity not found
kernel: [13295.564349] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 80 00 00 00 01 00
kernel: [13295.584833] sd 3:0:0:0: [sdf] Unhandled sense code
kernel: [13295.584844] sd 3:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
kernel: [13295.584854] sd 3:0:0:0: [sdf] Sense Key : Medium Error [current]
kernel: [13295.584864] sd 3:0:0:0: [sdf] Add. Sense: Recorded entity not found
kernel: [13295.584876] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 80 00 00 00 01 00
kernel: [13295.627815] sd 3:0:0:0: [sdf] Unhandled error code
kernel: [13295.627826] sd 3:0:0:0: [sdf] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
kernel: [13295.627835] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 7f ff 00 00 01 00
kernel: [13296.055720] sd 3:0:0:0: [sdf] Unhandled error code
kernel: [13296.055731] sd 3:0:0:0: [sdf] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
kernel: [13296.055741] sd 3:0:0:0: [sdf] CDB: Read(10): 28 00 00 ed 7f ff 00 00 01 00
kernel: [13296.121716] sd 3:0:0:0: [sdf] Unhandled error code
etc etc.

Revision history for this message
clubsoda (clubsoda) wrote :
Revision history for this message
clubsoda (clubsoda) wrote :
Revision history for this message
clubsoda (clubsoda) wrote :
Revision history for this message
clubsoda (clubsoda) wrote :

Master Boot Record, first 10 sectors in human-readable form.

Revision history for this message
clubsoda (clubsoda) wrote :

Minor differences appear when compared using the meld utility.

meld sdb-fdisk.xxd.txt sdb-Marantz.xxd.txt

Revision history for this message
clubsoda (clubsoda) wrote :

VFAT header, first 10 sectors in human-readable form.

Revision history for this message
clubsoda (clubsoda) wrote :

To see differences,
meld sdb1-mkdosfs.xxd.txt sdb1-Marantz.xxd.txt

Revision history for this message
Jeroen Oortwijn (idefix) wrote :

There is a firmware update for this device, which might fix this bug:
http://www.d-mpro.com/users/folder.asp?FolderID=4405&Tab=FAQ

See point 2 of the firmware changelog:

PMD661 v.1.17 Firmware Details:
1.When unit is restored after abnormal termination, data's chunk might not be correct.
2.Malfunction might occur when using an SD card that is formatted by PMD661 in other equipment.

Revision history for this message
clubsoda (clubsoda) wrote :

Thanks for the suggestion, but this bug was based on the latest version of the PMD661 firmware, which is still current. I should have mentioned the firmware version above, A1.17.

[About the notes accompanying the firmware release, I don't think Marantz is claiming those issues are fixed, merely that they are aware of the problems. Hopefully that means they might be fixed in a future release, however I doubt that Marantz has much control over the low-level formatting of flash cards. More than likely those particulars are determined by whichever licensed SDK was used to build the firmware.]

Smaller cards (1GB, 2GB) formatted in the same recorder do automount under linux, so this possibly applies only to SDHC cards.

The 8GB SDHC card does automount in Win98SE though, using NUSB (Maximus Decim's generic USB driver) which dates back a few years now. For that reason I believe this can be called a linux bug.

Revision history for this message
Jeroen Oortwijn (idefix) wrote :

The problem is that your Marantz audio recorder is writing an incorrect value to the FSINFO signature of the FAT filesystem (the vfat driver also tells you that: "Invalid FSINFO signature: 0x41645252, 0x61417272 (sector = 1)".)

The correct FSINFO signature should be: 0x41615252, 0x61417272

I suspect that smaller cards work because they are formatted as FAT (which doesn't have a FSINFO signature), while SDHC cards are formatted as FAT32.

So the best fix would be for Marantz to update their firmware to write the correct FSINFO signature. But if the card does automount in Windows as you said, I doubt they would have any motivation to do that. Could you test if the SDHC card (formatted in the audio recorder) is correctly recognised by a recent Windows version (XP+) when using a standard card reader (not the Marantz) and the standard Windows USB drivers?

The next best fix would therefore be to add a check for this incorrect FSINFO signature to the vfat superblock module of the libblkid library. But I'm not sure if the util-linux-ng maintainers will accept this 'hack'.

Revision history for this message
clubsoda (clubsoda) wrote :

Thanks Idefix, you're absolutely right.

I tried the WinXP test you suggested and it was successful, i.e. Windows recognises Marantz formatting even with the incorrect FSINFO, so Windows is more tolerant than linux in that regard.

Then I hacked the FSINFO back to the standard value using hexeditor. Linux automount started working and the Marantz recorder was not adversely affected, still being able to read and write the card with no problems.

It's tempting to say "WinXP works, linux doesn't, therefore linux has a bug", but why has Marantz introduced this new FSINFO identifier? It's not just Marantz either. Apparently the Edirol R-09HR audio recorder does the same thing. See here:-
http://taperssection.com/index.php?topic=109564.300
In that case the user fixed the broken identifier with `fsck.vfat -a`.

Perhaps there's a bug in the SDK those manufacturers are using, unless
<start evil conspiracy theory music>
it's a plot to thwart linux!
<stop music>

It would also be interesting to know why the Marantz doesn't like the way mkdosfs formats the partition, but I think I'll sign off now, before the music starts again. :)

Cheers.

Revision history for this message
Jeroen Oortwijn (idefix) wrote :

Thanks for performing the test. It confirmed what I was suspecting: Windows doesn't look at those signatures at all.

I therefore submitted the 'hack' upstream and it got accepted (see: http://git.kernel.org/?p=utils/util-linux-ng/util-linux-ng.git;a=commitdiff;h=01802c2e6df94aa14609d5628b276bad6bb09968 ). If/when Ubuntu will incorporate this fix, I don't know.

Regarding your mkdosfs-problem: I think that the Marantz doesn't like it when the card contains a partition-table (which you created with fdisk). What happens when you format the raw device with mkdosfs? (To be on the safe side, I've always let my devices format the cards.)

Changed in util-linux (Ubuntu):
assignee: nobody → Idefix (ksjfla83hjdk392kde)
status: New → Fix Committed
Revision history for this message
clubsoda (clubsoda) wrote :

Idefix, you're a champion!

Thanks so much for following through on this. I wasn't going to push any further because it's a bit like a game of "Simon Says" in which the proprietary players can easily come up with more and more ridiculous ways to break compatibility. :)

I tried your suggestion of mkdosfs without a partition table (requires mkdosfs -I) but the Marantz complains "Unformat". Formatting in the device is certainly the low-risk approach. For the moment I'm fixing with `dosfsck -a` but your patch will surely arrive soon.

Thanks also to Karel Zak.

Regards.

Revision history for this message
Jeroen Oortwijn (idefix) wrote :

It took a while, but Ubuntu 11.10 should have incorporated this fix.

Changed in util-linux (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
clubsoda (clubsoda) wrote :

Confirmed fixed in 3.0.0-13-generic (Xubuntu Oneiric).

Still getting all the same error messages but the good news is that the drive now mounts automatically.

With Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.