Skip to content

Commit

Permalink
Add pvscan cache operation when creating pv
Browse files Browse the repository at this point in the history
  • Loading branch information
matbme committed Jan 2, 2024
1 parent 4b45226 commit 0c930db
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/lvm/lvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ func Pvcreate(diskLabel string) error {
return fmt.Errorf("pvcreate: %v", err)
}

pvscanCache(diskLabel)

return nil
}

// pvscanCache runs the command `pvscan --cache [pv]` on the specified volume
func pvscanCache(diskLabel string) error {
_, err := RunCommand("pvscan --cache %s", diskLabel)
if err != nil {
return fmt.Errorf("pvscanCache: %v", err)
}

return nil
}

Expand Down

0 comments on commit 0c930db

Please sign in to comment.