[Bug 1831] Incorrect label/uuid may be returned for swap partitions
bugzilla at busybox.net
bugzilla at busybox.net
Wed Aug 11 22:22:07 UTC 2010
https://bugs.busybox.net/show_bug.cgi?id=1831
--- Comment #1 from Denys Vlasenko <vda.linux at googlemail.com> ---
Well, if image does contain both vfat and swapspace signatures,
volume_id_probe_all() inevitably will get confused. Why do you think swapspace
signature should get preference?
Isn't it admin's error to not clear swapspace before mkswap'ing it?
Let's see whether "standard" mkswap clears 1st page:
Here is 16 Mb image which was filled with 0a bytes and them "mkswap"ed by
util-linux-ng 2.17.2:
00000000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
*
00000400 01 00 00 00 ff 0f 00 00 00 00 00 00 d8 74 24 f8 |.............t$.|
00000410 41 56 47 d1 b3 59 97 fa e9 64 f6 33 00 00 00 00 |AVG..Y...d.3....|
00000420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000ff0 00 00 00 00 00 00 53 57 41 50 53 50 41 43 45 32 |......SWAPSPACE2|
00001000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
*
01000000
And the same test with busybox:
00000000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
*
00000400 01 00 00 00 ff 0f 00 00 00 00 00 00 32 43 bd 3d |............2C.=|
00000410 79 d5 49 51 af 45 d2 11 b6 6b dd f2 00 00 00 00 |y.IQ.E...k......|
00000420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000600 00 00 00 00 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
00000610 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
*
00000ff0 0a 0a 0a 0a 0a 0a 53 57 41 50 53 50 41 43 45 32 |......SWAPSPACE2|
00001000 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a |................|
*
01000000
That is, 1st page was not erased in both cases.
util-linux-ng 2.17.2 claims to erase it when it does not see any partition
tables and is not run in whole disk (that is, is it works on /dev/XdYNN, not on
/dev/XdY), or with -f flag.
We can add -f flag, but then many users will forget to use it...
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list