Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Friday, May 20, 2022

Long USB drive unmounting after copying data to it


After copying significant amount of data to a USB drive the data get cached and need to be physically flushed to the drive before unmounting. 
By default, Ubuntu uses 20% of RAM for file caches.

Solution

There are some tunable settings that influence how the Linux kernel deals with the file system cache. 
All of them are connected with dirty data (or dirty memory) - data that is written into the cache but not saved on disk.
  • dirty_ratio - maximum percentage of dirty system memory
  • dirty_bytes - the same as dirty_ratio but specified in bytes
  • dirty_background_ratio - percentage of dirty system memory at which background writeback will start
  • dirty_background_bytes - the same as dirty_background_ratio but specified in bytes
$ sudo bash -c 'echo $((64*1024*1024)) > /proc/sys/vm/dirty_background_bytes'
$ sudo bash -c 'echo $((128*1024*1024)) > /proc/sys/vm/dirty_bytes'
In this case, coping progress shows correct speed, and unmounting takes only several seconds. 
To save this setting after reboot it’s required to add such a line into /etc/sysctl.conf:
vm.dirty_background_bytes = 67108864
vm.dirty_bytes = 134217728
This option is applied to all disks - external and internal ones what can reduce system performance.

Tuesday, September 22, 2020

Garmin SubMusic (on Ubuntu 18.04)

  1. Install dependencies
  2. Install Nextcloud
  3. Install Music
  4. Install Ampache
  5. Install Garmin SubMusic

Nextcloud

Reference guide

Nextcloud 19 dependencies:
  • PHP >=7.2
  • MySQL/MariaDB
  • Nginx
Ampache dependencies:
  • PHP >=7.2
  • MySQL/MariaDB
  • Nginx
  • Composer

Wednesday, June 17, 2020

Gedit transparent background

Some gnome applications (usual ones: gedit, gnome-calculator) can suddenly get looking incorrect (transparent background, visual artifacts, etc).

The reason could be a change in:
- Settings => Region & Language => Manage Installed Languages => Keyboard input method system
- Language Support => Keyboard input method system

Solution:

- remove ~/.xinputrc
- reboot