How is a file written to a disk?

Source: Internet
Author: User

Recently, an abnormal FAT file system umount caused an exception in the mounting of the sdcard. It went to errors for processing and remount-ro.

<4>[ 7993.545483] c0 FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.<3>[ 7999.739501] c0 FAT-fs (mmcblk0p1): error, clusters badly computed (721 != 673)<3>[ 7999.739521] c0 FAT-fs (mmcblk0p1): Filesystem has been set read-only

We can see the Mount parameter "errors = remount-ro"

/dev/block/vold/179:33 /mnt/media_rw/sdcard0 vfat ro,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

Failed to mount. The error option will be processed in "kernel/fs/fat/Misc. C + 33.

The error detection is handled in "kernel/fs/fat/Misc. C + 158.

In "kernel/fs/fat/inode. C + 520", we can see the source of the warning. It should be that SBI has a problem.

----

The above is the background. Now I want to understand how to write data to a disk by opening a file and writing the file.

 

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.