2 * volume_id - reads filesystem label and uuid
4 * Copyright (C) 2005 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"
30 struct minix_super_block
34 uint16_t s_imap_blocks;
35 uint16_t s_zmap_blocks;
36 uint16_t s_firstdatazone;
37 uint16_t s_log_zone_size;
44 #define MINIX_SUPERBLOCK_OFFSET 0x400
46 int volume_id_probe_minix(struct volume_id *id, uint64_t off)
48 struct minix_super_block *ms;
50 dbg("probing at offset 0x%llx", (unsigned long long) off);
52 ms = (struct minix_super_block *) volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200);
56 if (le16_to_cpu(ms->s_magic) == 0x137f) {
57 strcpy(id->type_version, "1");
61 if (le16_to_cpu(ms->s_magic) == 0x1387) {
62 strcpy(id->type_version, "1");
66 if (le16_to_cpu(ms->s_magic) == 0x2468) {
67 strcpy(id->type_version, "2");
71 if (le16_to_cpu(ms->s_magic) == 0x2478) {
72 strcpy(id->type_version, "2");
79 volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);