2 * volume_id - reads filesystem label and uuid
4 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation version 2 of the License.
26 #include "libvolume_id.h"
27 #include "libvolume_id-private.h"
30 struct oracleasm_super_block {
35 #define ASM_SB_OFF 0x20
36 #define ASM_MAGIC "ORCLDISK"
39 * Detect Oracle Automatic Storage Management (ASM).
40 * It can do mirroring, but don't consider it RAID in the sense
41 * that an ext3 filesystem could live inside. Thus, mark it 'other'.
42 * There also is a magic word 'ORCLCLRD'; like blkid(8), we ignore that.
44 int volume_id_probe_oracleasm(struct volume_id *id, uint64_t off, uint64_t size)
47 struct oracleasm_super_block *oracleasm;
49 info("probing at offset 0x%llx\n", (unsigned long long) off);
51 buf = volume_id_get_buffer(id, off + ASM_SB_OFF, 0x800);
55 oracleasm = (struct oracleasm_super_block *) buf;
57 if (memcmp(oracleasm->tag, ASM_MAGIC, 8) != 0)
60 volume_id_set_usage(id, VOLUME_ID_OTHER);
61 volume_id_set_label_raw(id, oracleasm->id, 24);
62 volume_id_set_label_string(id, oracleasm->id, 24);
63 id->type = "oracleasm";