SD-Cards not working (Suspected kernel-bug)

Device: NANO
Type: Bug
Status: Open

My WiFi Pineapple have had a problem with SD-cards since i purchased it.
I have tested SEVERAL different SD-cards, and several brands and sizes.
They all encounter the same bug.
I've also tested different file-systems, to no avail.
The SD-cards are working perfectly on other devices.

It seems like reading/writing to the SD-cards often triggers a bug within a kernel-module.
I found out that running a "badblocks" scan against the SD-card will trigger the bug every time.

Below is a output of dmesg after triggering the bug:
root@nano:~# badblocks -e 100 -v /dev/sdcard/sd1
Too many bad blocks, aborting test
done
Pass completed, 100 bad blocks found. (100/0/0 errors)

root@nano:~# dmesg|tail -n 33
[191722.800000] usb 1-1.2: USB disconnect, device number 11
[191722.810000] sd 2:0:0:0: [sdc]
[191722.810000] Result: hostbyte=0x01 driverbyte=0x00
[191722.810000] sd 2:0:0:0: [sdc] CDB:
[191722.820000] cdb[0]=0x28: 28 00 00 1e b5 60 00 00 f0 00
[191722.820000] blk_update_request: I/O error, dev sdc, sector 2012512
[191722.830000] sd 2:0:0:0: [sdc]
[191722.830000] Result: hostbyte=0x01 driverbyte=0x00
[191722.840000] sd 2:0:0:0: [sdc] CDB:
[191722.840000] cdb[0]=0x28: 28 00 00 1e b6 50 00 00 10 00
[191722.850000] blk_update_request: I/O error, dev sdc, sector 2012752
[191725.890000] usb 1-1.2: new high-speed USB device number 12 using ehci-platform
[191726.030000] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[191726.050000] scsi host3: usb-storage 1-1.2:1.0
[191727.050000] scsi 3:0:0:0: Direct-Access Generic STORAGE DEVICE 0933 PQ: 0 ANSI: 6
[191727.050000] sd 3:0:0:0: Attached scsi generic sg0 type 0
[191727.520000] sd 3:0:0:0: [sdd] 15187968 512-byte logical blocks: (7.77 GB/7.24 GiB)
[191727.530000] sd 3:0:0:0: [sdd] Write Protect is off
[191727.530000] sd 3:0:0:0: [sdd] Mode Sense: 21 00 00 00
[191727.540000] sd 3:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[191727.550000] sdd: sdd1 sdd2
[191727.560000] sd 3:0:0:0: [sdd] Attached SCSI removable disk
[191727.890000] buffer_io_error: 31 callbacks suppressed
[191727.890000] Buffer I/O error on dev sdc1, logical block 557056, lost sync page write
[191727.900000] JBD2: Error -5 detected when updating journal superblock for sdc1-8.
[191727.910000] Aborting journal on device sdc1-8.
[191727.910000] Buffer I/O error on dev sdc1, logical block 557056, lost sync page write
[191727.920000] JBD2: Error -5 detected when updating journal superblock for sdc1-8.
[191727.950000] EXT4-fs (sdd1): couldn't mount as ext3 due to feature incompatibilities
[191727.960000] EXT4-fs (sdd1): couldn't mount as ext2 due to feature incompatibilities
[191728.020000] EXT4-fs (sdd1): recovery complete
[191728.020000] EXT4-fs (sdd1): mounted filesystem with ordered data mode. Opts: (null)
[191728.300000] Adding 1004364k swap on /dev/sdcard/sd2. Priority:-4 extents:1 across:1004364k


Basically the SD-card interface disconnects from the host, and then a second later it re-appears with a new identifier each time the bug happens.
sda1-> sdb1 -> sdc1 -> sdd1

This has made the Nano useless for me when using a SD-card.
I've had to resort to removing the SD-card and mount a USB thumb-drive as /sd to get the Nano working.
I know of other people experiencing the same issue, where they also had to use a thumb-drive to get it working.

After a lot of Googling i found that people are experiencing a very similar issue on their Raspberry Pi B+.
The correlation is that they are running the same kernel-version (3.18.x)
This is why i believe the bug is related to a kernel-module that deals with the SD-card somehow.

Link to the Raspberry bug-report i found:
https://github.com/raspberrypi/linux/issues/777

Your truly,
Andreas Nilsen / Zylla
adde88@gmail.com / @adde88

Comments:

Adde88
2018/01/04 21:38
I updated my Nano to the latest version: 2.0.2, curious to see if this error had been fixed.
I did the same test to trigger the bug as i did above (using badblocks) and i'm sorry to say the bug is still there, and this is the output i get in dmesg:

[ 102.440000] usb 1-1.2: USB disconnect, device number 4
[ 102.450000] sd 0:0:0:0: [sda]
[ 102.450000] Result: hostbyte=0x01 driverbyte=0x00
[ 102.450000] sd 0:0:0:0: [sda] CDB:
[ 102.460000] cdb[0]=0x28: 28 00 00 1e ab 60 00 00 f0 00
[ 102.460000] blk_update_request: I/O error, dev sda, sector 2009952
[ 102.470000] sd 0:0:0:0: [sda]
[ 102.470000] Result: hostbyte=0x01 driverbyte=0x00
[ 102.480000] sd 0:0:0:0: [sda] CDB:
[ 102.480000] cdb[0]=0x28: 28 00 00 1e ac 50 00 00 10 00
[ 102.490000] blk_update_request: I/O error, dev sda, sector 2010192
[ 102.490000] Aborting journal on device sda1-8.
[ 102.500000] JBD2: Error -5 detected when updating journal superblock for sda1-8.
[ 102.520000] Buffer I/O error on dev sda1, logical block 153, async page read
[ 102.520000] Buffer I/O error on dev sda1, logical block 153, async page read
[ 102.540000] Buffer I/O error on dev sda1, logical block 153, async page read
[ 102.540000] Buffer I/O error on dev sda1, logical block 154, async page read
[ 102.560000] Buffer I/O error on dev sda1, logical block 154, async page read
[ 102.560000] Buffer I/O error on dev sda1, logical block 154, async page read
[ 102.580000] Buffer I/O error on dev sda1, logical block 154, async page read
[ 102.580000] Buffer I/O error on dev sda1, logical block 155, async page read
[ 102.610000] Buffer I/O error on dev sda1, logical block 155, async page read
[ 102.610000] Buffer I/O error on dev sda1, logical block 155, async page read
[ 104.880000] usb 1-1.2: new high-speed USB device number 5 using ehci-platform
[ 105.000000] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 105.020000] scsi host1: usb-storage 1-1.2:1.0
[ 106.020000] scsi 1:0:0:0: Direct-Access Generic STORAGE DEVICE 0933 PQ: 0 ANSI: 6
[ 106.020000] sd 1:0:0:0: Attached scsi generic sg0 type 0
[ 106.330000] sd 1:0:0:0: [sdb] 15187968 512-byte logical blocks: (7.77 GB/7.24 GiB)
[ 106.330000] sd 1:0:0:0: [sdb] Write Protect is off
[ 106.340000] sd 1:0:0:0: [sdb] Mode Sense: 21 00 00 00
[ 106.340000] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 106.360000] sdb: sdb1 sdb2
[ 106.370000] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[ 106.750000] EXT4-fs error (device sda1): ext4_put_super:797: Couldn't clean up the journal
[ 106.760000] EXT4-fs (sda1): Remounting filesystem read-only
[ 106.780000] EXT4-fs (sdb1): couldn't mount as ext3 due to feature incompatibilities
[ 106.790000] EXT4-fs (sdb1): couldn't mount as ext2 due to feature incompatibilities
[ 106.820000] EXT4-fs (sdb1): recovery complete
[ 106.830000] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[ 107.050000] Adding 1004364k swap on /dev/sdcard/sd2. Priority:-2 extents:1 across:1004364k
Adde88
2018/03/02 09:37
An update have been posted to the Github-issue regarding this problem on Raspberries with the same kernel-version.
It was posted by "Dreaky255" on 21.feb 2018. Link to issue:
https://github.com/raspberrypi/linux/issues/777

Quote of the new comment below:
"
Same issue for me, and solved.
It was a power issue : My raspberry and hard drive (2Tb) were both powered through an usb hub-powered (2.5A).
I had a DC power switch (jack) to the hub to easily power on and off my raspberry. The switch was actually too resistent to let pass enough power to the whole thing. It was working with a 1TB hard drive, but not with my brand new 2TB.
After deleting the switch and directly powering the hub with the DC adaptor, problem has disappeared.

Hope it helps some of you.

Sry for my poor english.
"

Could it be that the SD-card reader (Genesys) doesn't get enough power on some Pineapple Nano's, or if it's connected to a hub?
Since using my Realtek reader in the USB plug with a SD-card worked fine...
Sebkinne said he was unable to replicate this issue on several Nanos he have tried. But the problem seems to affect ALOT of users in reality.
Some users are even un-aware of this happening!

I'm trying to find some specification on the Genesys reader in question, to find out its power-requirements. But i haven't found anything to this date.
IF anyone can find specs. about it, please inform me.
As i would like to take my Nano under the scope, to check if it's getting enough juice to run stable.
Scooter22
2018/03/12 01:23
I can replicate this on my nano very easily. I'm trying to compile tmux from the sd card (the compiler toolchain is also on the sd card). Simply runinng configure hoses it up:

BusyBox v1.23.2 (2017-12-23 03:20:07 UTC) built-in shell (ash)

.NN,
.cxxdl' xMMO 'cdxxl'
.c0WMNk;,NMMW:,xXMMKo.
...:KMMMWMMMMWMMMXc... .
, .l0NMMMNXMMMMMMMMMMMMXNMMMWKl' xWd
,0Wd .':xNMMMMMMMMMMMMMMMMNkc'. ;KM0'
lWMo .;dNMMMMMMMMMMMMMMWx:. .l. dMWc
:WWo oNd .;xKWMMMMMMMMMMMMMMMMMMMMWXx:. dWX: dMW;
,NWo oMW: .. ..,lOXWMMMMMMMMMMWN0o;.. .. cWMl dMN'
.XMx oWN; lc .loooolcooclooool. cXl oMWc kMK.
oMW' ,WMl cMW: lWMW0d:;cdd:;:o0WMWl lMW: OMW' ,WMl
0M0 xMX. .XMd .lo:.,dXMMMMMMXd,.:ol. kMK. 'NMd KMO
NMd KMk lMN. .;:xOxollccddcclloxOx:;. 'WM: OM0 xMX
WMo .XMx dMK oNMMMMWOc;;ol;;cOWMMMMNo .XMl kMK dMN
NMx 0MO :Kd. .lllcl;.:0WMMMMW0:.;lclll. .xK; 0MO kMX
__ ___ ______ _ _____ _.:W0;,oxl:::oOOo:::lxo,;0W: _ .ONo KMk
\ \ / (_| ____(_) | __ (_);cKMMMMWk:.;,.;kWMMMMKc;. | | .OX:
\ \ /\ / / _| |__ _ | |__) _ _ __ ___ __ _ _ __ _ __ | | ___ NANO
\ \/ \/ / | | __| | | | ___| | '_ \ / _ \/ _` | '_ \| '_ \| |/ _ \ 2.0.2
\ /\ / | | | | | | | | | | | | __| (_| | |_) | |_) | | __/
\/ \/ |_|_| |_| |_| |_|_| |_|\___|\__,_| .__/| .__/|_|\___|.com
With OpenWrt CHAOS CALMER | | | |
|_| |_|
root@home:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 2.4M 976.0K 1.5M 39% /
/dev/root 12.3M 12.3M 0 100% /rom
tmpfs 29.8M 104.0K 29.7M 0% /tmp
/dev/mtdblock3 2.4M 976.0K 1.5M 39% /overlay
overlayfs:/overlay 2.4M 976.0K 1.5M 39% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sdcard/sd1 14.1G 117.2M 13.2G 1% /sd
root@home:~# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sdcard/sd1 on /sd type ext4 (rw,relatime,data=ordered)
root@home:~# cd /sd/download/tmux/
root@home:/sd/download/tmux# export PATH=/sd/usr/bin:$PATH
root@home:/sd/download/tmux# ./configure --build mips-openwrt-linux-uclibc --prefix=/sd/
checking for a BSD-compatible install... etc/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... etc/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking build system type... mips-openwrt-linux-uclibc
checking host system type... mips-openwrt-linux-uclibc
checking for gcc... gcc
checking whether the C compiler works... ./configure: line 3355: printf: write error: Read-only file system
./configure: line 3393: printf: write error: Read-only file system
no
./configure: line 3395: printf: write error: Read-only file system
sed: conftest.c: No such file or directory
./configure: line 3398: printf: write error: Read-only file system
configure: error: in `/sd/download/tmux':
./configure: line 413: printf: write error: Read-only file system
configure: error: C compiler cannot create executables
See `config.log' for more details
./configure: line 4: echo: write error: Read-only file system
./configure: line 8: printf: write error: Read-only file system
./configure: line 9: echo: write error: Read-only file system
./configure: line 40: echo: write error: Read-only file system
./configure: line 44: printf: write error: Read-only file system
./configure: line 45: echo: write error: Read-only file system
./configure: line 54: echo: write error: Read-only file system
./configure: line 82: printf: write error: Read-only file system
root@home:/sd/download/tmux# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 2.4M 976.0K 1.5M 39% /
/dev/root 12.3M 12.3M 0 100% /rom
tmpfs 29.8M 104.0K 29.7M 0% /tmp
/dev/mtdblock3 2.4M 976.0K 1.5M 39% /overlay
overlayfs:/overlay 2.4M 976.0K 1.5M 39% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/sdcard/sd1 14.1G 117.2M 13.2G 1% /sd
/dev/sdcard/sd1 14.1G 117.2M 13.2G 1% /sd
root@home:/sd/download/tmux# mount
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/sdcard/sd1 on /sd type ext4 (ro,relatime,data=ordered)
/dev/sdcard/sd1 on /sd type ext4 (rw,relatime,data=ordered)
root@home:/sd/download/tmux# fdisk -l

Disk /dev/mtdblock0: 0 MB, 131072 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock0 doesn't contain a valid partition table

Disk /dev/mtdblock1: 1 MB, 1155072 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock1 doesn't contain a valid partition table

Disk /dev/mtdblock2: 15 MB, 15425024 bytes
255 heads, 63 sectors/track, 1 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock2 doesn't contain a valid partition table

Disk /dev/mtdblock3: 2 MB, 2555904 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock3 doesn't contain a valid partition table

Disk /dev/mtdblock4: 0 MB, 65536 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock4 doesn't contain a valid partition table

Disk /dev/mtdblock5: 16 MB, 16580608 bytes
255 heads, 63 sectors/track, 2 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock5 doesn't contain a valid partition table

Disk /dev/sdb: 15.5 GB, 15502147584 bytes
255 heads, 63 sectors/track, 1884 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 1885 15134720 c Win95 FAT32 (LBA)
root@home:/sd/download/tmux#

Add Comment:

Please log in to comment.