Advertisement
Guest User

Windows UDF bug (draft)

a guest
Dec 26th, 2022
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | Fixit | 0 0
  1. Preface
  2.  
  3. It appears that a bug in the UDF (Universal Disk File system) driver of Windows sometimes prevents Blu-ray media from being fully written.
  4.  
  5. The file system Windows uses on Blu-ray disc recordable media is UDF 2.60. Files can be managed inside the file manager with the same workflow as on other external mass storage media like USB flash drives, solid state drives, and hard drives, with the only difference being some latency. This is called "packet writing" and Microsoft refers to it as the "live file system", and it was first implemented in Windows Vista.
  6.  
  7. Unfortunately, nothing alike appears to have been implemented on Linux so far. Linux can read UDF, and write UDF 1.02 in authored sessions, but not UDF 1.50 or higher with a flash drive-like workflow that uses packet writing where changes are incrementally committed to disc immediately.
  8.  
  9. The issue
  10. If the writing process is interrupted abruptly, which might happen due to a system crash or the UDF driver occasionally freezing for unknown reasons, the file system (UDF) becomes corrupted and is not writeable until CHKDSK repairs it. Existing files are readable, but no new files can be added unless the file system is repaired.
  11.  
  12. Often, CHKDSK performs a successful repair in half a minute. But sometimes, CHKDSK fails to do so, meaning the disc is in a read-only state and no new data can be added. On write-once media (BD-R), this means that any unused space on the disc is wasted.
  13.  
  14. When CHKDSK fails to do so, it quits three seconds after launch and always reports the same two problematic block numbers 25312 and 25376, which CHKDSK refers to as "ICB" (information control blocks). 25376 is a block that is supposed to contain "mirror meta data". The fact that it is always these two numbers strongly hints to a bug in the Windows UDF driver.
  15.  
  16. According to IsoBuster, the metadata track on the BD-R occupies sectors 25600 to 549887, making it exactly 1 GiB (524288 sectors) long. In a HEX editor, it can be verified that the metadata track is not exhausted, since sectors 43695 to 524287 are only null bytes. On Blu-ray media, accessing an unwritten sector returns null-bytes instead of a "logical block address out of range" error like CDs and DVDs have.
  17.  
  18. Is there any way to make the unwritten space usesble again? Perhaps, could the more recent ICBs (information control blocks) be discarded?
  19.  
  20. It is time to reclaim the wasted dozens of gigabytes of space.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement