Documentation
¶
Overview ¶
Package mbr provides an io/fs implementation of the Master Boot Record (MBR) partition table.
Index ¶
- type Chs
- func (k *Chs) B2() (value uint8)
- func (k *Chs) B3() (value uint8)
- func (k *Chs) Cylinder() (value int64)
- func (k *Chs) Decode(reader io.ReadSeeker, ancestors ...interface{}) (err error)
- func (k *Chs) Head() (value uint8)
- func (k *Chs) Parent() *PartitionEntry
- func (k *Chs) Root() *MbrPartitionTable
- func (k *Chs) Sector() (value int64)
- type FS
- type MbrPartitionTable
- func (k *MbrPartitionTable) BootSignature() (value []byte)
- func (k *MbrPartitionTable) BootstrapCode() (value []byte)
- func (k *MbrPartitionTable) Decode(reader io.ReadSeeker, ancestors ...interface{}) (err error)
- func (k *MbrPartitionTable) Parent() *MbrPartitionTable
- func (k *MbrPartitionTable) Partitions() (value [4]PartitionEntry)
- func (k *MbrPartitionTable) Root() *MbrPartitionTable
- type Partition
- func (p *Partition) Close() error
- func (p *Partition) Info() (fs.FileInfo, error)
- func (p *Partition) IsDir() bool
- func (p *Partition) ModTime() time.Time
- func (p *Partition) Mode() fs.FileMode
- func (p *Partition) Name() string
- func (p *Partition) Size() int64
- func (p *Partition) Stat() (fs.FileInfo, error)
- func (p *Partition) Sys() interface{}
- func (p *Partition) Type() fs.FileMode
- type PartitionEntry
- func (k *PartitionEntry) ChsEnd() (value *Chs)
- func (k *PartitionEntry) ChsStart() (value *Chs)
- func (k *PartitionEntry) Decode(reader io.ReadSeeker, ancestors ...interface{}) (err error)
- func (k *PartitionEntry) LbaStart() (value uint32)
- func (k *PartitionEntry) NumSectors() (value uint32)
- func (k *PartitionEntry) Parent() *MbrPartitionTable
- func (k *PartitionEntry) PartitionType() (value uint8)
- func (k *PartitionEntry) Root() *MbrPartitionTable
- func (k *PartitionEntry) Status() (value uint8)
- type Root
- func (r *Root) Close() error
- func (r *Root) IsDir() bool
- func (r *Root) ModTime() time.Time
- func (r *Root) Mode() fs.FileMode
- func (r *Root) Name() string
- func (r *Root) Read([]byte) (int, error)
- func (r *Root) ReadDir(n int) ([]fs.DirEntry, error)
- func (r *Root) Size() int64
- func (r *Root) Stat() (fs.FileInfo, error)
- func (r *Root) Sys() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chs ¶
type Chs struct {
// contains filtered or unexported fields
}
func (*Chs) Decode ¶
func (k *Chs) Decode(reader io.ReadSeeker, ancestors ...interface{}) (err error)
func (*Chs) Parent ¶
func (k *Chs) Parent() *PartitionEntry
func (*Chs) Root ¶
func (k *Chs) Root() *MbrPartitionTable
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS implements a read-only file system for Master Boot Records (MBR).
type MbrPartitionTable ¶
type MbrPartitionTable struct {
// contains filtered or unexported fields
}
MBR (Master Boot Record) partition table is a traditional way of
MS-DOS to partition larger hard disc drives into distinct partitions.
This table is stored in the end of the boot sector (first sector) of the drive, after the bootstrap code. Original DOS 2.0 specification allowed only 4 partitions per disc, but DOS 3.2 introduced concept of "extended partitions", which work as nested extra "boot records" which are pointed to by original ("primary") partitions in MBR.
func (*MbrPartitionTable) BootSignature ¶
func (k *MbrPartitionTable) BootSignature() (value []byte)
func (*MbrPartitionTable) BootstrapCode ¶
func (k *MbrPartitionTable) BootstrapCode() (value []byte)
func (*MbrPartitionTable) Decode ¶
func (k *MbrPartitionTable) Decode(reader io.ReadSeeker, ancestors ...interface{}) (err error)
func (*MbrPartitionTable) Parent ¶
func (k *MbrPartitionTable) Parent() *MbrPartitionTable
func (*MbrPartitionTable) Partitions ¶
func (k *MbrPartitionTable) Partitions() (value [4]PartitionEntry)
func (*MbrPartitionTable) Root ¶
func (k *MbrPartitionTable) Root() *MbrPartitionTable
type Partition ¶
type Partition struct { *io.SectionReader // contains filtered or unexported fields }
Partition implements fs.File
func NewPartition ¶
func NewPartition(name int, partition *PartitionEntry) *Partition
NewPartition creates a new Partition object for parsing MBR partitions.
func (*Partition) Name ¶
Name returns the name of a partition that consists of 'pX' where X is the number of the partition.
type PartitionEntry ¶
type PartitionEntry struct {
// contains filtered or unexported fields
}
func (*PartitionEntry) ChsEnd ¶
func (k *PartitionEntry) ChsEnd() (value *Chs)
func (*PartitionEntry) ChsStart ¶
func (k *PartitionEntry) ChsStart() (value *Chs)
func (*PartitionEntry) Decode ¶
func (k *PartitionEntry) Decode(reader io.ReadSeeker, ancestors ...interface{}) (err error)
func (*PartitionEntry) LbaStart ¶
func (k *PartitionEntry) LbaStart() (value uint32)
func (*PartitionEntry) NumSectors ¶
func (k *PartitionEntry) NumSectors() (value uint32)
func (*PartitionEntry) Parent ¶
func (k *PartitionEntry) Parent() *MbrPartitionTable
func (*PartitionEntry) PartitionType ¶
func (k *PartitionEntry) PartitionType() (value uint8)
func (*PartitionEntry) Root ¶
func (k *PartitionEntry) Root() *MbrPartitionTable
func (*PartitionEntry) Status ¶
func (k *PartitionEntry) Status() (value uint8)
type Root ¶
type Root struct {
// contains filtered or unexported fields
}
Root is a pseudo root directory for a Master Boot Record.