Deep understanding of Centos file system

Source: Internet
Author: User
1. Why can the files in the rm-rf directory be recovered after being deleted? First, create an empty directory test. The blocksize of the directory is 4096 bytes. is it an empty directory or 4096? First, the directory size depends on the inode (access time, number of bytes of the file, uid and gid) of the file it contains. The size of 4096 is planned when the file system is created. You can use dumpe2fs to check whether the blocksize of the root partition is 4096 by default. we can create 1000 files in the new test directory.

1. Why can the files in the rm-rf directory be recovered after being deleted?

4. how to delete an object

1. when you delete a file descriptor (filedescriptor), you can see from the first question that the deleted file can be recovered after executing rm-rf *. that is to say, the file data can still be accessed, it is because datablocks, inodes, and inodes store metadata on disks.

2. to delete metadata (metadata), you can use> filename. the actual data in datablock remains in the disk.

3. to delete the real data (datablock), you need to generate some random number filling files and then delete the files.

The order is ddif =/dev/randomof = filename and then rm-rffilename

In this way, the real data will be deleted. The faster method is to use the device/dev/urandom. However, although there is no/dev/random randomness, it can be used to erase disk data.

Why is it better to use the/dev/random device than to use the/dev/zero device?

Both devices read previous data records (datatrace). using/dev/zero makes it easier to read previous data records (datatrace) than using/dev/random devices ).

 

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.