1. 程式人生 > >rm -rf 刪除檔案失敗

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,目前問題還未解決