Portál AbcLinuxu, 14. července 2025 06:52
omyl. swapspace ma mapu pouzitelnych bloku.
In the old style, the rest of this first page was a bit map, with a 1 bit for each
usable page of the swap area. Since the first page holds this bit map, the first
bit is 0. Also, the last 10 bytes hold the signature. So, if the page size is S,
an old style swap area can describe at most 8*(S-10)-1 pages used for swapping.
With S=4096 (as on i386), the useful area is at most 133890048 bytes (almost 128
MiB), and the rest is wasted. On an alpha and sparc64, with S=8192, the useful
area is at most 535560992 bytes (almost 512 MiB).
The old setup wastes most of this bitmap page, because zero bits denote bad blocks or blocks past the end of the swap space, and a simple integer suffices to indicate the size of the swap space, while the bad blocks, if any, can simply be listed. Nobody wants to use a swap space with hundreds of bad blocks. (I would not even use a swap space with 1 bad block.) In the new style swap area this is precisely what is done. The maximum useful size of a swap area now depends on the architecture. It is roughly 2GiB on i386, PPC, m68k, ARM, 1GiB on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on sparc64.
mkswap -c /dev/NECO
btw. nejsem si jisty, zda i -v1 ma mapu s badbloky jako -v0, ale za pokus to stoji, ale pokud je ten swapak pod 133890048 bajtu, tak bych tam dal rovnou -v0
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.