2024 Autor: Peter John Melton | [email protected]. Zuletzt bearbeitet: 2023-12-16 04:41
Die heutige Question & Answer-Sitzung wird von SuperUser zur Verfügung gestellt - einer Unterteilung von Stack Exchange, einer Community-basierten Gruppierung von Q & A-Websites.
Die Frage
Der SuperBenutzer-Leser, der gerade einen Blackbreaker hat, möchte wissen, warum bei einem Ordner auf der SD-Karte seines Telefons ein so großer Unterschied zwischen "Größe" und "Größe auf Festplatte" besteht:
As you can see below, there is so much difference between the ‘Size’ and ‘Size on disk’ fields for this folder. Why is that?
BTW, this folder is on my Android phone’s SD card. Inside this, my maps app stores its cached maps, and the app gets its maps from Google Maps.
Wenn Sie sich den Screenshot ansehen, besteht definitiv eine große Diskrepanz zwischen "Größe" und "Größe auf Festplatte". Was ist also hier passiert, um dies zu verursachen?
Die Antwort
SuperUser-Mitwirkender Bob hat die Antwort für uns:
I will be assuming that you are using the FAT/FAT32 file system here, since you mention this is an SD card. NTFS and exFAT behave similarly with regards to allocation units. Other file systems might be different, but they aren’t supported on Windows anyway.
If you have a lot of small files, this is certainly possible. Consider this:
- 50,000 files
- 32 KB cluster size (allocation units), which is the max for FAT32
Ok, now the minimum space taken is 50,000 * 32,000 = 1.6 GB (using SI prefixes, not binary, to simplify the maths). The space each file takes on the disk is always a multiple of the allocation unit size – and here we’re assuming each file is actually small enough to fit within a single unit, with some (wasted) space left over.
If each file averaged 2 KB, you’d get about 100 MB total – but you’re also wasting 15x that (30 KB per file) on average due to the allocation unit size.
In-Depth Explanation
Why does this happen? Well, the FAT32 file system needs to keep track of where each file is stored. If it were to keep a list of every single byte, the table (like an address book) would grow at the same speed as the data – and waste a lot of space. So what they do is use “allocation units”, also known as the “cluster size”. The volume is divided into these allocation units, and as far as the file system is concerned, they cannot be subdivided – those are the smallest blocks it can address. Much like you have a house number, but your postman doesn’t care how many bedrooms you have or who lives in them.
So what happens if you have a very small file? Well, the file system doesn’t care if the file is 0 KB, 2 KB, or even 15 KB, it’ll give it the least space it can – in the example above, that’s 32 KB. Your file is only using a small amount of this space, and the rest is basically wasted, but still belongs to the file – much like a bedroom you leave unoccupied.
Why are there different allocation unit sizes? Well, it becomes a trade-off between having a bigger table (address book, e.g. saying John owns a house at 123 Fake Street, 124 Fake Street, 666 Satan Lane, etc.), or more wasted space in each unit (house). If you have larger files, it makes more sense to use larger allocation units – because a file doesn’t get a new unit (house) until all others are filled up. If you have lots of small files, well, you’re going to have a big table (address book) anyway, so may as well give them small units (houses).
Large allocation units, as a general rule, will waste a lot of space if you have lots of small files. There usually isn’t a good reason to go above 4 KB for general use.
Fragmentation?
As for fragmentation, fragmentation shouldn’t waste space in this manner. Large files may be fragmented, i.e. split up, into multiple allocation units, but each unit should be filled before the next one is started. Defragging might save a little space in the allocation tables, but this isn’t your specific issue.
Possible Solutions
As gladiator2345 suggested, your only real options at this point are to live with it or reformat with smaller allocation units.
Your card might be formatted in FAT16, which has a smaller limit on table size and therefore requires much larger allocation units in order to address a larger volume (with an upper limit of 2 GB with 32 KB allocation units). Source courtesy of Braiam. If that is the case, you should be able to safely format as FAT32 anyway.
Haben Sie etwas zur Erklärung hinzuzufügen? Ton aus in den Kommentaren. Möchten Sie mehr Antworten von anderen technisch versierten Stack Exchange-Benutzern lesen? Hier geht es zum vollständigen Diskussionsthread.
Empfohlen:
Sieben kostengünstige Heimverbesserungen, die einen großen Unterschied machen
Die Renovierung eines Wohnraums kann sehr schnell sehr teuer werden, insbesondere wenn Sie eine ganze Küche oder ein Badezimmer umbauen. Es gibt jedoch eine Menge kostengünstiger Baumarktprojekte, die Sie selbst in Angriff nehmen können und die einen großen Unterschied machen.
Gibt es einen Unterschied zwischen den Suchergebnissen von Name Server und Domain Name?
Wenn Sie nach Informationen zu einer Website suchen, können Sie je nach Art der Suche unterschiedliche Datenmengen finden. Es kann auch sein, dass Sie sich fragen, ob dieselbe Art von Suche auch mehr als einen Namen enthält. In diesem Sinne hat der heutige SuperUser-Beitrag Antworten auf eine Frage des verwirrten Lesers.
Warum gibt es SSDs in ungewöhnlichen Größen?
SSDs scheinen heutzutage in einer Vielzahl von neuen Größen zu sein, aber warum ist das so? Der heutige Q & A-Beitrag von SuperUser enthält die Antworten auf die Frage eines neugierigen Lesers.
Warum gibt es Laptop-Bildschirme in solchen ungeraden Größen?
Haben Sie sich jemals gefragt, warum Laptop-Bildschirme in so ungeraden Größen erscheinen? Dann bist du nicht alleine! Der heutige Q & A-Posting-Beitrag von SuperUser untersucht die Gründe für die ungeraden Bildschirmgrößen, die beim Vergleichen von Laptops angezeigt werden.
Gibt es einen Unterschied zwischen den Kopfhörer- und Lautsprecheranschlüssen?
Ihr Computer verfügt über einen Lautsprecheranschluss (möglicherweise sogar mehrere) und einen Kopfhöreranschluss. Sie können Ihre Kopfhörer an beide anschließen, und Musikstücke werden ausgegeben. Was ist also der wirkliche Unterschied zwischen den beiden?