logger.Fatal(config.ErrUnableToWriteInBackend(err).Hint(err.Error()),"Unable to initialize backend")
logger.Fatal(config.ErrUnableToWriteInBackend(err).Hint(err.Error()),"Unable to initialize backend")
}elseiferr==errUnsupportedDisk{
caseerrUnsupportedDisk:
hint:=fmt.Sprintf("'%s' does not support O_DIRECT flags, refusing to use",endpoint.Path)
hint:=fmt.Sprintf("'%s' does not support O_DIRECT flags, MinIO erasure coding requires filesystems with O_DIRECT support",endpoint.Path)
logger.Fatal(config.ErrUnsupportedBackend(err).Hint(hint),"Unable to initialize backend")
logger.Fatal(config.ErrUnsupportedBackend(err).Hint(hint),"Unable to initialize backend")
caseerrDiskNotDir:
hint:=fmt.Sprintf("'%s' MinIO erasure coding needs a directory",endpoint.Path)
logger.Fatal(config.ErrUnableToWriteInBackend(err).Hint(hint),"Unable to initialize backend")
caseerrFileAccessDenied:
// Show a descriptive error with a hint about how to fix it.
varusernamestring
ifu,err:=user.Current();err==nil{
username=u.Username
}else{
username="<your-username>"
}
hint:=fmt.Sprintf("Run the following command to add write permissions: `sudo chown -R %s %s && sudo chmod u+rxw %s`",username,endpoint.Path,endpoint.Path)
logger.Fatal(config.ErrUnableToWriteInBackend(err).Hint(hint),"Unable to initialize posix backend")
caseerrFaultyDisk:
logger.LogIf(GlobalContext,fmt.Errorf("disk is faulty at %s, please replace the drive",endpoint))
caseerrDiskFull:
logger.LogIf(GlobalContext,fmt.Errorf("disk is already full at %s, incoming I/O will fail",endpoint))
default:
logger.LogIf(GlobalContext,fmt.Errorf("disk returned an unexpected error at %s, please investigate",endpoint))
}
}
// Show a descriptive error with a hint about how to fix it.
varusernamestring
ifu,err:=user.Current();err==nil{
username=u.Username
}else{
username="<your-username>"
}
hint:=fmt.Sprintf("Run the following command to add the convenient permissions: `sudo chown -R %s %s && sudo chmod u+rxw %s`",username,endpoint.Path,endpoint.Path)
logger.Fatal(config.ErrUnableToWriteInBackend(err).Hint(hint),"Unable to initialize posix backend")