rm -rf 删除文件失败

TF卡为ext2,用脚本不断向TF卡中追加式的写文件。每个文件5M,写满400个文件之后删除。重复此操作

1)  单纯写TF卡的读写操作,写2次TF卡正常

2)  写了2次之后重启设备,再继续写,写到第444的时候出错,test_ucsrunlog_44.log文件不能进行读写,test_ucsrunlog_45.log、test_ucsrunlog_46.log都不能读写,但是其他文件读写正常。此时磁盘占用情况/dev/mmcblk0     29G 1.6G   26G   6% /tmp/config_sd

./sdtest_new.sh: line 159:test_ucsrunlog_44.log: Input/output error           

ls: cannot access test_ucsrunlog_44.log:Input/output error  

sh-4.3# rm -rf/tmp/config_sd/log/ucsrunlog/test/                              

rm: cannot remove'/tmp/config_sd/log/ucsrunlog/test/test_ucsrunlog_44.log': Inp

ut/output error  


dmesg有错误

[ 853.383451] EXT2-fs (mmcblk0): error: ext2_lookup: deleted inodereferenced: 32814

ls -l看不到文件信息,之后echo $?为1

sh-4.3# ls -l /tmp/config_sd/log/ucsrunlog/test/                                
ls: cannot access /tmp/config_sd/log/ucsrunlog/test/test_ucsrunlog_44.log: Input
/output error                                                                   
ls: cannot access /tmp/config_sd/log/ucsrunlog/test/test_ucsrunlog_45.log: Input
/output error                                                                   
ls: cannot access /tmp/config_sd/log/ucsrunlog/test/test_ucsrunlog_46.log: Input
/output error                                                                   
total 0                                                                         
-????????? ? ? ? ?            ? test_ucsrunlog_44.log                           
-????????? ? ? ? ?            ? test_ucsrunlog_45.log                           
-????????? ? ? ? ?            ? test_ucsrunlog_46.log                           
sh-4.3#    

sh-4.3# echo $?                                                                 
1                                                    


有人用ckfs解决了,但是我的系统不支持ckfs,目前问题还未解决






你可能感兴趣的:(linux学习)