÷è÷ë²Ù×÷ϵͳÖеÄÊý¾Ý»Ö¸´¹¤¾ßÔõÑù×ÊÖúÄãÕÒ»ØɥʧµÄÎļþ£¿
÷è÷ë²Ù×÷ϵͳÖеÄÊý¾Ý»Ö¸´¹¤¾ßÔõÑù×ÊÖúÄãÕÒ»ØɥʧµÄÎļþ£¿
СÐò£º
ÔÚÒ»Ñùƽ³£Ê¹ÓõçÄÔµÄÀú³ÌÖУ¬ÎÒÃǾ³£»áÓöµ½Îóɾ³ýÎļþ¡¢´ÅÅÌË𻵡¢²¡¶¾Ñ¬È¾µÈÇéÐΣ¬µ¼ÖÂÖ÷ÒªÊý¾Ýɥʧ¡£÷è÷ë²Ù×÷ϵͳÌṩÁËÒ»¿îÇ¿Ê¢µÄÊý¾Ý»Ö¸´¹¤¾ß£¬¿ÉÒÔ×ÊÖúÓû§ÕÒ»ØɥʧµÄÎļþ¡£±¾ÎĽ«ÏÈÈݸù¤¾ßµÄʹÓÃÒªÁ죬²¢Ìṩ´úÂëʾÀý£¬×ÊÖú¶ÁÕßÏàʶÔõÑùÓ¦ÓÃËüÀ´»Ö¸´É¥Ê§µÄÎļþ¡£
Ò»¡¢÷è÷ë²Ù×÷ϵͳÖеÄÊý¾Ý»Ö¸´¹¤¾ß¸ÅÊö
÷è÷ë²Ù×÷ϵͳÖÐÌṩÁËÒ»¸öÃûΪ”extundelete”µÄÊý¾Ý»Ö¸´¹¤¾ß¡£Ëü¿ÉÒÔ×ÊÖúÓû§ÔÚÎļþϵͳÖлָ´Îóɾ³ýµÄÎļþ¡£”extundelete”»ùÓÚ»Ö¸´ÎļþϵͳÉÏÎóɾ³ýµÄÎļþÊôÐÔ£¬Í¨¹ýɨÃèÎļþϵͳÖеÄδʹÓÿռ䣬ÖØн¨ÉèÒÑɾ³ýÎļþµÄË÷Òý½ÚµãºÍÊý¾Ý¿é£¬´Ó¶øʵÏÖÎļþµÄ»Ö¸´¡£
¶þ¡¢Êý¾Ý»Ö¸´¹¤¾ßµÄʹÓÃÒªÁì
µã»÷ÏÂÔØ¡°àËÃûÌÃÊý¾Ý»Ö¸´¾Þ½³¡±£»
×°ÖÔextundelete”¹¤¾ß
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÔÚ÷è÷ë²Ù×÷ϵͳÖÐ×°ÖÔextundelete”¹¤¾ß¡£·¿ªÖնˣ¬Ö´ÐÐÒÔÏÂÏÂÁî×°Öãº
sudo apt-get install extundelete
Ö´ÐÐÊý¾Ý»Ö¸´
×°ÖÃÍê³Éºó£¬ÎÒÃÇ¿ÉÒÔÖ´ÐÐÒÔÏÂÏÂÁîÀ´Ö´ÐÐÊý¾Ý»Ö¸´²Ù×÷£º
sudo extundelete /dev/[×°±¸Ãû³Æ] –restore-all
ÆäÖУ¬[×°±¸Ãû³Æ]ÊÇÖ¸ÄãÏ£Íû»Ö¸´ÎļþµÄ×°±¸£¨ÀýÈ磬/dev/sda1£©¡£Ö´ÐÐÒÔÉÏÏÂÁîºó£¬”extundelete”½«É¨ÃèÖ¸¶¨×°±¸µÄδʹÓÿռ䣬²¢ÊµÑé»Ö¸´ËùÓÐÒÑɾ³ýµÄÎļþ¡£
»Ö¸´É¥Ê§µÄÎļþ
Ò»µ©É¨ÃèºÍ»Ö¸´²Ù×÷Íê³É£¬”extundelete”½«ÔÚÖ¸¶¨×°±¸µÄ¸ùĿ¼ÏÂÌìÉúÒ»¸öÃûΪ”RECOVERED_FILES”µÄÎļþ¼Ð¡£ÔÚ¸ÃÎļþ¼ÐÖУ¬Ä㽫ÕÒµ½ËùÓÐÀֳɻָ´µÄÎļþºÍÎļþ¼Ð¡£Äã¿ÉÒÔʹÓÃÏÂÁîÐлòÎļþÖÎÀíÆ÷À´»á¼ûºÍ¸´ÖÆÕâЩÎļþ¡£
Èý¡¢´úÂëʾÀý
ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄPython´úÂëʾÀý£¬ÑÝʾÔõÑùʹÓÔextundelete”¹¤¾ßÖ´ÐÐÊý¾Ý»Ö¸´²Ù×÷£º
import os import subprocess def recover_files(device_name): command = f"sudo extundelete {device_name} --restore-all" os.system(command) device_name = "/dev/sda1" # Ì滻ΪÄãµÄ×°±¸Ãû³Æ recover_files(device_name)
µÇ¼ºó¸´ÖÆ
ÒÔÉÏ´úÂëͨ¹ýŲÓÃϵͳÏÂÁîÀ´Ö´ÐÐÊý¾Ý»Ö¸´²Ù×÷¡£Äã¿ÉÒÔƾ֤×Ô¼ºµÄÐèÇ󣬽«ÆäǶÈëµ½ÄãµÄ´úÂëÖУ¬ÊµÏÖ×Ô¶¯»¯µÄÊý¾Ý»Ö¸´¡£
½áÓ
÷è÷ë²Ù×÷ϵͳÖеÄÊý¾Ý»Ö¸´¹¤¾ß”extundelete”ΪÓû§ÌṩÁËÒ»ÖÖÓÐÓõķ½·¨À´ÕÒ»ØÎóɾ³ýµÄÎļþ¡£Í¨¹ý¼òÆÓµÄ×°ÖúÍÖ´Ðа취£¬Óû§¿ÉÒÔÇáËɻָ´É¥Ê§µÄÊý¾Ý¡£ÎÞÂÛÊÇÎóɾÎļþ£¬ÕվɴÅÅÌË𻵣¬”extundelete”¶¼Äܹ»³ÉΪÄãÊý¾Ý»Ö¸´µÄµÃÁ¦ÖúÊÖ¡£Í¨¹ý±¾ÎÄÌṩµÄ´úÂëʾÀý£¬Ï£ÍûÄÜ×ÊÖú¶ÁÕ߸üºÃµØÃ÷È·ºÍÓ¦Óøù¤¾ß¡£
ÒÔÉϾÍÊÇ÷è÷ë²Ù×÷ϵͳÖеÄÊý¾Ý»Ö¸´¹¤¾ßÔõÑù×ÊÖúÄãÕÒ»ØɥʧµÄÎļþ£¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡