Bug 908742

Summary: sdxc card not able to read
Product: [openSUSE] openSUSE Distribution Reporter: Marc collin <marc.collin>
Component: BasesystemAssignee: Stanislav Brabec <sbrabec>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bwiedemann, gottfried.necker, maint-coord, marc.collin, nico.kruber, pgajdos, zawertun
Version: 13.2   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 13.2   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Marc collin 2014-12-07 20:45:24 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36
Build Identifier: 

my card reader who use RTS5229 chipset is not able to read sdxc card under linux

Reproducible: Always

Steps to Reproduce:
1.put a sdxc card in the card reader
2.
3.
Actual Results:  
000:00fb LEN=84 TC=0 HOPLIMIT=255 FLOWLBL=0 PROTO=UDP SPT=5353 DPT=5353 LEN=44 
[487522.891191] mmc0: card 5449 removed
[488918.362015] mmc0: cannot verify signal voltage switch
[488918.461027] mmc0: new ultra high speed SDR104 SDXC card at address 0007
[488918.461273] mmcblk0: mmc0:0007 SD64G 59.7 GiB 
[488918.461793]  mmcblk0: p1
[489003.696764]  mmcblk0: p1
[489217.331670] mmc0: card 0007 removed


Expected Results:  
be able to read card

/sbin/lspci -nnk|grep -A2 5229
02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader [10ec:5229] (rev 01)
        Subsystem: Lenovo Device [17aa:21fc]
        Kernel driver in use: rtsx_pci
Comment 1 Bernhard Wiedemann 2014-12-08 07:46:45 UTC
> mmcblk0: p1

looks as if it could read the partition table
to find out that that there is one partition on it.

please try as root
mount /dev/mmcblk0p1 /mnt
df -h /mnt

which should show something like 59G free disk space
Comment 2 Marc collin 2014-12-08 23:25:41 UTC
needed to do

mount -t exfat /dev/mmcblk0p1 /mnt

witout -t exfat nothing worked

i get

/dev/mmcblk0p1      60G    8,5G   52G  15% /mnt

with the df command.

so it's seem system is not able to detect file system correctly
Comment 3 Bernhard Wiedemann 2014-12-09 06:49:28 UTC
Please add a line with "exfat" to /etc/filesystems
and see if that helps.
I now remember that MicroSoft lobbied this new filesystem into the SDXC standard.

The alternative is to put some other filesystem (e.g. fat32) onto your card with
mkfs.vfat /dev/mmcblk0p1
but that might have side-effects for use in embedded devices.
Comment 4 Stanislav Brabec 2014-12-09 16:04:19 UTC
There is apparently no problem with reading SDXC.

This is a problem of exFAT file systems. openSUSE cannot legally distribute patent encumbered exFAT file system driver. You probably installed third party package. And this third party package did not initialize itself correctly.

To be able to auto mount exfat file system, one of following needs to be done:
- load the file system module on each boot
- add the file system name to /etc/filesystems (preferred)

It is questionable, whether exfat should be a part of /etc/filesystems by default, especially if it is not supported.
Comment 5 Marc collin 2014-12-11 03:00:02 UTC
(In reply to Stanislav Brabec from comment #4)
> There is apparently no problem with reading SDXC.
> 
> This is a problem of exFAT file systems. openSUSE cannot legally distribute
> patent encumbered exFAT file system driver. You probably installed third
> party package. And this third party package did not initialize itself
> correctly.
> 
> To be able to auto mount exfat file system, one of following needs to be
> done:
> - load the file system module on each boot
> - add the file system name to /etc/filesystems (preferred)
> 
> It is questionable, whether exfat should be a part of /etc/filesystems by
> default, especially if it is not supported.


in my 
/etc/filesystems i have

fat
hfs
minix
reiserfs
exfat
exfat_fuse

and my card is not detected automatically

so in console i still need to type: mount -t exfat /dev/mmcblk0p1 /mnt
anything else to detect this file system automatically
Comment 6 Bernhard Wiedemann 2014-12-11 13:18:04 UTC
Where/how did you get the exfat support?
Could you try moving the exfat entry to the top of the /etc/filesystems file
or drop the exfat_fuse one
something is strange there...
Comment 7 Marc collin 2014-12-12 02:01:47 UTC
(In reply to Bernhard Wiedemann from comment #6)
> Where/how did you get the exfat support?
> Could you try moving the exfat entry to the top of the /etc/filesystems file
> or drop the exfat_fuse one
> something is strange there...

get the exfat from

obs://build.opensuse.org/home:ZaWertun

i removed exfat_fuse from the file, changed nothin, don't know if it need to reboot...
Comment 8 Gottfried Necker 2015-01-07 21:09:47 UTC
I think this is a known bug in libblkid1.
You can read more about this in Ubuntu bug #1389021.
The original report is in:

https://github.com/karelzak/util-linux/issues/119
The fix is the following commit:
https://github.com/karelzak/util-linux/commit/98b539c25caede8534ffaf06e67a694eeb3bc6cb

I didn't test this yet, because I found this info just a few minutes ago.

Best regards
Comment 9 Stanislav Brabec 2015-01-09 21:06:27 UTC
Gottfried Necker, comment 8: Yes, it looks as a valid point.

It is a side effect of blkid aborting on first I/O error fix: http://www.spinics.net/lists/util-linux-ng/msg08976.html

It surely makes sense to backport it.

It will not bring exFAT support, but it will fix its detection.
Comment 10 Stanislav Brabec 2015-01-12 17:59:46 UTC
I just prepared testing packages:

Could anybody who encountered this problem test whether it will now detect exFAT properly?

Installation of libblkid1 should be sufficient.

Project:
https://build.opensuse.org/project/show/home:sbrabec:branches:OBS_Maintained:util-linux-%62%6e%63908742

Packages:
http://download.opensuse.org/repositories/home:/sbrabec:/branches:/OBS_Maintained:/util-linux-%62%6e%63908742/openSUSE_13.2_Update/
Comment 11 Stanislav Brabec 2015-01-13 13:48:48 UTC
My short text indicates that it should be a correct fix.

I installed upper mentioned fuse-exfat and exfat-utils.

Then I created test image:

dd if=/dev/null of=test.img bs=1024 seek=65536
mkexfatfs test.img 

Before:
blkid test.img 
(no output)

After:
blkid test.img 
test.img: UUID="1231-F346" TYPE="exfat" PTTYPE="dos"
Comment 13 Gottfried Necker 2015-01-13 20:04:54 UTC
I did a quick test using a exfat-formatted 64GB SDXC card. Without the patched libblkid1 I can only mount the filesystem when I specify the type using the -t option to mount. With patch it works without -t. I can still mount vfat-formatted cards without specifying the type. I've used the patched libblkid1 from comment #10.

At least for me: problem solved. Thanks.
Comment 15 Marc collin 2015-01-25 19:33:56 UTC
with the libblkid1 patched, i don't need to add -t to mount...
but kde don't mount automatically the file system... and in 
/etc/filesystems, i have exfat.
Comment 16 Nico Kruber 2015-01-27 09:41:25 UTC
*** Bug 914758 has been marked as a duplicate of this bug. ***
Comment 17 Nico Kruber 2015-01-30 11:40:11 UTC
Unfortunately, I saw this report too late and build my own package with the patch. The patch works perfectly as reported here.

I saw that there is a patchinfo present in the package from https://build.opensuse.org/project/show/home:sbrabec:branches:OBS_Maintained:util-linux-%62%6e%63908742 (thanks to Stanislav Brabec) but the current package seems to have some conflicts with its base package. Is this package going to be released as an official update?
Comment 18 Stanislav Brabec 2015-01-30 20:56:35 UTC
Thanks for the hint.

OBS request 281299 was declined:

The submit is broken because of a conflict in spec-file. Could you resolve the conflict and submit again please? Thanks.
Comment 21 Bernhard Wiedemann 2015-02-04 18:00:08 UTC
This is an autogenerated message for OBS integration:
This bug (908742) was mentioned in
https://build.opensuse.org/request/show/284100 Factory / util-linux
Comment 22 Bernhard Wiedemann 2015-02-04 20:00:11 UTC
This is an autogenerated message for OBS integration:
This bug (908742) was mentioned in
https://build.opensuse.org/request/show/284107 Factory / util-linux
Comment 23 Swamp Workflow Management 2015-02-12 14:05:13 UTC
SUSE-SU-2015:0270-1: An update that solves one vulnerability and has one errata is now available.

Category: security (moderate)
Bug References: 907434,908742
CVE References: CVE-2014-9114
Sources used:
SUSE Linux Enterprise Workstation Extension 12 (src):    util-linux-2.25-10.1
SUSE Linux Enterprise Software Development Kit 12 (src):    util-linux-2.25-10.1
SUSE Linux Enterprise Server 12 (src):    python-libmount-2.25-10.3, util-linux-2.25-10.1, util-linux-systemd-2.25-10.1
SUSE Linux Enterprise Desktop 12 (src):    python-libmount-2.25-10.3, util-linux-2.25-10.1, util-linux-systemd-2.25-10.1
Comment 24 Bernhard Wiedemann 2015-02-12 16:00:14 UTC
This is an autogenerated message for OBS integration:
This bug (908742) was mentioned in
https://build.opensuse.org/request/show/285827 Factory / util-linux
Comment 25 Bernhard Wiedemann 2015-02-12 17:00:19 UTC
This is an autogenerated message for OBS integration:
This bug (908742) was mentioned in
https://build.opensuse.org/request/show/285829 Factory / util-linux
Comment 26 Swamp Workflow Management 2015-02-19 17:07:00 UTC
openSUSE-RU-2015:0332-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 908742
CVE References: 
Sources used:
openSUSE 13.2 (src):    python-libmount-2.25.1-13.1, util-linux-2.25.1-13.1, util-linux-systemd-2.25.1-13.1
Comment 27 Stanislav Brabec 2015-02-20 14:03:34 UTC
Everything is finally done.