sed: can’t move ‘wifi.confl5tFtt’ to ‘wifi.conf’: Input/output error

  html5, question

On an embedded platform, sed command is used in the script to operate the files in the sdcard card, but the following error will occur:

sed: can't move 'wifi.confl5tFtt' to 'wifi.conf': Input/output error

The instruction is completely ok when tested on Ubuntu.

config_wifi_file() {
 key=$1
 value=$2
 sed -i "s/^[ |      ]*$key[ |    ]*=.*/$key=$value/
 #s/^[ |     ]*$key[ | ]*=[a-zA-Z0-9]*.[0-9]*.[0-9]*.[0-9]*/$key=$value/" "$FILENAME"
 }

It is also possible to copy files to the /tmp directory under the root file system. I do not know why. If you have friends who encounter similar problems, please advise.

Either the hard disk /SSD/SDCard is broken or NFS server is dead.