Skip to content

Commit 33bc37f

Browse files
committed
Add newline character when writing offline to block device state
1 parent ece8e05 commit 33bc37f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/deviceutils/device-utils_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ import (
2424

2525
func (_ *deviceUtils) DisableDevice(devicePath string) error {
2626
deviceName := filepath.Base(devicePath)
27-
return os.WriteFile(fmt.Sprintf("/sys/block/%s/device/state", deviceName), []byte("offline"), 0644)
27+
return os.WriteFile(fmt.Sprintf("/sys/block/%s/device/state", deviceName), []byte("offline\n"), 0644)
2828
}

0 commit comments

Comments
 (0)