I'm getting Fsync failed error. Why?

I tried to change the tcp timestamps in Ec2 instance (which is Ubuntu 12.04). I opened up the editor and changed the value 1 from 0. And when I tried to save the file I get this error:

/proc/sys/net/ipv4/tcp_timestamps" E667: Fsync failed

I'm very new to Ubuntu. Can anyone help me in this out?


Solution 1:

Your editor is probably doing funny things to that file (files in /proc are not actual files, they're an interface to lower-levels of the operating system). While the change is probably working okay, the usual way of updating things in proc is directly with a shell command, like:

echo 1 | sudo dd of=/proc/sys/net/ipv4/tcp_timestamps

If you want this setting to be applied every time you boot, create a file called /etc/sysctl.d/tcp-timestamps.conf, containing the following:

net.ipv4.tcp_timestamps = 1

Solution 2:

Sometime back we were getting exact same error. After wasting several minutes in investigation found there was no space left on the device. You can check if it is the case for you. Try freeing up some storage to quickly fix the issue.

Note: This could not be the best technical description of the problem but it might help in quickly fixing the issue. The verified answer explain this in more detail. My answer was just to share how I fixed this issue.

Solution 3:

I see this was correctly answered a long time ago, but there is simpler command:

sudo sysctl net.ipv4.tcp_timestamps=1

Also you can do the same with other settings like:

sudo sysctl vm.admin_reserve_kbytes=16384

As you can see, you can modify any file in /proc/sys/ by specifying the rest of its location, while changing delimiter from "/" to "."

Example: "/proc/sys/net/ipv4/tcp_timestamps" is specified as "net.ipv4.tcp_timestamps"

Solution 4:

Fsync failed WARNING: Original file may be lost or damaged don't quit the editor until the file is successfully written!

Could be a space issue as clearing a couple of files worked for me