1 /* partition.h - Partition table handling */
4 Copyright 1992-1998 Werner Almesberger.
5 Copyright 1999-2004 John Coffman.
8 Licensed under the terms contained in the file 'COPYING' in the
18 #include <linux/unistd.h>
20 typedef struct _change_rule {
24 struct _change_rule *next;
27 enum {PTW_OKAY=0, PTW_DOS=1, PTW_OS2=2, PTW_SWAP, PTW_XFS,
28 PTW_mask=7, PTW_NTFS=8};
31 #define LLSECTORSIZE ((long long)SECTOR_SIZE)
33 #if __GLIBC__ < 2 || __GLIBC_MINOR__ < 1
34 typedef long long lloff_t;
37 lloff_t lseek64(unsigned int fd, lloff_t offs, unsigned int whence);
42 unsigned char boot_ind; /* 0x80 - active */
43 unsigned char head; /* starting head */
44 unsigned char sector; /* starting sector */
45 unsigned char cyl; /* starting cylinder */
46 unsigned char sys_ind; /* What partition type */
47 unsigned char end_head; /* end head */
48 unsigned char end_sector; /* end sector */
49 unsigned char end_cyl; /* end cylinder */
50 unsigned int start_sect; /* starting sector counting from 0 */
51 unsigned int nr_sects; /* nr of sectors in partition */
55 int part_nowrite(char* device);
56 /* identify partitions which would be destroyed if the boot block
59 known problems occur for:
62 DOS FAT (relocation will fix)
65 #define is_extd_part(x) ((x)==PART_DOS_EXTD||(x)==PART_WIN_EXTD_LBA||(x)==PART_LINUX_EXTD)
67 void part_verify(int dev_nr,int type);
68 /* Verify the partition table of the disk of which dev_nr is a partition. May
69 also try to "fix" a partition table. Fail on non-Linux partitions if the
70 TYPE flag is non-zero (unless IGNORE-TABLE is set too). */
72 void do_cr_auto(void);
73 /* do automatic change-rules */
75 void preload_types(void);
76 /* Preload some partition types for convenience */
78 void do_activate(char *where, char *which);
79 /* Activate the specified partition */
81 void do_install_mbr(char *where, char *what);
82 /* Install a new MBR (Master Boot Record) */
84 int read_partitions(char *part, int max, int *volid,
85 struct partition *p, long long *where);
86 /* read all partitions & partition tables */