Skip to content

Commit

Permalink
Automatically add Longhorn device to the group id 6 (disk group) by d…
Browse files Browse the repository at this point in the history
…efault

More explanation is at longhorn/longhorn#8088 (comment)

longhorn-8088

Signed-off-by: Phan Le <[email protected]>
  • Loading branch information
PhanLe1010 committed Mar 7, 2024
1 parent 4ec8eda commit dffb532
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@ func DuplicateDevice(dev *KernelDevice, dest string) error {
if err := os.Chmod(dest, 0660); err != nil {
return errors.Wrapf(err, "cannot change permission of the device %s", dest)
}
// We use the group 6 by default because this is common group for disks
// See more at https://github.com/longhorn/longhorn/issues/8088#issuecomment-1982300242
if err := os.Chown(dest, 0, 6); err != nil {
return errors.Wrapf(err, "cannot change ownership of the device %s", dest)
}
return nil
}

Expand Down

0 comments on commit dffb532

Please sign in to comment.