Skip to content

Commit

Permalink
Merge pull request #1192 from sushanthakumar/Fixfstab-ToDev
Browse files Browse the repository at this point in the history
Remove the alteration of fstab during volume mount/unmount
  • Loading branch information
kumarashit authored Jan 31, 2020
2 parents 1349c87 + bdaf648 commit 9a91be8
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions contrib/connector/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ func Mount(device, mountpoint, fsType string, mountFlags []string) error {
return err
}

// Make sure the mount is not lost after the host reboots
cmd := fmt.Sprintf("echo \"%s %s %s defaults 0 0\" >> /etc/fstab", device, mountpoint, fsType)
_, err = ExecCmd("/bin/bash", "-c", cmd)
if err != nil {
return err
}

return nil
}

Expand All @@ -131,11 +124,6 @@ func Umount(mountpoint string) error {
return err
}

cmd := fmt.Sprintf("cat -n /etc/fstab | grep -w '%s' | awk -F ' ' '{ print $1 }'| xargs -i sed -i '{}d' /etc/fstab", mountpoint)
_, err = ExecCmd("/bin/bash", "-c", cmd)
if err != nil {
return err
}
return nil
}

Expand Down

0 comments on commit 9a91be8

Please sign in to comment.