source: grub-pc/trunk/fuentes/include/grub/lvm.h @ 22

Last change on this file since 22 was 22, checked in by mabarracus, 4 years ago

updated version and apply net.ifnames=0 into debian/rules

File size: 2.9 KB
Line 
1/* lvm.h - On disk structures for LVM. */
2/*
3 *  GRUB  --  GRand Unified Bootloader
4 *  Copyright (C) 2006,2007  Free Software Foundation, Inc.
5 *
6 *  GRUB is free software: you can redistribute it and/or modify
7 *  it under the terms of the GNU General Public License as published by
8 *  the Free Software Foundation, either version 3 of the License, or
9 *  (at your option) any later version.
10 *
11 *  GRUB is distributed in the hope that it will be useful,
12 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *  GNU General Public License for more details.
15 *
16 *  You should have received a copy of the GNU General Public License
17 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef GRUB_LVM_H
21#define GRUB_LVM_H      1
22
23#include <grub/types.h>
24#include <grub/diskfilter.h>
25
26/* Length of ID string, excluding terminating zero. */
27#define GRUB_LVM_ID_STRLEN 38
28
29#define GRUB_LVM_LABEL_SIZE GRUB_DISK_SECTOR_SIZE
30#define GRUB_LVM_LABEL_SCAN_SECTORS 4L
31
32#define GRUB_LVM_LABEL_ID "LABELONE"
33#define GRUB_LVM_LVM2_LABEL "LVM2 001"
34
35#define GRUB_LVM_ID_LEN 32
36
37/* On disk - 32 bytes */
38struct grub_lvm_label_header {
39  grub_int8_t id[8];            /* LABELONE */
40  grub_uint64_t sector_xl;      /* Sector number of this label */
41  grub_uint32_t crc_xl;         /* From next field to end of sector */
42  grub_uint32_t offset_xl;      /* Offset from start of struct to contents */
43  grub_int8_t type[8];          /* LVM2 001 */
44} GRUB_PACKED;
45
46/* On disk */
47struct grub_lvm_disk_locn {
48  grub_uint64_t offset;         /* Offset in bytes to start sector */
49  grub_uint64_t size;           /* Bytes */
50} GRUB_PACKED;
51
52/* Fields with the suffix _xl should be xlate'd wherever they appear */
53/* On disk */
54struct grub_lvm_pv_header {
55  grub_int8_t pv_uuid[GRUB_LVM_ID_LEN];
56
57  /* This size can be overridden if PV belongs to a VG */
58  grub_uint64_t device_size_xl; /* Bytes */
59
60  /* NULL-terminated list of data areas followed by */
61  /* NULL-terminated list of metadata area headers */
62  struct grub_lvm_disk_locn disk_areas_xl[0];   /* Two lists */
63} GRUB_PACKED;
64
65#define GRUB_LVM_FMTT_MAGIC "\040\114\126\115\062\040\170\133\065\101\045\162\060\116\052\076"
66#define GRUB_LVM_FMTT_VERSION 1
67#define GRUB_LVM_MDA_HEADER_SIZE 512
68
69/* On disk */
70struct grub_lvm_raw_locn {
71  grub_uint64_t offset;         /* Offset in bytes to start sector */
72  grub_uint64_t size;           /* Bytes */
73  grub_uint32_t checksum;
74  grub_uint32_t filler;
75} GRUB_PACKED;
76
77/* On disk */
78/* Structure size limited to one sector */
79struct grub_lvm_mda_header {
80  grub_uint32_t checksum_xl;    /* Checksum of rest of mda_header */
81  grub_int8_t magic[16];        /* To aid scans for metadata */
82  grub_uint32_t version;
83  grub_uint64_t start;          /* Absolute start byte of mda_header */
84  grub_uint64_t size;           /* Size of metadata area */
85
86  struct grub_lvm_raw_locn raw_locns[0];        /* NULL-terminated list */
87} GRUB_PACKED;
88
89
90#endif /* ! GRUB_LVM_H */
Note: See TracBrowser for help on using the repository browser.