Linux mistakenly deleted file lessons, a fall into your wit

Source: Internet
Author: User

A few days ago in the end of the PHP project, the final project for one months, and finally add a clear cache function can be completed, but the tragedy is in the last send, wrote a clean cache of code, because the students in the learning phase, the code is not perfect, and has not been tested ( lesson one ), directly in the project execution, resulting in 30 of the written PHP files are all deleted by themselves, and no backup ( lesson two ).

Most hated is, after mistakenly deleted the file I also wrote something in this folder and also put Extundelete into this folder ( lesson three ), resulting in only a small number of files restored, mostly because the newly written data completely covered.


Lesson One : testing . in the process of writing functions, some dangerous functions must be tested and put into the project.


Lesson two : backing up . after one months of spare time to write code, in the next half-month to improve the function of the code process, unexpectedly did not do even one backup.


Lesson Three : mistakenly deleted can no longer write any data to the hard drive, after the data has been mistakenly deleted, the first thing to do is to unload the partition of the deleted data, if the data of the root partition is mistakenly deleted, you need to enter the system into single user mode, and the root partition is mounted in read-only mode. Since the file is deleted, only the sector pointer in the Inode node of the file is zeroed out, the actual file is also stored on disk, and if the disk continues to mount in read-write mode, the data blocks of these deleted files may be reassigned by the operating system. After these databases are overwritten with new data, the data is really lost and no one can afford to go back.


As a result, only a few parts of the file were recovered through Extundelete, a rare experience.




This article is from the "Shei" blog, make sure to keep this source http://kurol.blog.51cto.com/11433546/1927311

Linux mistakenly deleted file lessons, a fall into your wit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.