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"
29 struct minix_super_block
33 uint16_t s_imap_blocks;
34 uint16_t s_zmap_blocks;
35 uint16_t s_firstdatazone;
36 uint16_t s_log_zone_size;
43 #define MINIX_SUPERBLOCK_OFFSET 0x400
45 int volume_id_probe_minix(struct volume_id *id, uint64_t off)
47 struct minix_super_block *ms;
49 dbg("probing at offset 0x%llx", (unsigned long long) off);
51 ms = (struct minix_super_block *) volume_id_get_buffer(id, off + MINIX_SUPERBLOCK_OFFSET, 0x200);
55 if (le16_to_cpu(ms->s_magic) == 0x137f) {
56 strcpy(id->type_version, "1");
60 if (le16_to_cpu(ms->s_magic) == 0x1387) {
61 strcpy(id->type_version, "1");
65 if (le16_to_cpu(ms->s_magic) == 0x2468) {
66 strcpy(id->type_version, "2");
70 if (le16_to_cpu(ms->s_magic) == 0x2478) {
71 strcpy(id->type_version, "2");
78 volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);