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 "volume_id.h"
31 struct minix_super_block
35 uint16_t s_imap_blocks;
36 uint16_t s_zmap_blocks;
37 uint16_t s_firstdatazone;
38 uint16_t s_log_zone_size;
43 } __attribute__((__packed__));
45 #define MINIX_SUPERBLOCK_OFFSET 0x400
47 int volume_id_probe_minix(struct volume_id *id, uint64_t off)
49 struct minix_super_block *ms;
51 dbg("probing at offset 0x%llx", (unsigned long long) off);
53 ms = (struct minix_super_block *) volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200);
57 if (le16_to_cpu(ms->s_magic) == 0x137f) {
58 strcpy(id->type_version, "1");
62 if (le16_to_cpu(ms->s_magic) == 0x1387) {
63 strcpy(id->type_version, "1");
67 if (le16_to_cpu(ms->s_magic) == 0x2468) {
68 strcpy(id->type_version, "2");
72 if (le16_to_cpu(ms->s_magic) == 0x2478) {
73 strcpy(id->type_version, "2");
80 volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);