diff options
author | Olaf Hering <olh@suse.de> | 2006-09-29 04:59:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-29 12:18:09 -0400 |
commit | e1dfa92dcab72397ed1f85f7b8f98a9da43b3f7b (patch) | |
tree | 7995e41f84b1c0f4dbaf4bfdf50c3fa21bff1aef /fs | |
parent | 402749ea2538be9ddad981a990739b93a0178bc6 (diff) |
[PATCH] ignore partition table on disks with AIX label
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.
This is the content of the partition table:
# dd if=/dev/sdb count=$(( 4 * 16 )) bs=1 skip=$(( 0x1be )) | xxd
0000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000010: 80ff ffff 41ff ffff 1b11 0000 381b 0000 ....A.......8...
0000020: 00ff ffff 41ff ffff 0211 0000 1900 0000 ....A...........
0000030: 80ff ffff 41ff ffff 1b11 0000 381b 0000 ....A.......8...
Handle the whole disk as empty disk.
This fixes also YaST which 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
Tested on an IBM B50 with AIX V4.3.3.
Signed-off-by: Olaf Hering <olh@suse.de>
Cc: Albert Cahalan <acahalan@gmail.com>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/partitions/msdos.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 8f12587c3129..4f8df71e49d3 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c | |||
@@ -58,6 +58,31 @@ msdos_magic_present(unsigned char *p) | |||
58 | return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2); | 58 | return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2); |
59 | } | 59 | } |
60 | 60 | ||
61 | /* Value is EBCDIC 'IBMA' */ | ||
62 | #define AIX_LABEL_MAGIC1 0xC9 | ||
63 | #define AIX_LABEL_MAGIC2 0xC2 | ||
64 | #define AIX_LABEL_MAGIC3 0xD4 | ||
65 | #define AIX_LABEL_MAGIC4 0xC1 | ||
66 | static int aix_magic_present(unsigned char *p, struct block_device *bdev) | ||
67 | { | ||
68 | Sector sect; | ||
69 | unsigned char *d; | ||
70 | int ret = 0; | ||
71 | |||
72 | if (p[0] != AIX_LABEL_MAGIC1 && | ||
73 | p[1] != AIX_LABEL_MAGIC2 && | ||
74 | p[2] != AIX_LABEL_MAGIC3 && | ||
75 | p[3] != AIX_LABEL_MAGIC4) | ||
76 | return 0; | ||
77 | d = read_dev_sector(bdev, 7, §); | ||
78 | if (d) { | ||
79 | if (d[0] == '_' && d[1] == 'L' && d[2] == 'V' && d[3] == 'M') | ||
80 | ret = 1; | ||
81 | put_dev_sector(sect); | ||
82 | }; | ||
83 | return ret; | ||
84 | } | ||
85 | |||
61 | /* | 86 | /* |
62 | * Create devices for each logical partition in an extended partition. | 87 | * Create devices for each logical partition in an extended partition. |
63 | * The logical partitions form a linked list, with each entry being | 88 | * The logical partitions form a linked list, with each entry being |
@@ -393,6 +418,12 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
393 | return 0; | 418 | return 0; |
394 | } | 419 | } |
395 | 420 | ||
421 | if (aix_magic_present(data, bdev)) { | ||
422 | put_dev_sector(sect); | ||
423 | printk( " [AIX]"); | ||
424 | return 0; | ||
425 | } | ||
426 | |||
396 | /* | 427 | /* |
397 | * Now that the 55aa signature is present, this is probably | 428 | * Now that the 55aa signature is present, this is probably |
398 | * either the boot sector of a FAT filesystem or a DOS-type | 429 | * either the boot sector of a FAT filesystem or a DOS-type |