How many sectors or whole file rewritten?

Just a curiosity question here today. When I update tags, are only certain sectors updated or is the whole file rewritten? In other words, are the sectors for tags already allocated if not used, or is the file expanded? I really haven't researched the file structure yet.

id3v1 has fix lenth fields at the end of the file.
Update ist possible with simply rewrite that area of the file.

id3v2 ist typically on beginning of the file, containing fields and field lenth is variable.
id3v2 tag length is typically sum_of_fields + x. On small changes i is possible to rewrite just that area of the file but normally whole file is rewritten by most programs.
Specially if you add fields within (empty fields normally not written) tag length expanding so there is no other way than rewrite the file.

For details: https://id3.org/

1 Like

and / or the previously used padding is not big enough. If the part of the file is big enough then only the tag part is updated.
You cannot set the amount of padding written by MP3tag.

1 Like

Thanks guys for the comments. This leads me to expect that when I am finished with this round of tag updates which will affect most of around 70k tracks I will have fairly significant disc fragmentation that will need to be handled. I don't really like the regular defrag processes, so will likely just copy my whole library to a different reformatted disk, reformat my library disk, and then copy everything back.

Do we ever finish updating tag data? My wife uses Amazon Prime music and several FM stations, which might be far easier.

Why? You can run defragmentation and anything will be ok. Look for defrag paramters by typing defrag /?.
You can use /x to consolidate free space and move all files together.

Do you use an mechanical harddrive or ssd? On ssd fragmentation is not a problem. Btw: physical sectors are spreaded by harddisk algorithm to enhance ssd livetime.

Warning: DO NOT Defrag and ssd. SSD just need to be optimized / trim that can be done from drive context menu.

Btw: Any file that will be rewritten completely will not be fragmentet after writing.
(@ohrenkino: is there an mp3tag option to force? but I still think that's not neede anyway)

As I said:

and neither can you force MP3tag to rewrite the whole file while tagging.