gatorback
Senior Member
RTAC68U Firmware Version:384.7_2
It was 2AM and I had no business doing anything that late at night. I tried to mv a file and ended up mv-ing it to /jffs/bin instead of /jffs/bin/myfile. I am in shock that I did this.
To be clear: I no longer have access to to the files in what was the /jffs/bin directory. / jffs/bin is now a text file . I am concerned that if this router loses power, it will be bricked. What can be done to recover the files? I am pretty sure they are still there as I have not overwritten that area of memory (jffs).
The offending command is
Commands prior /after the offending instruction;
Command shows that /jffs/bin now a text file (yikes!)
It was 2AM and I had no business doing anything that late at night. I tried to mv a file and ended up mv-ing it to /jffs/bin instead of /jffs/bin/myfile. I am in shock that I did this.
To be clear: I no longer have access to to the files in what was the /jffs/bin directory. / jffs/bin is now a text file . I am concerned that if this router loses power, it will be bricked. What can be done to recover the files? I am pretty sure they are still there as I have not overwritten that area of memory (jffs).
The offending command is
Code:
mv loggerreset /jffs/bin
Commands prior /after the offending instruction;
Code:
bob@RT-AC68U-4C09:/jffs# vi loggerreset
bob@RT-AC68U-4C09:/jffs# chmod +x logger reset
chmod: logger: No such file or directory
chmod: reset: No such file or directory
bob@RT-AC68U-4C09:/jffs# chmod +x loggerreset
bob@RT-AC68U-4C09:/jffs# loggerreset
-sh: loggerreset: not found
bob@RT-AC68U-4C09:/jffs# mv loggerreset /jffs/bin/
mv: can't rename 'loggerreset': Not a directory
bob@RT-AC68U-4C09:/jffs# mv loggerreset /jffs/bin
bob@RT-AC68U-4C09:/jffs# which loggerreset
bob@RT-AC68U-4C09:/jffs# loggerreset
-sh: loggerreset: not found
bob@RT-AC68U-4C09:/jffs# which loggerreset
bob@RT-AC68U-4C09:/jffs# ls /jffs/bin
/jffs/bin
bob@RT-AC68U-4C09:/jffs# ls -l /jffs/bin
-rwxrwxrwx 1 bob root 554 Nov 30 01:24 /jffs/bin
/
Command shows that /jffs/bin now a text file (yikes!)
Code:
bob@RT-AC68U-4C09:/jffs# cat /jffs/bin
#!/bin/zsh
echo "Checking for running mqtt_logger.sh and mosquitto_sub processes:"
pgrep -f "mqtt_logger.sh|mosquitto_sub"
echo " "
echo "Killing the processes:"
pgrep -f "mqtt_logger.sh|mosquitto_sub" | xargs kill
echo "Verifying processes are terminated:"
pgrep -f "mqtt_logger.sh|mosquitto_sub"
echo "Running mqttcheck:"
mqttcheck
echo " "
read -q "?Press any key to proceed with starting mqtt_logger.sh..."
echo " "
echo "Starting mqtt_logger.sh in the background:"
sh /jffs/scripts/mqtt_logger.sh &
echo "Running final mqttcheck:"
mqttcheck
Last edited:
