From 52fc61f2d10f0fffbe9497ae2a07ba9a9e387c5b Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Tue, 30 Jun 2015 16:04:41 +0300 Subject: [PATCH] fix Signed-off-by: Vasiliy Tolstov --- system/filesystem_linux.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/system/filesystem_linux.go b/system/filesystem_linux.go index d0629f0..49aee85 100644 --- a/system/filesystem_linux.go +++ b/system/filesystem_linux.go @@ -159,10 +159,17 @@ func ResizeRootFS() error { if err != nil { return err } - - err = ioctl.BlkRRPart(w.Fd()) - w.Close() + err = w.Sync() if err != nil { + return err + } + + blkerr := ioctl.BlkRRPart(w.Fd()) + err = w.Close() + if err != nil { + return err + } + if blkerr != nil { args := []string{} for _, name := range []string{"partx", "partprobe", "kpartx"} { if _, err = exec.LookPath(name); err == nil {