Skip to content

System Kernel

Marcel Schmalzl edited this page Dec 25, 2023 · 14 revisions

Kernel Parameter Tuning

vfs_cache_pressure

Influences the tendency the system reclaims memory for caching of VFS caches, versus pagecache and swap.

Temporary changes (until reboot):

/proc/sys/vm/vfs_cache_pressure

Do a permanent change (applied during reboot):

Either add a line to /etc/sysctl.conf or (better) create a new file in /etc/sysctl.d/*.conf.

If you use the second approach make sure that the filename starts with two digits and a hyphen (like 10-blah.conf). This is due the defined sequence for start-up.

  • =0: The Kernel will never reclaim memory
  • =100: Reclaim at a "fair" rate (= default)

Add a line in the config file:

vm.vfs_cache_pressure=15

Get detail information with sudo slabtop (dentry and *inode_cache are what we are looking for -> see also here for more infos).

Additional ressources

.bashrc

pacman autocompletion for packages not working

  • but for everything else. Probably in this case the package bash-completion is already installed. Comment-out the following line in .bashrc:
complete -cf sudo

Log-off and on again (source ~/.bashrc will not work here).

Performance

Perf

XFCE

Disable Alt + left mouse button to drag windows

Open Settings Editor (or via xfce4-settings-manager in terminal) -> xfwm4 -> Find easy_click and empty the string (do NOT click on reset).

If you did click reset you can add it again by adding a new entry /general/easy_click; type=Ssring.

Update SSD driver

https://wiki.archlinux.org/title/Solid_state_drive#Update_under_Linux

Filesystem information

  • df -T : Report file system for every mount point
    Filesystem     Type      1K-blocks       Used  Available Use% Mounted on
    udev           devtmpfs   16392964          0   16392964   0% /dev
    tmpfs          tmpfs       3283260      18004    3265256   1% /run
    /dev/sda2      ext4      218259288  162403148   44746156  79% /
    tmpfs          tmpfs      16416300      15444   16400856   1% /dev/shm
    tmpfs          tmpfs          5120          4       5116   1% /run/lock
    tmpfs          tmpfs      16416300          0   16416300   0% /sys/fs/cgroup
    tmpfs          tmpfs       3283260         60    3283200   1% /run/user/1001
    /dev/sdc2      fuseblk  3906896892 2755857208 1151039684  71% /media/drive1
    /dev/sdb1      fuseblk  1953513456  682770480 1270742976  35% /media/drive2
    
  • lsblk -f : does the same with tree structure (shows less information)
    NAME   FSTYPE LABEL           UUID                                 MOUNTPOINT
    sda                                                                
    ├─sda1 ntfs                   97a6502F23ED673F                     
    ├─sda2 ext4                   ab1aeacd-5a87-4d89-a59f-199ef2f421f7 /
    ├─sda3                                                             
    └─sda5 swap                   3a64055c-8824-83ad-7240-c8a549c1d7ee [SWAP]
    sdb                                                                
    └─sdb1 ntfs   Volume          B5603C0F6839E94A                     /media/volume
    sdc                                                                
    ├─sdc1                                                             
    └─sdc2 ntfs   data            1AAF1EBB596EC1BB                     /media/data
    sr0
    
  • ls -l /dev/disk/by-label/ or even ls -la /dev/disk/by-label/ (shown here):
    total 0
    drwxr-xr-x 2 root root  80 Mär  5 19:24 .
    drwxr-xr-x 6 root root 120 Mär  5 19:24 ..
    lrwxrwxrwx 1 root root  10 Mär  3 19:45 Recovery -> ../../sda2
    lrwxrwxrwx 1 root root  10 Mär  3 19:45 Win -> ../../sda5
    

lspci - show available hardware

lspci shows all recognised hardware.

List all installed packages

dpkg --get-selections

Reload shared libraries

sudo ldconfig

Show all processes of all users

BSD Style:

ps aux
  • a : show processes for all users
  • u : display the process's user/owner
  • x : also show processes not attached to a terminal

Equivalent to

ps -eF

Equivalent to

ps -AF

Or as tree

ps axjf # BSD Style
# or
ps -ejH
  • -A / -e : shows all Processes
  • -F : detailed output

List files opened by a process

If you have a running process and, e.g. got too many open files errors, you can easy check with:

lsof -p <pid>

Check which files your process opened:

lsof -p <pid> > now
# Wait a short time
lsof -p <pid> > now_2

# and then:
diff now now_2

Check S.M.A.R.T. values

# Installation
sudo pacman -S smartmontools
# Usage
sudo smartctl -a /dev/sda

udiskctrl

Manage (mount, umount, display info, power-off, ...) (USB-)devices. Most interesting is probably the power-off option.

Power-off devices

udisksctl power-off -b /dev/sdb1

Display (extensive) information

udisksctl info -b /dev/disk/by-id/ata-blahBlub
# or
udisksctl info -b /dev/sdb3
Clone this wiki locally