I successfully migrated a RavPower RP-WD03 to OpenWRT 18.06 using the instructions at https://openwrt.org/toh/ravpower/ravpower_rp-wd03. I have not figured out how to access the Genesys GL827L SD Card reader in the RP-WD03. I do not see anything in the System or Kernel logs during boot nor when I insert an SD card, suggesting that a driver is missing. So far, Internet searches have not revealed anything useful. Does anyone have suggestions on where I should look next?
@jeff, obvious after the fact (:-). I was seeing insertion of a USB drive but had not verified that it created a /dev/sdx device. I was missing kmod-usb-storage - once I installed it, I am now seeing the the SD card and USB drive devices. Next step is getting the SD card mounted.
I ended up not using extroot - I had several instances where the SD card became corrupted after a power cycle. It appears the power button on the RP-WD03 is not intercepted by OpenWRT, which may explain the issue. At the moment, I have enough flash space available.
I am noticing that when the sd-card is ejected, this is not detected by the OS, and the volume is kept mounted although the card is no longer in the device. I am not sure if that's my configuration or a bug....
@von-k, I see the same issue. I had not tested ejecting/inserting SD cards because I was planning to use the SD card with extroot.
According to dmesg, the SD card is detected properly during boot. Ejecting the SD card does not appear to be detected. If I try to access /dev/sda1, I get errors such as "No such file or directory while trying to open /dev/sda1", /dev/sda1 disappears, and dmesg shows "sda: detected capacity change from 1019215872 to 0". Re-inserting the SD card does nothing. It also appears that the SD card is only detected during the boot process - if I boot without the SD card and then insert it, it is not detected.
A USB flash drive that is ejected and re-inserted is properly handled. I noticed that re-inserting the USB drive caused the SD card to be detected. In the snippet below, the first line shows OpenWRT detecting that the SD card was ejected when I tried to access it. I re-inserted the SD card - no messages. The next lines shows the results of inserting the USB flash drive, followed by detection of the SD card.
[ 686.399580] sda: detected capacity change from 1019215872 to 0
[ 695.703325] usb 1-1.2: new high-speed USB device number 7 using ehci-platform
[ 695.761941] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ 695.785810] scsi host1: usb-storage 1-1.2:1.0
[ 696.181204] scsi 1:0:0:0: Direct-Access SanDisk Cruzer Fit 1.00 PQ: 0 ANSI: 6
[ 696.193179] sd 1:0:0:0: [sdb] 31260672 512-byte logical blocks: (16.0 GB/14.9 GiB)
[ 696.201854] sd 1:0:0:0: [sdb] Write Protect is off
[ 696.206764] sd 1:0:0:0: [sdb] Mode Sense: 43 00 00 00
[ 696.212936] sd 1:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 696.228205] sdb: sdb1
[ 696.237505] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[ 696.276307] sd 0:0:0:0: [sda] 1990656 512-byte logical blocks: (1.02 GB/972 MiB)
[ 696.287972] sda: sda1
I also played around with https://openwrt.org/docs/guide-user/base-system/hotplug_lede. I dumped the environment variables in /etc/hotplug.d/block/10-mount - I get lots of good stuff when I insert the USB flash drive, but nothing for the SD card. However, trying to access the ejected SD card does create a block event. I am still not clear what inserting the USB flash drive triggers which also causes the SD card to e recognised.
@badzz , thanks for looking into this. I created /etc/hotplug.d/block/00-media-change and pasted in the two lines. I booted OpenWRT without the card inserted. Inserting the card did not cause the file system to be detected. Also, /sys/block/sda/events_poll_msecs remained -1. I dumped the variables passed to block/00-media-change - both insert and eject showed the same data. It looks like $ACTION needs to be checked against "change".
Manually setting it to 2000 worked - inserting the card creates /dev/sda1 and ejecting it removes /dev/sda1.
If I mount /dev/sda1 and eject the SD card, it appears that the mounted filesystem prevents the removal of /dev/sda1. Attempting to list the file system on the SD card shows empty directories along with dmesg errors. However, inserting the SD card is now detected and I can access it (no need to remount it). I appreciate that popping out the SD card without first unmounting it is probably a 'bad thing'. I haven't tested switching to a different SD card.
I had not checked recently. It is strange that the event name changed.
There is not clean way to eject an SD card safely. You might loose data if you are writing on it actually.
I will update the PR and test it before.
@badzz, @von-k, the latest script works fine - added the semi-colon, rebooted, verified that /sys/block/sda/events_poll_msecs was set to 2000, and verified that eject/insert of SD card was properly detected.
I did not know that there had to be a new line or semi-colon before a closing curly bracket - normally, I put it on a line by itself for readability so I have not run into this issue. I created a script to test the second line in 00-media-change. Without the semi-colon, the script fails with syntax error: unexpected end of file (expecting "}") which I guess implies that the curly bracket was treated as part of the preceding command.
Yep when i ran the script, it gave me the error
My original script had a different syntax which got changed by a reviewer and the typo crept in...and I didn't test.
Sorry to have you use as beta tester.
Good to hear that it works now !
Hey all, late to the conversation here but I just flashed my RP-WD03 last night with the latest OpenWRT image available on the RP-WD03 wiki page. Wifi is fine but yea having issues mounting the SD card and USB drive. I installed all the packages that were recommended (opkg install kmod-usb-storage block-mount e2fsprogs kmod-fs-ext4) and see the packages in /dev and block info and block devices recognizes them as well. However, if I try to actually mount using block nothing seems to happen. Is there something else I need to do here?
@jplee3, do you see the SD card/USB drive added to /etc/config/fstab? The block command should update fstab but sets enabled to '0'. Below are the additional statements added to my fstab for the SD card. I manually mount the SD card so I left the configuration as is.
Thanks! So I ran both 'block info' and 'block detect' but nothing was added to /etc/config/fstab. I just added the output from 'block detect' (similar to yours but different uuid) to fstab and tried running 'block mount' again but it didn't mount anything.