Go Down

Topic: How does one clear SDA1 (fat) errors Yun SD Card on Openwrt Boot?  (Read 4903 times) previous topic - next topic

WhidbeyBill

Apr 19, 2020, 09:20 pm Last Edit: Apr 22, 2020, 06:56 am by WhidbeyBill Reason: Possible solution. Comments welcome.
Problem: SDA1 set to read-only during boot.

Yun SDA1 partition is set to read-only if errors encountered during boot.
Thereafter, sketch cannot write to sda1 partition (/mnt/sda1/arduino/www/) because it is set to READ-ONLY

Modified /etc/rc.local/ to run script at end of boot. note also the ntpdate is installed in luci and runs to set time before exiting. Otherwise time setting seems problematic.
Code: [Select]

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

ntpdate 216.239.35.12

boot-complete-notify

/usr/sbin/fsck.fat -a /dev/sda1

block mount

exit 0


The fsck problem is described here and similar to this in OPENWRT forum :
https://www.mail-archive.com/openwrt-devel@lists.openwrt.org/msg48916.html
Openwrt Forum message states that "dosfsck" is not enabled in Openwrt.

And THIS: reported as a bug, without a solution as yet although a code revision seems available!
https://forum.openwrt.org/t/fsck-fat-executed-or-not/40730

Read-Only can be cleared if I let Windows scan the SD card in an adapter to clear the fragmenting or what ever error. Bu this little script above seems to solve issues until openwrt is fixed. I will likely add a function in sketches to do the same thing if the sda writes fail as they have been. Not tested there yet, but this works after a few unplugging random tries. :)

My Yun System LOG BEFORE:

Thu Apr  9 21:09:35 2020 daemon.err block: check_filesystem: /usr/sbin/dosfsck not found
Thu Apr  9 21:09:35 2020 daemon.err block: /dev/sda2 is already mounted on /overlay
Thu Apr  9 21:09:35 2020 kern.warn kernel: [   69.135333] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
Thu Apr  9 21:09:41 2020 kern.err kernel: [   75.248738] FAT-fs (sda1): error, fat_free_clusters: deleting FAT entry beyond EOF
Thu Apr  9 21:09:41 2020 kern.err kernel: [   75.251588] FAT-fs (sda1): Filesystem has been set read-only

SYSTEM LOG AFTER SCRIPT RUNS
Code: [Select]
Tue Apr 21 21:49:45 2020 daemon.notice procd: /etc/rc.d/S95done: 21 Apr 21:49:45 ntpdate[1548]: adjust time server 216.239.35.12 offset -0.000009 sec
Tue Apr 21 21:49:45 2020 daemon.notice procd: /etc/rc.d/S95done: CP437: No error information
Tue Apr 21 21:49:45 2020 daemon.notice procd: /etc/rc.d/S95done: fsck.fat 4.1 (2017-01-24)
Tue Apr 21 21:49:51 2020 daemon.notice procd: /etc/rc.d/S95done: 0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
Tue Apr 21 21:49:51 2020 daemon.notice procd: /etc/rc.d/S95done:  Automatically removing dirty bit.
Tue Apr 21 21:49:51 2020 daemon.notice procd: /etc/rc.d/S95done: Performing changes.
Tue Apr 21 21:49:51 2020 daemon.notice procd: /etc/rc.d/S95done: /dev/sda1: 9 files, 161/2044002 clusters
Tue Apr 21 21:49:52 2020 daemon.err block: /dev/mtdblock4 is already mounted on /rom
Tue Apr 21 21:49:52 2020 daemon.err block: /dev/mtdblock5 is already mounted on /mnt/mtdblock5
Tue Apr 21 21:49:52 2020 daemon.err block: /dev/sda1 is already mounted on /mnt/sda1
Tue Apr 21 21:49:52 2020 daemon.err block: /dev/sda2 is already mounted on /overlay
Tue Apr 21 21:49:53 2020 daemon.notice procd: /etc/rc.d/S96led: setting up led LAN-LED-On
Tue Apr 21 21:49:54 2020 daemon.notice procd: /etc/rc.d/S99internet-check-service: Start internet-check
Tue Apr 21 21:49:55 2020 daemon.notice procd: /etc/rc.d/S99usd: Start uSDaemon
Tue Apr 21 21:49:55 2020 daemon.info procd: - init complete -



ballscrewbob

Moved your topic to it's current location / section as it is more suitable.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.
It may not be the answer you were looking for but its the one I am giving based on either experience, educated guess, google (who would have thunk it ! ) or the fact that you gave nothing to go with in the first place so I used my wonky crystal ball.


Go Up