Search code examples
linuxusbtty

Error 'E514: write error (file system full?)' when editing /dev/ttyUSB0 latency timer


when I try to edit the latency_timer of /dev/ttyUSB0 on my laptop I get an error. Here what I do:

$ sudo vim /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

When editing 16 to 1 and saving, I got in vim this error:

"/sys/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/ttyUSB0/latency_timer" E514: write error (file
 system full?)
WARNING: Original file may be lost or damaged
don't quit the editor until the file is successfully written!

Unfortunately I am not expert enough to know what I should do. I get that I should check that the filesystem partition /sys is full or not; indeed looking on internet it seems that I have to use command df. Here the output of df coomand:

$ sudo df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            7,7G     0  7,7G   0% /dev
tmpfs           1,6G  2,1M  1,6G   1% /run
/dev/nvme0n1p7  192G  119G   63G  66% /
tmpfs           7,7G  231M  7,5G   3% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           7,7G     0  7,7G   0% /sys/fs/cgroup
/dev/loop1       15M   15M     0 100% /snap/gnome-characters/359
/dev/loop2      135M  135M     0 100% /snap/mathpix-snipping-tool/39
/dev/loop3      256K  256K     0 100% /snap/gtk2-common-themes/5
/dev/loop4      3,8M  3,8M     0 100% /snap/gnome-system-monitor/111
/dev/loop5      8,2M  8,2M     0 100% /snap/evince/224
/dev/loop6      8,2M  8,2M     0 100% /snap/evince/214
/dev/loop7      3,8M  3,8M     0 100% /snap/gnome-system-monitor/107
/dev/nvme0n1p1  676M   91M  586M  14% /boot/efi
/dev/loop9      203M  203M     0 100% /snap/vlc/1049
/dev/loop8      141M  141M     0 100% /snap/gnome-3-26-1604/98
/dev/loop0       20M   20M     0 100% /snap/okular/63
/dev/loop12     261M  261M     0 100% /snap/kde-frameworks-5-core18/32
/dev/loop10     157M  157M     0 100% /snap/gnome-3-28-1804/91
/dev/loop13      90M   90M     0 100% /snap/core/8039
/dev/loop16     256M  256M     0 100% /snap/kde-frameworks-5-core18/30
/dev/loop14     1,0M  1,0M     0 100% /snap/gnome-logs/73
/dev/loop15      43M   43M     0 100% /snap/gtk-common-themes/1313
/dev/loop17      15M   15M     0 100% /snap/gnome-characters/367
/dev/loop19     175M  175M     0 100% /snap/inkscape/5874
/dev/loop18     1,0M  1,0M     0 100% /snap/gnome-logs/81
/dev/loop20     135M  135M     0 100% /snap/mathpix-snipping-tool/40
/dev/loop21     410M  410M     0 100% /snap/gimp/227
/dev/loop23      55M   55M     0 100% /snap/core18/1265
/dev/loop24     4,3M  4,3M     0 100% /snap/gnome-calculator/536
/dev/loop25      45M   45M     0 100% /snap/gtk-common-themes/1353
/dev/loop26     220M  220M     0 100% /snap/gimp/189
/dev/loop28     4,3M  4,3M     0 100% /snap/gnome-calculator/544
/dev/loop27     141M  141M     0 100% /snap/gnome-3-26-1604/97
/dev/loop29     157M  157M     0 100% /snap/gnome-3-28-1804/110
tmpfs           1,6G   84K  1,6G   1% /run/user/1000
/dev/loop30      55M   55M     0 100% /snap/core18/1279
/dev/loop31      90M   90M     0 100% /snap/core/8213

However looking at the output of this command I am not able to spot the problem or to understand if partition /sys is full. I have tried also to remove all temporary files and to empty the trash bin, but it did not solve the problem. Does somebody of you have any idea of what can cause the error I got and how to solve it? Any help is really appreciated :)


Solution

  • You are not supposed to edit these files using vi, just write values using echo. Vim will try to create a file in the same directory and rename it over the latency_timer file which does not work in /sys

    Instead, use something like:

    echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
    

    If you must run this as a regular user, use sudo tee:

    echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer > /dev/null