/* vi:set cindent tabstop=2 shiftwidth=2: */ /* * libvxfs - library for reading Veritas Journaled FileSystem (VxFS) * Copyright (c) 1999 Martin Hinner * * uw_vtoc.h: UnixWare 2 and 7 vtoc * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id$ */ #ifndef __UW_VTOC_H #define __UW_VTOC_H #define VTOC_SECTOR 29 #define VTOC_DOSTYPE 0x63 /* UnixWare / SCO Unix / SysV / GNU HURD */ #define VTOC_BSIZE 512 #define V_NUMPAR 16 /* VTOC contains 16 partitions */ /* This structure comes from genhd.h, Copyright (C) 1992 Drew Eckhardt */ struct uw_dospt { __u8 code[0x1be]; /* MBR code */ struct part { __u8 boot_ind; /* 0x80 - active */ __u8 head; /* starting head */ __u8 sector; /* starting sector */ __u8 cyl; /* starting cylinder */ __u8 sys_ind; /* What partition type */ __u8 end_head; /* end head */ __u8 end_sector; /* end sector */ __u8 end_cyl; /* end cylinder */ __u32 start_sect; /* starting sector counting from 0 */ __u32 nr_sects; /* nr of sectors in partition */ } part[4]; __u16 magic; } __attribute__((packed)); struct uw_partition { __u16 tag; /* ID tag of partition */ __u16 flag; /* Permission flags */ __u32 start; /* Start sector of partition */ __u32 size; /* Number of blocks in parition */ }; struct uw_vtoc { __u32 sanity; /* to verify vtoc sanity */ __u32 version; /* layout version */ __u8 name[8]; /* volume name */ __u16 nparts; /* Number of partitions */ __u16 pad; /* 4 byte align */ __u32 reserved[10]; /* ?? */ struct uw_partition part[V_NUMPAR]; /* Partitions */ __u32 timestamp[V_NUMPAR]; /* Time stamp ? */ }; struct uw_disklabel { __u32 type; /* drive type */ __u32 magic; /* the magic number */ __u32 version; /* version number */ char serial[12]; /* serial number of the device */ __u32 ncylinders; /* # of data cylinders per device */ __u32 ntracks; /* # of tracks per cylinder */ __u32 nsectors; /* # of data sectors per track */ __u32 secsize; /* # of bytes per sector */ __u32 part_start; /* # of first sector of this partition */ __u32 unknown1[12]; /* ? */ __u32 alt_tbl; /* byte offset of alternate table */ __u32 alt_len; /* byte length of alternate table */ __u32 phys_cyl; /* # of physical cylinders per device */ __u32 phys_trk; /* # of physical tracks per cylinder */ __u32 phys_sec; /* # of physical sectors per track */ __u32 phys_bytes; /* # of physical bytes per sector */ __u32 unknown2; /* ? */ __u32 unknown3; /* ? */ __u32 pad[8]; /* pad */ struct uw_vtoc vtoc; }; #define VTOC_SANE 0x600DDEEEUL /* Indicates a sane VTOC */ #define UNIXWARE_DISKMAGIC 0xCA5E600DUL /* The disk magic number */ /* Partition identification tags */ #define V_UNUSED 0x00 /* Unused slice */ #define V_BOOT 0x01 /* Boot slice */ #define V_ROOT 0x02 /* Root filesystem */ #define V_SWAP 0x03 /* Swap filesystem */ #define V_USR 0x04 /* Usr filesystem */ #define V_BACKUP 0x05 /* Full disk */ #define V_ALTS 0x06 /* Alternate sector space */ #define V_OTHER 0x07 /* Non-unix space */ #define V_ALTTRK 0x08 /* Alternate track space */ #define V_STAND 0x09 /* Stand slice */ #define V_VAR 0x0A /* Var slice */ #define V_HOME 0x0B /* Home slice */ #define V_DUMP 0x0C /* Dump slice */ #define V_ALTSCTR 0x0D /* Alternate sector slice */ #define V_MANAGED_1 0x0E /* Volume management public slice */ #define V_MANAGED_2 0x0F /* Volume management private slice */ /* Partition permission flags */ #define V_UNMNT 0x0001 /* Unmountable partition */ #define V_RONLY 0x0010 /* Read only */ #define V_REMAP 0x0020 /* Do alternate sector mapping */ #define V_OPEN 0x0100 /* Partition open (for driver use) */ #define V_VALID 0x0200 /* Partition is valid to use */ #endif /* __UW_VTOC_H */