Red Hat Bugzilla – Bug 504417
file -s is not able to detect swap signature on ppc
Last modified: 2013-02-28 23:07:54 EST
Description of problem: file utility do not understant swap signature on PPC platform (or maybe the problem is 4k vs 64k page size) x86_64: # mkswap /dev/sdb Setting up swapspace version 1, size = 320072929 kB # file -s /dev/sdb /dev/sdb: Linux/i386 swap file (new style) 1 (4K pages) size 78142805 pages # rpm -q file file-4.17-15.el5_3.1.x86_64 ppc: # mkswap /dev/sdb Setting up swapspace version 1, size = 73407397 kB # file -s /dev/sdb /dev/sdb: data # rpm -q file file-4.17-15.el5_3.1.ppc file utility should probably detect swap on all supported platforms.
the ppc swap is vastly different than the i386/x86_64 one: we will need a new magic I created a ppc swapfile and will analyze this
Created attachment 364252 [details] swap file created by dd-ing /dev/zero and mkswap(8)ing afterwards an interesting thing: [root@ibm-js20-02 ~]# dd if=/dev/zero of=swap.ppc bs=4k count=16 16+0 records in 16+0 records out 65536 bytes (66 kB) copied, 0.000857522 seconds, 76.4 MB/s [root@ibm-js20-02 ~]# mkswap swap.ppc mkswap: error: swap area needs to be at least 655kB so I created a larger file. the signature is quite long way down in the file: [dnovotny@dhcp-0-118 file-testfiles]$ od -c swap.ppc 0000000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 * 0002000 \0 \0 \0 001 \0 \0 \0 \v \0 \0 \0 \0 \0 \0 \0 \0 0002020 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 * 0177760 \0 \0 \0 \0 \0 \0 S W A P S P A C E 2 0200000 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 * 3100000
Created attachment 365333 [details] a patch adding new magic
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
This request was erroneously denied for the current release of Red Hat Enterprise Linux. The error has been fixed and this request has been re-proposed for the current release.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: PPC swapspace signature is located at different offset than swapspace signature on different architectures. Consequence: File didn't recognize swap on PPC. Fix: New magic pattern has been added to detect swap on PPC. Result: File now identifies swapspace on PPC as "Linux/ppc swap file"
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0201.html