Skip to content
This repository has been archived by the owner on Jan 14, 2023. It is now read-only.

FloydZ/hddgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hddgo

A library written in go to manipulate a harddrive. I added also a wrapper to create luks or lvm container. You cann create a lvm container in a luks Encrypted container or visa versa.

Install

  1. go get github.com/FloydZ/hddgo
  2. go get github.com/pivotal-golang/bytefmt
  3. go get github.com/c9s/goprocinfo/linux
  4. go get github.com/op/go-logging

Examples

You´ll find some examples in hddmain

Important Structs

  1. Harddrive{}
  2. Partition{}
  3. LUKS{}
  4. PhysicalVolume{}
  5. VolumeGroup{}
  6. LogicalVolume{}

LVM

  1. You can create Cachepool
  2. You can move Physical Volumes
  3. You can create Snapshots
  4. You can create Filesystem with parted

Howto

  1. Create a Partition: (h *Harddrive) CreateNewPartition(size string) (Partition, error)
  2. Create a LUKS: (p *Partition) CreateLuksContainer(pwfile string) (LUKS, error)
  3. Create a PhysicalVolume: (p *Partition) CreateNewPhysicalVolume()(error)
  4. Create a VolumeGroup: (p *PhysicalVolume) CreateVolumeGroup(name string) (error)
  5. Create a LogicalVolume: (v *VolumeGroup) CreateLogicalVolume(name string, size string) (error)

About

A library written in go to manipulate a harddrive.

Topics

Resources

License

Stars

Watchers

Forks

Languages