date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,395,769,777,000
Using a Lenovo Legion Y520 with i7-7700HQ (base clock 2.8Ghz) and GTX 1050. I'm getting CPU overheating warnings in linux and it's affecting my performance in games (found in Payday 2 and CS:GO). I've never had problems in Windows. This is what I found when trying to troubleshoot this issue: In Windows 10 (using aida6...
The difference is due to windows and linux using different CPU throttling profiles. You do have some control over this on linux. For example, the following command will show you which profile is currently being used: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor There are ways to choose which profiles to u...
CPU temperatures in linux: throttling or wrong reading?
1,395,769,777,000
My objective is to set up a mini server (not HTPC) with low power consumption in idle mode, yet offering nice performance when used. The focus is more on data safety than availability. In other words: quality parts, but redundancy only for storage. Not considering myself to be biased, after some research I felt that s...
[Edit: Concluding thoughts regarding the processor choice] AMD vs AMD: Richland does a much better job than Trinity here. Kaveri cannot compete with Richland's idle mode power dissipation (at least for now). The GPU of the A10-6700 may be overrated, but it's a bit sad it won't be used much. Some algorithms may be a...
How to set up Linux for full AMD APU power management support: Turbo Core, Cool'n'Quiet, Dynamic Power Management?
1,395,769,777,000
According to sensors, the critical temperature for my CPU cores is at 100°C. When using my laptop it never goes above 95°C (So either my sensor is defect or thermal throttling is set to a lower value for some reason, but this doesn't really matter). I have an Intel i7 and thermald.service is up and running and I'm on ...
There is a hack solution via shellscript: https://github.com/Sepero/temp-throttle/ #!/bin/bash # Usage: temp_throttle.sh max_temp # USE CELSIUS TEMPERATURES. # version 2.20 cat << EOF Author: Sepero 2016 (sepero 111 @ gmx . com) URL: http://github.com/Sepero/temp-throttle/ EOF # Additional Links # http://seperohack...
Set critical CPU temperature for thermal throttling
1,395,769,777,000
I spent hours searching for an answer in Internet. All I could find doesn't help. I have Intel i9-9980HK, running under Ubuntu 20.04, kernel 5.4.0-33. The problem is that under the full load the CPU lowers the frequency to 2.7 GHZ, I guess in order to stay under low power budget. Whatever I try I can't make it run fas...
The solution turned out to be to pass intel_pstate=passive to kernel. Then intel_pstate relinquishes control back to CPUFreq. The latter still uses intel_pstate to govern the CPU, but intel_pstate has no say in what to do. After that, you can finally set performance policies. Your laptop can be either completely quiet...
Set CPU to high performance
1,395,769,777,000
Observation: I have an HP server with an AMD dual core CPU (Turion II Neo N40L) which can scale frequencies from 800 to 1500 MHz. The frequency scaling works under FreeBSD 9 and under Ubuntu 12.04 with the Linux kernel 3.5. However, when I put FreeBSD 9 in a KVM environment on top of Ubuntu the frequency scaling does ...
I have found the solution thanks to the tip given by Nils and a nice article. Tuning the ondemand CPU DVFS governor The ondemand governor has a set of parameters to control when it is kicking the dynamic frequency scaling (or DVFS for dynamic voltage and frequency scaling). Those parameters are located under the sysfs...
Host CPU does not scale frequency when KVM guest needs it
1,395,769,777,000
The system clock is maintained by the kernel, whereas the hardware clock is maintained by the Real Time Clock (RTC). Do both clock run at same frequency? Are both independent of each other? What happens when Real time clock fails? Does it affect the system clock? Can anyone let me know the difference between both th...
both clock run at same frequency? Usually there are two clocks inside a computer/device/system. One is powered from a battery (usually a CR2032, could be the main battery or even a supercap in an embedded system) and runs from an dedicated chip. The other one is driven by the CPU clock source (with its own quartz cry...
System Clock vs. Hardware Clock (RTC) in embedded systems
1,395,769,777,000
This problem is bothering me for some weeks now and I cannot seem to figure out what the real problem might be. The problem is that the CPU frequency is dropping drastically when under load. By this I mean that the CPU frequency is around 400 MHz when just opening a web browser for example, and when there is no load t...
As it turned out it was a thermal issue, but not software related. After sending the device back to the factory, they replaced the cooler of the device and the issue was fixed! Apparently the CPU got up to just under 100 degrees Celsius, and then immediately thermal throttled.
CPU Frequency drops under load without thermal issues
1,395,769,777,000
I see the cores on an Intel i5 machine I'm looking at can only be run at the same clockspeed: /sys/devices/system/cpu/cpu1/cpufreq/related_cpus lists all of the CPUs. Setting cpu1's clockspeed changes cpu0's, as expected. Supposedly the AMD A6-4400M machine I'm running should be able to run each core at a different cl...
This is not yet close to be a definite answer. Instead, it's a set of suggestions too long to fit in comments. I'm afraid you might slightly misinterpret the meanings of sysfs cpufreq parameters. For instance, on my Core Duo laptop, the related_cpu parameters for both cores read 0 1 - which, according to your interpr...
Can I run multiple cores at different clock speeds?
1,395,769,777,000
I changed my CentOS 6 CPU governor from ondemand (the default one) to conservative and got this after restarting the cpufreq service: /etc/rc5.d/S13cpuspeed: line 88: /sys/devices/system/cpu/cpufreq/conservative/ignore_nice_load: File or directory does not exist So what should I do? Should I create the file and ...
For 3.x kernels The interface to CPUFreq has changed in the newer kernels. This would include CentOS 6. You can read about the entire interface here in the Red Hat Enterprise Linux (RHEL) documentation titled: Chapter 3. Core Infrastructure and Mechanics. Specifically the section on CPUFreq Setup. Here are the steps r...
CentOS conservative governor, nice error
1,395,769,777,000
How can it be, that my current cpu frequency (CPU MHz) for my Intel Core2 Duo T9400M is above max MHz while being on high load? ➜ lscpu [...] Model name: Intel(R) Core(TM)2 Duo CPU T9400M @ 2.53GHz Stepping: 10 CPU MHz: 2606.581 CPU max MHz: 2534.0000 CPU min MHz: ...
In both cases, your CPU can run slightly faster than its specified frequency, typically when one of its cores is running a CPU-intensive process, and the others aren’t. On your Core 2 Mobile system, this was provided by Intel Dynamic Acceleration; on the Core i7, by Turbo Boost. The exact details vary from one process...
How can my cpu frequency be above maximum MHz value in lscpu?
1,395,769,777,000
My board continues to display the message below. The terminal does not have any input. What is it with the following message, which I know? (T, g, c, q ...) What is the cause of this phenomenon? How can I fix this phenomenon? INFO: rcu_preempt detected stalls on CPUs/tasks: { 3} (detected by 0, t=3936547 jiffies, g=36...
You probably have a real time application that is consuming all cpu (some bad implementation) and because of its realtime scheduling priority the system doesn't have enough resources available for other tasks. I suggests that you remove realtime priority from your applications and check which one is consuming a lot of...
"rcu_preempt detected stalls on CPUs / tasks" message appears to continue
1,395,769,777,000
In some devices the cpu speed is dynamic, being faster when there is more load. I was wondering if it is possible to set nice level or priority of a process so that it does not influence an increase in cpu speed when it is running flat out. i.e. Process is running flat out, but only using spare cpu cycles as low prior...
You can use the ondemand cpu-freq governor, as long as you set the ignore_nice_load parameter to 1. From Documentation/cpu-freq/governors.txt, ondemand section: ignore_nice_load: this parameter takes a value of '0' or '1'. When set to '0' (its default), all processes are counted towards the 'cpu utilisation' valu...
Process priority and cpu speed
1,395,769,777,000
I use centos 6.4 64. I have old proc - CPU AMD Phenom II X4 810 (HDX810W) 2.6 GHz. However, when I execute the command cat /proc/cpuinfo I get the following: processor : 0 vendor_id : AuthenticAMD cpu family : 16 model : 4 model name : AMD Phenom(tm) II X4 810 Processor stepping : 2 cpu MHz : 800.00...
That's the current CPU frequency; it can be scaled up and down. Have a look in /sys/devices/system/cpu/cpu0 (or 1, 2, 3), then the cpufreq directory. Check cat scaling_governor. It is probably ondemand (I believe that's the default kernel configuration). Now check scaling_available_frequencies; you'll see a list tha...
CPU speed and cat /proc/cpuinfo
1,395,769,777,000
I just installed conky and recognized that my CPU-Frequency changes every second in steps of 10 to 100MHz and between 1000MHz - 2000MHz. Just wondered if this is normal behavior?
This is normal behavior. This behavior is part of the system attempting to conserve power by constantly adjusting the system's CPU speed. Take a look at my answer on this other U&L Q&A titled: How does CPU frequency work in conky?.                                     Conky CPU info                                    ...
CPU Frequency changing every second
1,395,769,777,000
My PC has two processors, and I know that each one runs at 1.86 GHz. I want to measure the clock pulse of my PC processor/s manually, and my idea is just to compute the quotient between the number of assembler lines a program have, and the time my computer spends to execute it, so then I have the number of assembly i...
That won't work. The number of clock cycles each instruction takes to execute ( they take quite a few, not just one ) depends heavily on the exact mix of instructions that surround it, and varies by exact cpu model. You also have interrupts coming in and the kernel and other tasks having instructions executed mixed ...
How to measure the clock pulse of my computer manually?
1,395,769,777,000
I just bought a new laptop (Asus UX435EG-AI084R) equipped with an Intel Tiger Lake CPU (i7-1165G7; 2.80GHz) and I installed Debian Linux (Testing) on it. Unfortunately I am experiencing a very strange issue related to CPU frequency scaling. Every time the CPU is under heavy load, the frequency goes down to 400MHz. The...
Turns out I had to install thermald from the Debian repository. Once I did, everything started to work just fine. No more throttling down to 400MHz. Interestingly, I never had to install this package myself in the past and all my past laptops never had this issue. I guess it used to be installed automatically as a dep...
How to completely disable CPU frequency scaling? Problems with kernel 5.9 running on Intel Tiger Lake CPU laptop
1,395,769,777,000
In Ubuntu 13.10 on my (Dual Core i5 Lenovo G570) laptop, I recently discovered the wonders of indicator-cpufreq, so I can extend my battery life dramatically by setting it to 'ondemand' or 'powersave' governor - here is the menu it shows:                                                        I was wondering whether I...
This is related to a new driver introduced in Fedora 20 that does not need more than those two governors. See this thread CPU Governors - where is ONDEMAND? for details. To have the missing governors, you should boot with the kernel parameter intel_pstate=disable. To do so, in the GRUB boot screen, choose "edit boot...
How to get ondemand governor on fedora
1,395,769,777,000
What command or program do I need to run in order to change the clock speed to a specific value I want? For example, I'm looking for something like <command name> 1.7, or something similar, to change the speed to a specified frequency in GHz or MHz. I would prefer a terminal application, but a desktop app would also ...
This can be done with the cpufreq-set command from cpufrequtils. Here is an example: cpufreq-set -f 1700
Ubuntu- How do I change clock speed from terminal? [duplicate]
1,543,918,511,000
I have a Linux PC with a 3.4 GHz CPU. I must check this processor to see if it actually runs at that speed. Is there a benchmark available? I ran sysbench but it only provides time of completion, and I must find the maximum (actual) clock rate.
Use the command: lscpu To know all your CPU Specs: To get the specific frequency of your CPU use the command with a grep like so: lscpu | grep MHz It will give you output like: CPU MHz: 2723.789 To see realtime CPU speeds fluctuation use : watch -n1 "lscpu | grep MHz | awk '{print $1}'"; https://asku...
Linux utility to bench mark clock speed of CPU
1,543,918,511,000
I have a first generation i7 computer and it is prone to overheating. How can I set the CPU clock frequency in Fedora?
Use the command cpupower --cpu all frequency-info | grep "current CPU" to see what the frequency the cores are running at. Use the command cpupower --cpu all frequency-set --max 1.4GHz to set the CPU frequency to 1.4GHz
How to manually set CPU clock frequency in Fedora?
1,543,918,511,000
How can I set CPU affinity for the specific program (say gzip) to always run on specific core or cores (core 1, for example)? I read about taskset, but can it be used before program is actually used and creates a process?
You can't set the affinity for all invocations of an executable. The affinity is managed by the kernel and inherited from parent process to child process, there's no mechanism that changes the affinity of a process when an executable is executed. If you want all invocations of gzip to run on CPU 1, put a wrapper scrip...
Set CPU affinity for the specific program?
1,543,918,511,000
I try to change governor from "ondemand" to "powersave" like wiki says ( https://wiki.archlinux.org/index.php/CPU_Frequency_Scaling#Scaling_governors ), but everyway I want to change it, Arch always boot with "ondemand" sudo cpupower frequency-set -g powersave by the way this works
The cpupower.service unit provided with Archlinux reads its settings from /etc/default/cpupower. Either uncomment the governor setting, or add a new line so that governor='powersave'.
Powersave governor as default Arch
1,543,918,511,000
acpi-cpufreq was already loaded , where the frequency was all 800MHz now , and I can't make it back to full-speed , which is 2500MHz. I tried cpufreq-set -g performance , then I check /proc/cpuinfo , it was still 800MHz Is there anything wrong ? UPDATE It's a i5 CPU , part of cpu information provided below: processor ...
Alright , this was said to be a bug with Thinkpad , When your battery is unplugged , and connected to AC power higher than 65W , the freq will stuck at lowest , check the /sys/devices/system/cpu/cpuX/cpufreq/bios_limit , to see if it's stuck. Source: http://www.thinkwiki.org/wiki/Problem_with_CPU_frequency_scaling I...
cpufreq-set -g performance doesn't work on arch linux
1,543,918,511,000
Through the magic of piezoelectric phenomena, I experience "coil whine" when moving the mouse. Turns out said coil is energized by the CPU, and that the Intel driver enabling Turbo Boost makes it process my mouse movements extremely quickly, resulting in audible power consumption spikes. When I disable it with the fol...
Add this command to rc.local or create a systemd unit - whatever you like. Instead of disabling Turbo you might want to limit the maximum operating frequency of your CPU. There's a gulf between base and turbo frequencies, so disabling Turbo feels like an overkill. I have a script for that as well. With the intel-pstat...
Persistently disable Intel Turbo Boost
1,543,918,511,000
I have a server HPE ProLiant system with AMD Epyc CPU, BIOS A43 v1.20, with Linux kernel 4.19.71 (as well I tried on 5.4.0). Now, I'm trying to set CPU performance governor: # cpupower frequency-set -g performance Setting cpu: 0 Error setting new values. Common errors: - Do you have proper administration r...
It's quite likely that if you are using the second generation of EPYC CPU (Rome), not all function are implemented on your kernel. I don't know which distro you are using (it could be backported), but according to this blogpost on Ubuntu https://ubuntu.com/blog/amd-epyc-rome-support-in-ubuntu-server your kernel might ...
linux: can't set cpu frequency governor with cpupower
1,543,918,511,000
I run Gentoo Linux on my laptop. I have an issue, though, where if I'm building some very large piece of software (as I do fairly frequently, since the purpose of this laptop is development), the CPU tends to heat up more than I'd like. I used to use cpufreqd to manage this, since it has an lm_sensors plugin and can r...
There are still a couple of options left, please refer to Arch wikipage. The one you are looking for, specifically, is thermald.
Slow down CPU when it heats up
1,543,918,511,000
When the CPU (Intel i5-8400) is heavily loaded, the fan seems to increase its speed and make noise. I want to eliminate the noise when running CPU-intensive backup process (backup2l program). (It is apparently CPU-intensive because of compressing backup with gzip.) How to make a process not to use turbo boost? My OS i...
That's what cpulimit is for: cpulimit --exe=gzip --background --limit=100 cpulimit --exe=tar --background --limit=100 this will limit the total CPU usage of the most CPU-resource intensive programs used by the backup2l script to 100% per core. If that would still make too much noise, reduce that number until your ma...
Turn off CPU turbo-boost for a process
1,543,918,511,000
I'm setting up conky and I would like to add the CPU frequency, but if I put ${freq_g cpu0} Ghz I get 1.2Ghz. Why is that? My CPU is 2.8Ghz.
From the conky man page. cpu (cpuN) CPU usage in percents. For SMP machines, the CPU number can be provided as an argument. ${cpu cpu0} is the total usage, and ${cpu cpuX} (X >= 1) are individual CPUs. freq_g (n) Returns CPU #n's frequency in GHz. CPUs are counted from 1. If omitted, the parameter defaults to...
How does CPU frequency work in conky?
1,543,918,511,000
I plan to set up an AMD APU system using Debian, but I cannot find hints how to achieve maximum energy efficiency and successful use of Turbo Core. In particular, the Debian Wiki HowTo on CPU Frequency Scaling is not very helpful for AMD systems. How do I have to set up my Debian system to deploy my AMD APU's features...
Basics With an AMD APU, the following factors are of interest. If your system will only use console output, you will want to use the radeon driver for it. An active console handled by the radeon driver will save 8 W as compared to both the fallback driver and fglrx on an A10-6700 (Richland). If the console is idle, r...
How to set up a Debian system (focus on 2D or console/server) with an AMD Turbo Core APU for maximum energy and computing efficiency?
1,543,918,511,000
There are CPU MHz, CPU max MHz and CPU min MHz in lscpu output. What are they mean? Especially the CPU min MHz? We can think CPU max MHz is maximum CPU frequency and CPU MHz as current usage. Why there is a minimum? From lscpu man page: Minimum megahertz value for the CPU. This explanation is not clear to me. What doe...
It’s the slowest speed at which the processor can run, e.g. if the CPU doesn’t have much to do (depending on the governor in use) but can’t go to sleep, or if it’s throttled (from overheating, typically). You’ll see the current speed reported by lscpu vary between the minimum and maximum values.
What is CPU min MHz in lscpu output?
1,543,918,511,000
EDIT: Ubuntu (mate) 20.04, intel_pstate driver. Computer is I am using a razer blade stealth ultrabook (early 2019), with intel core i7 i7-8565U. I am encountering odd behavior (extreme slowdown) while on battery power only, even when I have set TLP to AC mode. The problem is made much worse if I set cpufrequtils to...
The issue was the intel_pstate driver. I switched to the original ACPI driver via boot kernel parameters. Specifically, in /etc/default/grub, I changed the DEFAULT boot line to: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_pstate=disable acpi=force" (remember to update-grub after). Now, even with no changes at all...
Horrible performance on battery with intel_pstate driver
1,543,918,511,000
I am using cpufreq to scale my CPU frequency. But I do that by clicking cpufreq icon on the panel of Ubuntu 12.04. If without a mouse, how can I show and scale CPU frequency by running commands in terminal?
cpufreq-info - Utility to retrieve cpufreq kernel information. It will list available frequency steps, available governors, current policy etc. cpufreq-set - A tool which allows to modify cpufreq settings (try e.g. cpufreq-set -g performance or cpufreq-set -f 2 GHz once you know what frequencies your CPU can be set t...
Scale cpu frequency in CLI?
1,543,918,511,000
I have FreeBSD 9.0-RC3 installed on an HP Thin Client that has a Mobile AMD Sempron(tm) Processor 2100+. I am trying to get cpufreq and powerd to manage the frequency of the processor, but I'm not having any luck. Here's some lines from dmesg: FreeBSD 9.0-RC3 #0: Sun Dec 4 08:56:36 UTC 2011 [email protected]:/usr...
It looks as though there isn't any. The FreeBSD forums folks have weighed in, and there's no support for CPU frequency management on this chip. AMD's spec sheet makes no mention of PowerNow, either. This isn't surprising - small-form-factor boxes (like the T5730w; is that what you have?) are often built to run cool a...
FreeBSD CPU frequency scaling on AMD Sempron 2100
1,543,918,511,000
I checked my Linux sys file, I don’t have: /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq My kernel config doesn’t have CONFIG_X86_INTEL_PSTATE, and it still didn’t use acpi-cpufreq driver. The sys file here only created when intel_pstate enabled? I am using yocto environment, not CentOS or Ubuntu.
Short answer The reason the path won't show on your system is that the cpufreq driver isn't loaded. This driver is the one creating the /sys/devices/system/cpu/cpuY/cpufreq in sysfs and populating it with values. When trying to compile the kernel without CONFIG_X86_INTEL_PSTATE, it is forced to enabled by the pcc_freq...
There is no scaling_max_freq sys file
1,543,918,511,000
What does it mean for a core to run at different loads in different moments? How does a 10% load differ from a 90% load? How is this number calculated, essentially?
It should be pretty obvious: time spent executing a task / total time. So over a given interval, 10% load means 10% of that time was spent executing tasks, and 90% was idle.
Linux and CPU usage
1,543,918,511,000
I am using Debian 10 (buster), 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux on my Lenovo T530 laptop which has a i7-3630QM. It has been many years since I bothered with frequency scaling and temperature but as of late it has become a bit of a problem. When I try to run CPU intensive applicati...
Thanks to Artem S. Tashkinov I was able to resolve the problem. He wrote in a comment Try using acpi-cpufreq intead of intel_pstate : https://silvae86.github.io/2020/06/13/switching-to-acpi-power and that did the trick. I had to install the acpi_cpufreq driver (in my case it was already installed) via apt-get apt-ge...
Why does my CPU disregard the maximum frequency set by e.g. cpupower and how can I keep my CPU from getting too hot?
1,476,693,338,000
I was trying to get frequecy from my device at run time. I used this device node sudo cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq It gave me 60000. I tried this one cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq I get 396000. What is the unit of these values. Is it 60000 Hz or Mhz?
The values are given in kHz (see the documentation). So 60000 is 60 MHz, 396000 is 396 MHz.
What is the unit of this value
1,476,693,338,000
I have run: sudo parallel cpufreq-set -c {} -u 2000MHz ::: 0 1 2 3 yet when I stress the CPU, cpufreq-info returns: analyzing CPU 2: driver: intel_pstate CPUs which run at the same hardware frequency: 2 CPUs which need to have their frequency coordinated by software: 2 maximum transition latency: 4294.55 ms. ...
In order to set a specific frequency, the 'userspace' governor is required in cpufreq. Please see the '2.3 Userspace' section in this documentation
Why does CPU governor not respect max CPU speed limit?
1,476,693,338,000
I know we have acpi_cpufreq driver and intel_psteate driver to use. However, I think intel_pstate driver is for Intel. What's the CPU frequency driver for AMD? Any introduction ( ex: governors ) for AMD CPU freq driver?
For current AMD CPUs, the appropriate driver is the ACPI driver. K6, K7, and K8 CPUs have specific drivers, but K10 and later are handled by the “generic” ACPI driver. There is additional support for frequency sensitivity feedback on Jaguar/Puma and later low-power CPUs, available in the amd-freq-sensitivity module. T...
What is the CPU frequency driver for AMD?
1,476,693,338,000
I am trying to write a BASH script which will evaluate and show in the terminal a list of all cores and their current load. I am using the output of the /proc/stat. For example: cat /proc/stat user nice system idle iowait irq softirq steal guest guest_nice cpu 4705 356 584 3699 23 23 0 0 ...
I think you want to have cpu Usage string to be shown on the same line each time and to be followed by the cpu Idle line immediately. To achieve that you can use tput and el (clr_eol) terminal capability to remove line and cuu (parm_up_cursor) to move n lines up. You can read about terminal capabilities in man termin...
Bash Script for evaluation of the CPU usage
1,476,693,338,000
I have two exactly same bare metal servers with same OS/kernel configuration, but they are running at two different CPU frequencies: the one is fixed at 2300MHz, while the other changes between 1200MHz and 2300MHz. The info in sudo cpupower frequency-info is as below: The first server: analyzing CPU 0: driver: intel...
Hardware differences may be accounted for by BIOS settings; review the BIOS on each system for differences. This may require downtime, so is best done prior to production launch, e.g. as part of setup tasks. Some vendors provide software tools that actually run on unix to access the BIOS, if available this may be pref...
How to disable CPU frequency scaling in CentOS 6?
1,476,693,338,000
I use indicator-cpufreq with Cinnamon to control my CPU-usage and save power, as my battery life has been running low. So, I use indicator-cpufreq to put my CPU in powersave mode. However, I have this weird issue with Cinnamon, that sometimes when I wake up from suspend, CPU usage skyrockets up to 40% per core, and ev...
So my question is, what does it do to put my CPU in powersave mode? It's adjusting the clock frequency/core activation so that it uses less power. When you're on the performance governor, it's probably still performing the same work as before, it's just getting through it faster. If your system has fewer resources ...
Does Powersave Mode on the CPU saves power?
1,476,693,338,000
I want to make a shell script that runs as a daemon process and every X minutes read the temperature of every cpu core to report it later with GNU plot. And here is my question, Is there any file in /sys or /proc or any other location which this info be uniformly placed across several UNIX systems (not only in Linux)...
Looks at this SOa: https://stackoverflow.com/a/15213255/438544 It mentions these three links: http://shallowsky.com/blog/linux/kernel/sysfs-thermal-zone.html http://lwn.net/Articles/268958/ http://www.mjmwired.net/kernel/Documentation/thermal/sysfs-api.txt They mention that on newer systems you should have all the...
Where can I find cpu temperature and frequency without any specific command?
1,476,693,338,000
I have two machines on which I run the same OS, the same kernel, the same CPU freq scaling driver, and the same CPU freq scaling governor. One will boost all core frequencies if one process pins a core. One will boost only one physical core if there is one process pinning a core. Machine A CPU: Intel(R) Xeon(R) W-2140...
I have been able to make the corei5 machine behave more appropriately, and only scale up the frequency of the cores that we actually have work for. To do so, I found that I had to switch the intel_pstate driver mode. In /sys/devices/system/cpu/intel_pstate/status you can switch between active and passive modes. active...
Frequency scaling governor scales up too many cores
1,476,693,338,000
I've a Desktop and a Laptop with overheating issue and as far as I've known from Arch Wiki and other contributors on this site, I've to limit the cpu frequency to resolve the issue. On both system I've installed cpupower and sudo cpupower frequency-info on the Desktop with AMD Phenom(tm) II X4 955 Processor returns: a...
"CPU temperatures in linux: throttling or wrong reading?" is helpful with regard to frequency scaling and it actually solves the issue, I've tried with the maximum 2.5 GHz on both laptop and desktop and the laptop performs considerably better than the desktop with 2.5GHz. Laptop never exceeded 80 degree while renderi...
Scaling CPU frequency
1,476,693,338,000
on most CPU you can use "cpufreq-aperf" to check cpu frequency, but I don't think this is compatible with AMDGPU. I did check for "aperf" and found: $ cat /proc/cpuinfo | grep -o "aperf[a-z]*" | head -1 aperfmperf Attempt to use "cpufreq-aperf": $ sudo cpufreq-aperf Error reading /dev/cpu/0/msr, load/enable msr.ko $...
Fixed, I went back to a kernel with a custom DSDT override, this enabled the cpu frequency.
AMDGPU CPU Query Frequency
1,476,693,338,000
While staring at a terminal waiting for my code to compile, I started to wonder whether Intel's Turbo Boost was actually working. I have an i7-4770K which is rated at 3.5GHz, with Turbo Boost up to 3.9GHz. Doing some reading I discovered that Turbo Boost is only really used when one core is doing more work than the o...
Turns out the problem was that the BIOS hadn't detected the CPU properly when it was first installed, and resetting the BIOS settings to the default fixed the problem. This was suggested by Intel support, and surprisingly enough it worked. So it looks like the fantastic VisualBIOS is as buggy, if not more so, than th...
Linux is reporting the CPU as too slow?
1,476,693,338,000
I would like to throttle my CPU, I have an i5-8265U and it has frequencies up to 3.9GHz, but I rarely need the speed. Now if something causes a high load, the CPU goes up and the fan gets noisy. It is already set to powersave $ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave And userspace is not a...
If you don't have such a setting in your BIOS, the solution is solved quite well here for Linux: http://notepad2.blogspot.com/2014/11/a-script-to-turn-off-intel-cpu-turbo.html I created an enhanced version of that script to toggle the turbo boost here on GitHub: https://github.com/rubo77/intel-turbo-boost Old version...
Limit an Intel i5 CPU 8th generation
1,476,693,338,000
I am trying to set all my CPUs to the maximum GHz capability. But for some reason even though the CPU is capable of 5.76GHz, when I set it to performance it only get's to 4.2GHz. Looking at the scaling_max_freq it all set to 4.2GHz, which I guess could be the issue. cat /sys/devices/system/cpu/cpufreq/policy*/scaling_...
Provided you are able to determine that the BIOS does not get any good reason for limiting the frequency, in short : YOU KNOW WHAT YOU ARE DOING : You can have linux ignoring the bios limit. change /sys/module/processor/parameters/ignore_ppc from 0 to 1. This will be reset at next reboot, if you want to set it permane...
Cannot set CPU to maximum speed
1,456,446,514,000
When booting a kernel in an embedded device, you need to supply a device tree to the Linux kernel, while booting a kernel on a regular x86 pc doesn't require a device tree -- why? As I understand, on an x86 pc the kernel "probes" for hardware (correct me if I'm wrong), so why can't the kernel probe for hardware in and...
Peripherals are connected to the main processor via a bus. Some bus protocols support enumeration (also called discovery), i.e. the main processor can ask “what devices are connected to this bus?” and the devices reply with some information about their type, manufacturer, model and configuration in a standardized form...
Why do embedded systems need device tree while pcs don't?
1,456,446,514,000
I am using an embedded Arm with a Debian build. How does one list the compiled devices from the device tree? I want to see if a device is already supported. For those reading this, the "Device Tree" is a specification/standard for adding devices to an (embedded) Linux kernel.
The device tree is exposed as a hierarchy of directories and files in /proc. You can cat the files, eg: find /proc/device-tree/ -type f -exec head {} + | less Beware, most file content ends with a null char, and some may contain other non-printing characters.
How to list the kernel Device Tree [duplicate]
1,456,446,514,000
I'm working with TS-4900, an embedded 'Computer on Module' plugged into a baseboard, running Yocto Linux. It uses U-Boot to start, and supposedly basing on the model of the baseboard it chooses the right dtb file to start, and possibly if it fails to locate the right one it falls back to a 'generic' one for my module....
I'm way late on this, but I implemented this script and I'll address this for anyone who finds this using an internet search engine. This computer on module can be put on almost any off the shelf TS or custom baseboard, and we wanted it to automatically work without users having to adjust the device tree used. We hav...
How do I tell which device tree blob (dtb file) I'm using?
1,456,446,514,000
I am trying to figure out why the following device is not setup to its driver on my Creator CI20. For reference I am using a Linux kernel v4.13.0 and doing the compilation locally: make ARCH=mips ci20_defconfig make -j8 ARCH=mips CROSS_COMPILE=mipsel-linux-gnu- uImage From the running system I can see: ci20@ci20:~# f...
A working solution to get the driver to bind to the device is: cgublock: jz4780-cgublock@10000000 { compatible = "simple-bus", "syscon"; #address-cells = <1>; #size-cells = <1>; reg = <0x10000000 0x100>; ranges; cgu: jz4780-cgu@10000000 { compatible = "ingenic,jz4780-cgu"; re...
How to debug a driver failing to bind to a device on Linux?
1,456,446,514,000
My board boots via U-Boot and AFAIK that bootloader does not support device tree overlays, so I'm probably forced to generate a single, static .dtb will all relevant overlays (and settings??) already applied to it. In principle that would be okay for me, but how to do that? Is there some command line tool that takes ....
You don't need to do this. With this change, overlays are in u-boot! https://github.com/u-boot/u-boot/commit/e6628ad7b99b285b25147366c68a7b956e362878 Enjoy :)
how to merge device tree overlays to a single .dtb at build time?
1,456,446,514,000
I was asking myself if a certain dtb that works with linux kernel version 3.18 is compatible with a linux kernel version 4.9. I suppose not, because kernel code concerning the device tree likely changes over the time, but it somehow has to be compatible otherwise multiple dts/dtsi files have to change all the time. I...
The Device Tree is supposed to be a stable ABI so a device tree written for any version of the kernel should work with any following kernel version. However, for practical reasons, this is quite often not the case. You can have a look at the following presentation from Thomas, explaining why: http://free-electrons.com...
Is a device tree blob tied to a specific linux kernel version?
1,456,446,514,000
I'm using a DTS file for a Duovero Parlor board. To this board I've added some SPI devices. My first (a display) works perfectly so I have that entry correct at least. I want to add an entry to support the SPI connected NXP SC16IS752 UART controller. (There's been a patches on lkml recently I want to try). This is my ...
The issue with your clocks, is that clocks declared outside the TI clock domains are not parsed and set up correctly in 3.17. This issue is resolved in kernel version 4.0.5. The required changes occurred in the function omap_clk_init at the end of /arch/arm/mach-omap2/io.c, there is an extra call there to of_clk_init(...
Clocks entry in SPI device tree entry
1,456,446,514,000
(On raspberry pi zero w, kernel 4.14y) It seems the wireless adapter chip isn't a device in the /dev fs, but is the name of something that 'ifconfig' knows about. I understand that this is an artifact from Berkley Sockets. It is hardware, I assume it must be mentioned in the device tree -- to cause some driver to b...
In Linux, network interfaces don't have a device node in /dev at all. If you need the list of usable network interfaces e.g. in a script, look into /sys/class/net/ directory; you'll see one symbolic link per interface. Each network interface that has a driver loaded will be listed. Programmatically, you can use the i...
How does Linux find/configure something like 'wlan0' when it is not a device that appears in /dev?
1,456,446,514,000
I am trying to make work my finger print sensor thinkpad x390 yoga. I installed printfd package using yay. When I try to run fprintd-enroll, I get this error: Using device /net/reactivated/Fprint/Device/0 failed to claim device: GDBus.Error:net.reactivated.Fprint.Error.Internal: Open failed with error: The driver enco...
The solution was to update firmware of fingerprint device. I achieved by: Installing fwupd sudo pacman -S fwupd Check if system can see device: fwupdmgr get-devices Refresh firmware database: fwupdmgr refresh --force Updating my firmware: fwupdmgr update You have to reboot immediatlly to apply update and p...
fprintd: The driver encountered a protocol error with the device
1,456,446,514,000
I have a situation in which same device trees are used with different kernels. Can the device trees be build only once and used with all kernels? The reason I ask this is because I found the device tree compiler having a separate repository that the kernel. Also the explanation from this answer doesn't relate device t...
After being in a situation where this could be tested I've witnessed that you can't use a device tree compiled for kernel 3.10 on kernel 3.14. and vice versa.
Is the device tree compiler tied to the kernel version?
1,456,446,514,000
I am attempting to review my device tree to learn more about how the usb endpoints are defined, and also just to learn more about device trees. I am currently using a BeagleBone Black image, and I believe I am booting from the am335x-boneblack-uboot-univ.dtb device tree blob. Below you can see the output my device giv...
The 'dtsi' file you are seeking is in the actual source directory. Not the boot mount. In this case right now the 'dtsi' file is 'compiled into' the 'dtb' files. They function like C header files and are "prepended" to 'dts' files which are then compiled into 'dtb'. In the case of arm, in the linux source,look under a...
Where can I find the device tree source include (.dtsi) files?
1,456,446,514,000
On Solaris I know disk are c0d0p0 or c0d0s0 for ide, c1t1d1s0 for scsi. I see there are links on pci devices,for example: ls -lh /dev/dsk/c0d0s7 lrwxrwxrwx 1 root root 50 ago 1 22:53 /dev/dsk/c0d0s7 -> ../../devices/pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0:h Someone know what does it mean pci@0,0/pci-ide@1...
cmdk@0,0:h is the driver instance for a disk. Per the Solaris documentation: The cmdk device driver is a common interface to various disk devices. The driver supports magnetic fixed disks and magnetic removable disks.
Reading the device tree for ide disks
1,456,446,514,000
I know KConfig serves to tune the C preprocessor, at the start of the Linux kernel compilation. And that the device tree is used to give a compiled kernel a description about hardware at runtime. How do these two configurability features overlap? Both give information about intrinsic CPU details and drivers for extern...
A compile-time kernel configuration can specify whether or not include each of the standard drivers included in the kernel source tree, how those drivers will be included (as built-in or as loadable modules), and a number of other parameters related to e.g. what kind of optimizations and other choices will be used in ...
How does kbuild compare to the device tree?
1,471,535,621,000
I'm in the process of porting the embedded system for a picozed-based platform from the Xilinx-v2013.4 (3.12 kernel) to the Xilinx-v2016.2 (4.4 kernel). The former version still makes use of an initial RAM disk (initrd) while the new uses an initial RAM fs (initramfs). At boot time, the console is given through the s...
Solution found ! Add the definition of the standard output in the device tree (in the chosen section) : linux,stdout-path = "serial0:115200n8"; where serial0 points to my serial interface Unset the virtual terminal console in the kernel configuration (in order to avoid a kind of precedence of this driver) : CONFI...
Console setting in initramfs (ARM)
1,471,535,621,000
We run a customized version of U-Boot on an ARM-based embedded system and would like to load Linux 4.3 with a device tree blob. The system features 1GB of RAM of which the top 128MB are reserved for persistent storage. I use tftp to copy the kernel and the DTB into certain memory locations (kernel: 0x02000000, DTB: 0x...
So one of the ways to fix this is to make use of a few additional environment variables. If we look in include/configs/ti_armv7_common.h we have: /* * We setup defaults based on constraints from the Linux kernel, which should * also be safe elsewhere. We have the default load at 32MB into DDR (for * the kernel), ...
FDT relocated by U-Boot cannot be accessed by Linux (in highmem)
1,471,535,621,000
We are trying to get an SDIO-based 802.11 module to work on an SDIO port of the beaglebone. We adapted the device-tree overlay provided by manufacturer to our hardware, compiled the driver, the driver can even be loaded successfully and I see it with lsmod, but no interface shows up. Now I have a missing link in my un...
Okay, I found this page which guides me through the basic troubleshooting steps. This was what I was looking for. If you care for our problem itself: Obviously, muxing the pins as MMC (as described in our user's guide) is not sufficient, the bus needs to be declared as being SDIO in the device-tree. Now I can continue...
How to debug an SDIO configuration problem?
1,471,535,621,000
When I have some Linux distribution installed on a x64 system, for example I can pretty much unplug my storage drive put it into another x64 machine, install a few HL drivers, like the graphics driver and it will most likely run without any hassle. When it comes to ARM systems, especially ARM SoCs, like smartphones of...
I ask myself why there isn't a way to put the device tree, as the hardware description, together with the bootloader on some ROM chip and build the Linux OS independently from any hardware specs, at least within some defined limits. Answer: Cheapness. Nobody wants to pay for the ROM chip. The SoC has a boot ROM in ...
Why are ARM SoCs so seemingly hard to handle with the Kernel?
1,471,535,621,000
Why do I want this? I use the pwm-ir-tx kernel module to blast IR signals from my embedded device. However, when the pwm kernel module is loaded during the boot process, the pin is on high. It takes about 10 seconds or so until I can set it to low with a lirc irsend signal. You can in principle 'overload' the IR-LED...
Create an udev rule to match it. It shouldn't be necessary to run the script "after a module is loaded" – it deals with a specific device, so it would be better to run it "after the device is detected". Doesn't matter how the device was detected; as long as the kernel reports it as a 'new' device, it'll work. That sai...
Run script after module is loaded due to device tree
1,471,535,621,000
I using Buildroot trying to build a Linux image for the Raspberry Pi 3 in which I have access to pulse-per-second (PPS) inputs on one of the GPIO pins. First off, I have tried this with the standard Raspbian distribution and got it to work with the following changes: Add dtoverlay=pps-gpio,gpiopin=20 to /boot/config....
Turns out what was missing was to in make nconfig also select: Kernel -> Build Device Tree with overlay support Also, in the file <buildroot>/board/raspberrypi3-64/genimage-raspberrypi3-64.cfg add the pps-gpio.dtbo file so that the image boot.vfat section looks like this: image boot.vfat { vfat { files = { ...
PPS GPIO with Buildroot image on Raspberry Pi 3
1,471,535,621,000
I get the following warning on debian linux (kernel 4.18.8) bootup of my microchip sama5d3 board: mmc0: unrecognised SCR structure version 4 mmc0: error -22 whilst initialising SD card after spewing this about 30 times I get the following and the linux boot completes mmc0: host does not support reading read-only swi...
Updating to kernel 4.20 the error no longer appears. I can't determine exactly which kernel commit fixed it. There are a few that might have played a roll, but nothing I could identify as an exact fit.
mmc0 warning on SD card bootup of linux
1,471,535,621,000
I'm trying to setup a device tree source file for the first time on my custom platform. On the board is a NXP PCA9555 gpio expander. I'm attempting to setup node for the device and am a bit confused. Here is where I'm at with the node in the dts file: ioexp0: gpio-exp@21 { compatible = "nxp,pca9555"; r...
Read section 2 in this: Specifying interrupt information for devices ... 2) Interrupt controller nodes A device is marked as an interrupt controller with the "interrupt-controller" property. This is a empty, boolean property. An additional "#interrupt-cells" property defines the number of cells needed to specify ...
Confusion regarding #interrupt-cells configuration on PCA9555 expander
1,471,535,621,000
I have a problem: my device (an Atmel SAMA5D27 Xplained board) won't boot after my attempt to flash a new device tree. Here's what I did (details are at the end of this message): I downloaded the Linux4SAM source tree from Github (tag linux4sam_5.3). I used this tag since that is the one that was installed when I got...
User error. I found that SAM-BA also has a verification method: # sam-ba -p serial:ttyACM0:115200 -b sama5d2-xplained -a serialflash -c verify:at91-sama5d2_xplained_custom.dtb:0x70000 Opening serial port 'ttyACM0' Connection opened. Detected memory size is 4194304 bytes. Executing command 'verify:at91-sama5d2_xplained...
U-boot could not find a valid device tree
1,471,535,621,000
I have been working on a Altera DE1-SoC Development Board for 8 months. The system I was working on includes a Cyclone V FPGA chip, particularly the 5CSEMA5F31C6N. It was running an embedded Linux operating system on chip. All was well and development was on-going. Two weeks ago, a new custom board was put together by...
Thanks for the reply. This issue has been resolved. On the development board we are using a 50Mhz oscillator to provide a clock to the HPS peripherals, while a 25MHz signal is generated from that same 50Mhz clock which is then connected to the HPS clock pin on the fabric. On the new board, we have not used the 50Mhz o...
Why does linux freezes when trying to access peripherals connected to the lightweight hps-to-fpga bridge (or any bridge)?
1,471,535,621,000
On my embedded System I enabled the CONFIG_CONFIGFS_FS=y to have access to the configFS. When booted, I mounted it with help of mount -t configfs none /sys/kernel/config. That works like charm: # mount | grep configfs configfs on /sys/kernel/config type configfs (rw,relatime) Now I try to create a folder device-tree,...
My problem was, that I used the mainline Kernel 6.1 (LTS) that does not support CONFIG_OF_CONFIGFS. So I downloaded a dtbo-configfs devicedriver from here: https://github.com/ikwzm/dtbocfg, compiled it and loaded it into the kernel. Then after mounting the configfs, I already had the device-tree directory available.
mkdir in configfs not permitted
1,471,535,621,000
I currently attempting to implement the mma8452 driver for my mma8451Q accelerometer by adding it to the the Linux Device Tree. Currently I am taking the route of creating a device tree overlay file (dtbo) that contains the addition to the device tree describing the accelerometer. It loads properly at boot and correct...
The solution was to target the correct i2c bus the Accelerometer was connected to. This ended up being i2c2, not i2c0. This solved my issue. The correct dtbo file can be seen below: /* * MIRA custom cape device tree overlay * Supports MMA8451Q Accelerometer */ /dts-v1/; /plugin/; #include <dt-bindings/interrupt-...
How to implement i2c device in Device Tree?
1,471,535,621,000
I have tried to get PWM working and am not having any success. I am using the TI Processor SDK with a modified version of the am335x-boneblack.dts device tree (see below) The PWM driver (ehrpwm1) probes correctly and appears in /sys/class/pwm/pwmchip0. Then, I configured the chip cd /sys/class/pwm/pwmchip0 echo 0 > ex...
The problem was in this section &ehrpwm1 { pinctrl-name = "default"; pinctrl-0 = <&backlight_pin>; status = "okay"; }; pinctrl-name should have been pinctrl-names (note the "s" on the end)
How do I configure the Beaglebone Black PWM correctly
1,471,535,621,000
I would like to have the default for certain input pins be a weak pulldown. I am using a sama5d36 running Debian 4.12.8. I modified the dts file as follows: ahb { abp { pinctrl@fffff200 { board { pinctrl_inputs: input_pins { atmel,pins = ...
Setting up a node in the device tree (dts) requires a compatible node like gpio-keys or gpio-leds. You can't just make up a node like I was trying to do. since the line I need is part of SPI BLE I added it to my spi1 node as follows: spi1: spi@f8008000 { cs-gpios = <0>, <0>, <0>, <0>; ...
Want pulldown on gpio pin
1,442,499,868,000
I just received a new USB flash drive, and set up 2 encrypted partitions on it. I used dm-crypt (LUKS mode) through cryptsetup. With an additional non-encrypted partition, the drive has the following structure: /dev/sdb1, encrypted, hiding an ext4 filesystem labelled "Partition 1". /dev/sdb2, encrypted, hiding anothe...
For a permanent solution to change the label of the container, use: sudo cryptsetup config /dev/sdb1 --label YOURLABEL Edit: Notice that labeling only works with Luks2 headers. In any case, it is possible to convert a Luks1 header into Luks2 with: sudo cryptsetup convert /dev/sdb1 --type luks2 OBS: Please notice th...
How can I set a label on a dm-crypt+LUKS container?
1,442,499,868,000
I am investigating a problem where encrypting a block device imposes a huge performance penalty when writing to it. Hours of Internet reading and experiments did not provide me with a proper understanding, let alone a solution. The question in short: Why do I get perfectly fast write speeds when putting a btrfs onto a...
The answer (as I now know): concurrency. In short: My sequential write, either using dd or when copying a file (like... in daily use), becomes a pseudo-random write (bad) because four threads are working concurrently on writing the encrypted data to the block device after concurrent encryption (good). Mitigation (for ...
Abysmal general dm-crypt (LUKS) write performance
1,442,499,868,000
I tried to setup TRIM with LVM and dm-crypt on ubuntu 13.04 following this tutorial: http://blog.neutrino.es/2013/howto-properly-activate-trim-for-your-ssd-on-linux-fstrim-lvm-and-dmcrypt/ See the notes about my configuration and my testing procedure below. Questions Is there a reliable test if TRIM works properly? ...
I suggest using a different testing method. hdparm is a bit weird as it gives device addresses rather than filesystem addresses, and it doesn't say which device those addresses relate to (e.g. it resolves partitions, but not devicemapper targets, etc.). Much easier to use something that sticks with filesystem addresse...
Trim with LVM and dm-crypt
1,442,499,868,000
My system is fully encrypted with dm-crypt and LVM. I recently moved the encrypted partition from /dev/sda5 to /dev/sda2. My question is: how can I change the name the encrypted partition is mapped to from sda5_crypt to sda2_crypt? I can boot the system all right. But the prompt I get at boot time says (sda5_crypt) th...
"sda5_crypt" crypttab change as per suggestion below: Replace OLD_NAME with NEW_NAME in /etc/crypttab & /etc/fstab, and then: # dmsetup rename OLD_NAME NEW_NAME # cp -a /dev/mapper/NEW_NAME /dev/mapper/OLD_NAME # update-initramfs -u -k all # rm /dev/mapper/OLD_NAME # update-grub # reboot
How to change the name an encrypted full-system partition is mapped to
1,442,499,868,000
How can I change the hash-spec and iter-time of an existing dm-crypt LUKS device? Clearly I can pass the options if I create a new device, for example something like this: sudo cryptsetup luksFormat --cipher aes-cbc-essiv:sha256 --key-size 256 --iter-time 2100 --hash sha512 /dev/loop0 But if the device already exist...
Each key slot has its own iteration time. If you want to change the number of iterations, create a new slot with the same passphrase and a new number of iterations, then remove the old slot. cryptsetup -i 100000 --key-slot 2 luksAddKey $device cryptsetup luksKillSlot $device 1 I think the hash algorithm cannot be con...
How to change the hash-spec and iter-time of an existing dm-crypt LUKS device?
1,442,499,868,000
The LUKS / dm-crypt / cryptsetup FAQ page says: 2.15 Can I resize a dm-crypt or LUKS partition? Yes, you can, as neither dm-crypt nor LUKS stores partition size. I'm befuzzled: What is "resized" if no size information is stored? How does a "resize" get remembered across open / closes of a encrypted volume?
It's about online resize. For example if you use LVM, create a LV of 1G size, and put LUKS on that, it's like this: # lvcreate -L1G -n test VG # cryptsetup luksFormat /dev/mapper/VG-test # cryptsetup luksOpen /dev/mapper/VG-test lukstest # blockdev --getsize64 /dev/mapper/VG-test 1073741824 # blockdev --getsize64 /dev...
What does `cryptsetup resize` do if LUKS doesn't store partition size?
1,442,499,868,000
I try to setup Fedora 25 with dm-crypt and LVM, but struggle to make TRIM work. $ sudo fstrim -av /boot: 28.6 MiB (30003200 bytes) trimmed /: 56.5 GiB (60672704512 bytes) trimmed $ sudo fstrim -av ...
I think your testing does not match the documentation (man fstrim). -v, --verbose Verbose execution. With this option fstrim will output the number of bytes passed from the filesystem down the block stack to the device for potential discard. This number is a maximum discard amount from the stora...
fstrim doesn't seem to trim a partition that uses lvm and dm-crypt
1,442,499,868,000
I created an encrypted container via #!/bin/bash dd if=/dev/zero of=$1 bs=1 count=0 seek=$2 MAPPER=$(mktemp -up /dev/mapper) LOOPDEV=$(losetup --find --show $1) cryptsetup luksFormat $LOOPDEV cryptsetup luksOpen $LOOPDEV $(basename $MAPPER) mkfs.ext3 $MAPPER cryptsetup luksClose $MAPPER losetup -d $LOOPDEV i.e. a fil...
In fact, modifying mount is possible, as I learned from the existence of mount.ntfs-3g. I'm doing only guesswork, but I suspect mount -t sometype results in a call to mount.sometype $DEV $MOUNTPOINT $OPTIONS, feel free to correct me here or quote some actual documentation. Especially the option -o loop is already trea...
How to mount a cryptsetup container just with `mount`?
1,442,499,868,000
I'm trying to change a partition's UUID, the problem is that I'm trying to change an encrypted volume. So I can't use the usual method described here. Since it throws the following error: tune2fs: Bad magic number in super-block while trying to open /dev/sda1 Couldn't find valid filesystem superblock. So let's suppos...
For changing the file system UUID you have to decrypt /dev/sda1 and then run tune2fs on the decrypted device mapper device. sda1 itself does not have a UUID thus it cannot be changed. The LUKS volume within sda1 does have a UUID (which is of limited use because you probably cannot use it for mounting), though. It can ...
Change encrypted partition UUID
1,442,499,868,000
I decided to encrypt my root partition with LUKS+LVM. My ThinkPad setup: Samsung 830 128GB SSD 750GB HDD Core 2 Duo 2,5 GHz P9500 8GB RAM But the more I read, the less I understand about those two following subjects: 1a. The cipher I was going to use SHA1 instead of 2/512 (as some suggest), because of that quote fro...
1a - it really doesn't matter all that much. which ever hash you use for the key derivation function, LUKS makes sure it will be computationally expensive. It will simply loop it until 1 second real time has passed. 1b - the key derivation method has no influence on performance. the cipher itself does. cryptsetup benc...
Trying to understand LUKS encryption
1,442,499,868,000
Encryption/decryption is often the main bottleneck when accessing an encrypted volume. Would using a filesystem with a fast transparent compression (such as BTRFS + LZO) help? The idea is that there would be less data to encrypt, and if the compression is significantly faster than the encryption algorithm, the overal...
I did a small benchmark. It only tests writes though. Test data is a Linux kernel source tree (linux-3.8), already unpacked into memory (/dev/shm/ tmpfs), so there should be as little influence as possible from the data source. I used compressible data for this test since compression with non-compressible files is non...
Will using a compressed filesystem over an encrypted volume improve performance?
1,442,499,868,000
cryptsetup can be invoked with --readonly or -r option, which will set up a read-only mapping: cryptsetup --readonly luksOpen /dev/sdb1 sdb1 Once I have opened a device as read-only, can I later re-map it to read-write? Obviously, I mean mapping it read-write without closing it first, and then opening it again. Can I...
It doesn't seem to be possible with the cryptsetup command. Unfortunately cryptsetup has a few such immutable flags... --allow-discards is also one of them. If this wasn't set at the time you opened the container, you can't add it later. At least, not with the cryptsetup command. However, since cryptsetup creates regu...
remap read-only LUKS partition to read-write
1,442,499,868,000
I'm confused between the various ways that LUKS/dmcrypt/cryptsetup discard /TRIM operations can be enabled via the Linux kernel command line. The dracut manpage: rd.luks.allow-discards Allow using of discards (TRIM) requests on all LUKS partitions. The systemd-cryptsetup-generator manpage luks.options=, rd.luks.op...
It depends a little on the distribution you are using and what components are included by dracut in the initramfs. For example, the cryptdevice= option is interpreted by the encrypt hook. Thus, it's only relevant for initramfs images that include this hook. The disadvantage of rd.luks.allow-discards and rd.luks.allow-...
LUKS discard/TRIM: conflicting kernel command line options
1,442,499,868,000
Suppose I want an Ubuntu setup (let it be 12.04) with full disk encryption. Ubuntu offers this as an option during installation. Suppose also that I have somebody (e.g. my vendor) else set this up for me and that I only get the finished system including the predefined encryption password (and of course all other passw...
Yes, of course. The vendor can just keep the master key. A backup of the LUKS header. As this key never changes even as you change the password, it allows full access to all the data. So you are entirely depending on trust here. Backdoors and everything else just come on top of that. In addition to the manpage, the Cr...
Security of an encrypted (dm-crypt & LUKS) Ubuntu 12.04 installed by somebody else?
1,442,499,868,000
At boot I see: :: running hook [encrypt] A password is required to access the volume: Command requires device and mapped name as arguments Command requires device and mapped name as arguments Command requires device and mapped name as arguments The final message repeats every second. There is no opportunity for me ...
You've probably forgotten to include the required cryptdevice mapped name in the kernel command line parameter. I had: cryptdevice=/dev/sdaX However, the second colon-separated field is mandatory, eg: cryptdevice=/dev/sdaX:root If you're using an SSD, and have understood the implications, for increased performance you...
LUKS password not being requested by dmcrypt / encrypt hook at boot
1,442,499,868,000
I'm running Arch Linux with systemd boot. In /boot/loader/entries/arch.conf I currently specify the luks crypto device with a line like this: options rw cryptdevice=/dev/sda1:ABC root=/dev/mapper/ABC I know I can also use UUID instead of /dev/sda1. In that case the kernel options line would look like this: opt...
If you're already using the new LUKS2 format, you can set a label: For new LUKS2 containers: # cryptsetup luksFormat --type=luks2 --label=foobar foobar.img # blkid /dev/loop0 /dev/loop0: UUID="fda16145-822e-405c-9fe8-fe7e7f0ddb5e" LABEL="foobar" TYPE="crypto_LUKS" For existing LUKS2 containers: # cryptsetup config --...
How to specify cryptdevice by label using systemd boot?
1,442,499,868,000
I'm using arch linux with an encrypted luks root partition (boot unencrypted), with a passphrase yet. Now I have a keyfile (3072 bytes), that's written to USB-Stick this way: sudo dd if=tempKeyFile.bin of=/dev/sdd bs=512 seek=1 count=6 and also set as additional pass sudo cryptsetup luksAddKey /dev/sdb6 tempKeyFile.bi...
From the ArchLinux encrypt hook (/lib/initcpio/hooks/encrypt): *) # Read raw data from the block device # ckarg1 is numeric: ckarg1=offset, ckarg2=length dd if="$resolved" of="$ckeyfile" bs=1 skip="$ckarg1" count="$ckarg2" >/dev/null 2>&1 ;; So while it supports reading a key from a raw block device, ...
Using space before 1st partition of USB-Stick as luks key
1,442,499,868,000
One day, when I turned on the computer, my passphrase for home part /dev/sda7 doesn't worked (I am 147% absolutely sure, that I was writing right pass)! After three times of tries, I have rebooted computer via force shutdown and tried to enter the same pass. That didn't worked. Then instead of default boot "Boot arch"...
If there is corruption in the LUKS header (more than just a single byte), it's pretty much impossible to recover. The LUKS header does not have a checksum for its key material, so - if it's damaged in any way, the cryptsetup luksDump will look same as always, but your passphrase simply won't work anymore. If you're un...
LUKS passphrase doesn't work
1,442,499,868,000
I want to encrypt the content of a directory in a container with an ext4 filesystem using cryptsetup. The size of the container should be as small as possible and as big as necessary, because I only want to write once and then backup. First try: setting the size of the container to the size of the content. dirsize=$(d...
LUKS by default uses 2 MiB for its header, mainly due to data alignment reasons. You can check this with cryptsetup luksDump (Payload offset: in sectors). If you don't care about alignment, you can use the --align-payload=1 option. As for ext4, it's complicated. Its overhead depends on the filesystem size, inode size,...
How much storage overhead comes along with cryptsetup and ext4?
1,442,499,868,000
Disk/Partition Backup What are the backup options and good practice to make a solid and easy to use full system backup? With the following requirement: Live backup Image backup Encrypted backup Incremental backups Mount/access the backup disk/files easily Full system backup, restorable in one shot Can be scheduled au...
Linux system backup When targeting a true full system backup, disk image backup (as asked) offer substantial advantage (detailed bellow) compared to files based backup. With files based backup disk/partition structure is not saved; Most of the time for a full restore, the process is a huge time consumer in fact many ...
Serious backup options for linux disk (dmcrypt, luks, ext4, ext3, btrfs) normal and encrypted system
1,442,499,868,000
I've created an encrypted root partition using LUKS which contains a few LVM partitions. I can't boot and get the following output on startup: Begin mounting root file system ... Begin: Running /scripts/local-top ... /scripts/local-top/cryptroot: line 1: /sbin/cryptsetup: not found It still prompts me for the passwor...
Evidently, I didn't create a /etc/crypttab file. Create one, then update-initramfs -u to fix the issue.
/sbin/cryptsetup not found on boot
1,442,499,868,000
I have full disk encryption on my arch linux laptop. When i power on the machine it prompts me for my disk password. My system is encrypted by following the LVM on luks archwiki page. the prompt says something like "a password is required for the cryptlvm volume" i would like to change this to feature some imformation...
I found out that that you can make a custom initramfs module with mkinitcpio that prints out such information. Ensure you follow this correctly, otherwise your kernel will panic. To do so, you can create files under: /usr/lib/initcpio/hooks/MODULENAME /usr/lib/initcpio/install/MODULENAME /usr/lib/initcpio/install/M...
custom prompt for system encryption password entry on startup
1,442,499,868,000
I have some encrypted volumes that I use with my Xubuntu machine. One volume is a container file that is mapped to /dev/loop0 and encrypted using plain dm-crypt; another volume is a USB hard drive encrypted using dm-crypt/LUKS. What I'd like to know is what would happen if I accidentally shut down the computer without...
The short answer is that encrypted volumes are not really more at risk. The encrypted volumes have a single point of failure in the information at the beginning of the volumes that maps the password (or possibly several passwords for systems like LUKS) to the encryption key for the data. (That is why it is a good ide...
Are encrypted volumes more vulnerable to power loss?
1,442,499,868,000
I notice that if a device mapping is created with the low-level dmsetup or through ioctls, the device mapping will no longer be there after reboot. Is this normal? I am using a USB to test out dm_crypt If it is normal, how do I go about making the mapping stay around? Do I need to look into udev? Thanks! Edit for c...
Not 100% I understand what you mean by mapping but, Yes this seems normal. You need to add the device to either /etc/crypttab or /etc/fstab like you would to mount any other drive. https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#crypttab ^ Should have the information you're looking for.
How to make device mappings stay after reboot?