From: Olaf Hering <olh@suse.de>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] ignore partition table on disks with AIX label
Date: Wed, 17 May 2006 10:13:14 +0200 [thread overview]
Message-ID: <20060517081314.GA20415@suse.de> (raw)
The on-disk data structures from AIX are not known, also the filesystem
layout is not known. There is a msdos partition signature at the end of
the first block, and the kernel recognizes 3 small (and overlapping) partitions.
But they are not usable. Maybe the firmware uses it to find the bootloader
for AIX, but AIX boots also if the first block is cleared.
Handle the whole disk as empty disk.
This fixes also YaST who compares the output from parted (and formerly fdisk)
with /proc/partitions. fdisk recognizes the AIX label since a long time,
SuSE has a patch for parted to handle the disk label as unknown.
dmesg will look like this:
sda: [AIX] unknown partition table
Signed-off-by: Olaf Hering <olh@suse.de>
---
fs/partitions/msdos.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
Index: linux-2.6.16/fs/partitions/msdos.c
===================================================================
--- linux-2.6.16.orig/fs/partitions/msdos.c
+++ linux-2.6.16/fs/partitions/msdos.c
@@ -59,6 +59,19 @@ msdos_magic_present(unsigned char *p)
return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2);
}
+/* Value is EBCIDIC 'IBMA' */
+#define AIX_LABEL_MAGIC1 0xC9
+#define AIX_LABEL_MAGIC2 0xC2
+#define AIX_LABEL_MAGIC3 0xD4
+#define AIX_LABEL_MAGIC4 0xC1
+static int aix_magic_present(unsigned char *p)
+{
+ return (p[0] == AIX_LABEL_MAGIC1 &&
+ p[1] == AIX_LABEL_MAGIC2 &&
+ p[2] == AIX_LABEL_MAGIC3 &&
+ p[3] == AIX_LABEL_MAGIC4);
+}
+
/*
* Create devices for each logical partition in an extended partition.
* The logical partitions form a linked list, with each entry being
@@ -394,6 +407,12 @@ int msdos_partition(struct parsed_partit
return 0;
}
+ if (aix_magic_present(data)) {
+ put_dev_sector(sect);
+ printk( " [AIX]");
+ return 0;
+ }
+
/*
* Now that the 55aa signature is present, this is probably
* either the boot sector of a FAT filesystem or a DOS-type
next reply other threads:[~2006-05-17 8:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-17 8:13 Olaf Hering [this message]
2006-05-17 8:36 ` [PATCH] ignore partition table on disks with AIX label Andreas Mohr
2006-05-17 8:53 ` Valdis.Kletnieks
2006-05-17 9:10 ` Olaf Hering
2006-05-17 10:14 ` Valdis.Kletnieks
2006-05-17 18:37 ` Olaf Hering
2006-05-17 18:56 ` Alan Cox
2006-05-17 19:03 ` Olaf Hering
2006-05-17 19:44 ` Valdis.Kletnieks
2006-05-17 20:03 ` Valdis.Kletnieks
2006-05-17 13:04 ` Alan Cox
2006-05-17 12:57 ` Olaf Hering
2006-07-31 12:35 ` Olaf Hering
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060517081314.GA20415@suse.de \
--to=olh@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox