How to repair an UD...
 
Notifications
Clear all

How to repair an UDF file system on Blu-ray if CHKDSK is unable to fix it?

1 Posts
1 Users
0 Likes
285 Views
(@exerceo)
Posts: 12
Eminent Member
Topic starter
 

 

Preface

UDF (Universal Disk Format) is the file system predominantly used on optical discs. It appears that a bug in the UDF driver of Windows sometimes prevents Blu-ray media from being fully written.

The file system Windows uses on Blu-ray disc recordable media is UDF 2.60. Files can be managed inside the Windows file explorer 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". Microsoft refers to it as the "live file system", and it was first implemented in Windows Vista.

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.

The issue

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) is not writeable until CHKDSK repairs it. Existing files are readable, but no new files can be added unless the file system is repaired. The restriction might just be for safety and it would technically be possible to keep writing, since a FAT32 or exFAT file system detached unexpectedly is still writeable without running CHKDSK.

Often, CHKDSK performs a successful repair on UDF in half a minute. But sometimes, CHKDSK fails to do so, meaning the disc is locked into 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, since the disc can not be blanked to make the space useable again.

When CHKDSK fails to repair the file system, it quits three seconds after launch and reports the same two problematic block numbers 25312 and 25376 on multiple discs, which CHKDSK says are damaged. CHKDSK refers to those blocks as "ICB" (information control blocks). 25376 is a block that is supposed to contain "mirror meta data" according to CHKDSK. The fact that it always fails at these two numbers strongly hints to a bug in the Windows UDF driver.

According to IsoBuster, a forensic tool for Windows, the metadata track on the BD-R, which is track 2, 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.

It is time to reclaim the wasted dozens of gigabytes of space.

Is there any way to make the unwritten space usesble again? Is there some third-party tool that could do it, whether for Windows or Linux?

Perhaps, could the corrupt ICBs (information control blocks) and ICBs linking to them not simply be discarded? I'd imagine this causes some files to become unlisted, but that's all. Much preferable to all the unwritten space being wasted.

 

 
Posted : 26/12/2022 7:45 pm
Share:
Share to...