meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:prepare:prepare [2024/12/08 17:53] niziaklinux:prepare:prepare [2025/01/06 10:53] (current) niziak
Line 2: Line 2:
  
 ===== Basic ===== ===== Basic =====
 +
 +==== .bashrc ====
 +
 +Adapt old ''.bashrc'' to latest distro ''/etc/skel/.bashrc'' 
  
 ==== default EDITOR ==== ==== default EDITOR ====
Line 27: Line 31:
 </file> </file>
  
- 
-==== add i386 architecture ==== 
- 
-<code bash> 
-dpkg --add-architecture i386 
-apt-get update 
-apt-get install gpm tcpdump bmon tinc ppp pptpd mc links2 gparted hdparm smartmontools smart-notifier valgrind openssh-server 
-apt-get install wireshark mtr 
-</code> 
  
 ==== NTP: allow time corrections bigger than 1h ==== ==== NTP: allow time corrections bigger than 1h ====
Line 88: Line 83:
  
 Remember to set [[sw:libreoffice#paper_format]] Remember to set [[sw:libreoffice#paper_format]]
- 
-==== set cfq/deadline scheduler ==== 
- 
-<file | /etc/udev/rules.d/60-schedulers.rules> 
-#ACTION=="add|change", KERNEL=="sd*[!0-9]|sr*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq" 
-ACTION=="add|change", KERNEL=="sd*[!0-9]|sr*", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" 
-# ACTION=="add|change", KERNEL=="sd*[!0-9]|sr*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"   
-ACTION=="add|change", KERNEL=="sd*[!0-9]|sr*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="kyber" 
-ACTION=="add|change", KERNEL=="nvme[0-9]n[0-9]*", ATTR{queue/scheduler}="kyber" 
-</file> 
- 
-<code bash>cat /sys/block/sd*/queue/scheduler</code> 
- 
-=== single queue schedulers === 
-There are 2 queues, one for read & one for write operations. 
-  * **none** is just a First In First Out standard queue of I/O operations (it still merges some requests). 
-  * **cfq** (Completely Fair Scheduling) is similar to the Round Robin algorithm and basically allots a fixed execution time for each I/O operation (they are implemented as a circular queue) 
-  * **deadline** is like a priority queue with an aging concept. Basically it adds a deadline for each I/O operation & implements a priority queue 
- 
-=== block multi-queue schedulers === 
-Supported in kernel >=4.12. It is disabled by default. 
-To use multi-queue schedulers compile kernel with **CONFIG_SCSI_MQ_DEFAULT=y** or pass parameter **scsi_mod.use_blk_mq=1** in boot loader. 
- 
-[[https://www.thomas-krenn.com/en/wiki/Linux_Multi-Queue_Block_IO_Queueing_Mechanism_(blk-mq)|Linux Multi-Queue Block IO Queueing Mechanism]] 
- 
-<file | /etc/udev/rules.d/60-schedulers.rules> 
-ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" 
-ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline" 
-</file> 
-<code bash> 
-sudo udevadm control --reload 
-sudo udevadm trigger 
-cat /sys/block/sd*/queue/scheduler 
-</code> 
  
 ==== Disable console beep ==== ==== Disable console beep ====
Line 192: Line 153:
 Disable mandb updates after apt: Disable mandb updates after apt:
 <code bash>echo "set man-db/auto-update false" | debconf-communicate; dpkg-reconfigure man-db</code> <code bash>echo "set man-db/auto-update false" | debconf-communicate; dpkg-reconfigure man-db</code>
 +
 +==== smartmontools ====
 +
 +<code bash>apt install smartmontools</code>
 +<file sh /etc/smartd.conf>
 +DEVICESCAN -n standby,336,q -S on -H -l error \
 + -l xerror \
 + -l selftest \
 + -l offlinests \
 + -l scterc,0,0 \
 + -e lookahead,on \
 + -s (L/../../6/01|S/../.././02) \
 + -f -p -C 197+ -U 198+ -W 10,45,50....
 +</file>
 +
 +NOTE: It ignores disk in standby to do not spin up HDDs, but it ignores 336 checks (x 1800s interval = 7 days), then it will spin up disc. To put disc sleep again it is good to use ''hd-idle'' daemon.
 +
 +==== hd-idle ====
 +
 +<code bash>apt install hd-idle</code>
 +
 +<file sh /etc/default/hd-idle>
 +HD_IDLE_OPTS="-a /dev/disk/by-id/ata-ST2000DM008-2UB102 -i 600 -l /var/log/hd-idle.log"
 +</file>
 +systemctl restart hd-idle
 +