diff --git a/internal/server/storage/drivers/utils.go b/internal/server/storage/drivers/utils.go index 67ea9f33a8..3d761ac7d0 100644 --- a/internal/server/storage/drivers/utils.go +++ b/internal/server/storage/drivers/utils.go @@ -966,12 +966,9 @@ func clearDiskData(diskPath string, disk *os.File) error { } if linux.IsBlockdev(st.Mode()) { - // If dealing with a block device, discard its current content. + // If dealing with a block device, attempt to discard its current content. // This saves space and avoids issues with leaving zero blocks to their original value. - _, err = subprocess.RunCommand("blkdiscard", diskPath) - if err != nil { - return err - } + _, _ = subprocess.RunCommand("blkdiscard", "-f", diskPath) } else { // Otherwise truncate the file. err = disk.Truncate(0)