Don't store a full 4-kB page in .data for only 11 bytes total --- ./cmds/filesystem.c.bad 2023-03-25 19:41:39.000000000 +0100 +++ ./cmds/filesystem.c 2023-04-24 16:20:51.276359505 +0200 @@ -1463,25 +1463,16 @@ static int write_swap_signature(int fd, u32 page_count, const uuid_t uuid) { int ret; - static unsigned char swap[SZ_4K] = { - [0x400] = 0x01, - /* 0x404 .. 0x407 number of pages (little-endian) */ - /* 0x408 .. 0x40b number of bad pages (unused) */ - /* 0x40c .. 0x42b UUID */ - /* Last bytes of the page */ - [0xff6] = 'S', - [0xff7] = 'W', - [0xff8] = 'A', - [0xff9] = 'P', - [0xffa] = 'S', - [0xffb] = 'P', - [0xffc] = 'A', - [0xffd] = 'C', - [0xffe] = 'E', - [0xfff] = '2', - }; + static unsigned char swap[SZ_4K]; u32 *pages = (u32 *)&swap[0x404]; + swap[0x400] = 0x01; + /* 0x404 .. 0x407 number of pages (little-endian) */ + /* 0x408 .. 0x40b number of bad pages (unused) */ + /* 0x40c .. 0x42b UUID */ + /* Last bytes of the page */ + memcpy(&swap[0xff6], "SWAPSPACE2", 10); + *pages = cpu_to_le32(page_count); memcpy(&swap[0x40c], uuid, 16); ret = pwrite(fd, swap, SZ_4K, 0);