Failed to create file -- NTFS restriction? Linux Bug?

Source: Internet
Author: User
Failed to create file -- NTFS restriction? Linux Bug? -- Linux general technology-Linux technology and application information. For details, refer to the following section. When I recently write content to an NTFS partition in Linux, the file creation may fail from time to time. Restart the machine. The problem persists. I tried it and finally found that if I restarted the system and went to Windows, I would perform some simple operations on partitions that could not be created in Linux, and then go back to Linux, everything would be okay.

But looking at the above symptoms, it seems that the problem does not come from NTFS. So I conducted more experiments: After everything is normal, I first created several junk files in the NTFS partition, copy a large number of files from other locations to the partition. As expected, after copying 30 k more files, the file creation failure problem is reproduced. I deleted a junk file and created another file. OK. Delete two files and create two more files. OK. Delete three junk files and create four more files. unexpectedly, the fourth file fails to be created.

However, it should be noted that this problem may not be very common. Because now, I have written 500 k + files in the NTFS partition. When did the first problem occur? I don't remember it anymore. It should be something after N files.

Further, we can discuss the implementation of NTFS. Assume that NTFS stores the file information (inode) of all files in the partition between address A and address B on the disk. When there are too many files in A partition, the address space cannot contain all the file information. In this case, you need to expand the file information space. If the expansion fails, we cannot create a new file. It should be reasonable.

Therefore, in order to make the hard disk unable to create a file because the file information space is full, the operating system should lead to a link pointing to the next address range when detecting that the file information space is full, assume that the starting address range is C and the ending address is D. In this way, the file information space and file data space will grow synchronously, and the entire hard disk will be filled gradually.

Make a final conclusion: if the above assumption is true, the Windows system will probably handle the problem of file information space being full, and the processing process is not a function of the file system although it is oriented to the file system. Therefore, in Linux, if Linux does not solve this problem by itself, it is a Linux bug.

As we can see, when an error is reported in Linux, the operation can still be normal in windows.
Related Article

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.