date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,356,020,314,000 |
I accidentally overwrote my /dev/sda partition table with GParted (full story on AskUbuntu). Since I haven't rebooted yet and my filesystem is still perfectly usable, I was told I might be able to recover the partition table from in-kernel memory. Is that possible? If so, how do I recover it and restore it?
|
Yes, you can do this with the /sys filesystem.
/sys is a fake filesystem dynamically generated by the kernel & kernel drivers.
In this specific case you can go to /sys/block/sda and you will see a directory for each partition on the drive. There are 2 specific files in those folders you need, start and size. start con... | How to read the in-memory (kernel) partition table of /dev/sda? |
1,356,020,314,000 |
How to detect if isolcpus is activated and on which cpus, when for example you connect for the first time on a server.
Conditions:
not spawning any process to see where it will be migrated.
The use case is that isolcpus=1-7 on a 6 cores i7, seems to not activate isolcpus at boot, and i would like to know if its possi... |
What you look for should be found inside this virtual file:
/sys/devices/system/cpu/isolated
and the reverse in
/sys/devices/system/cpu/present // Thanks to John Zwinck
From drivers/base/cpu.c we see that the source displayed is the kernel variable cpu_isolated_map:
static ssize_t print_cpus_isolated(struct devic... | how to detect if isolcpus is activated? |
1,356,020,314,000 |
I woke up this morning to a notification email with some rather disturbing system log entries.
Dec 2 04:27:01 yeono kernel: [459438.816058] ata2.00: exception Emask 0x0 SAct 0xf SErr 0x0 action 0x6 frozen
Dec 2 04:27:01 yeono kernel: [459438.816071] ata2.00: failed command: WRITE FPDMA QUEUED
Dec 2 04:27:01 yeono ... |
I wrote one-liner based on Tobi Hahn answer.
For example, you want to know what device stands for ata3:
ata=3; ls -l /sys/block/sd* | grep $(grep $ata /sys/class/scsi_host/host*/unique_id | awk -F'/' '{print $5}')
It will produce something like this
lrwxrwxrwx 1 root root 0 Jan 15 15:30 /sys/block/sde -> ../devices/p... | Given a kernel ATA exception, how to determine which physical disk is affected? [duplicate] |
1,356,020,314,000 |
I want to make "echo 1 > /sys/kernel/mm/ksm/run" persistent between boots. I know that I can edit /etc/sysctl.conf to make /proc filesystem changes persist, but this doesn't seem to work for /sys. How would I make this change survive reboots?
|
Most distros have some sort of an rc.local script that you could use. Check your distro as names and path may vary. Normally expect to look under /etc.
| Make changes to /sys persistent between boots |
1,356,020,314,000 |
I am trying to run an update of freebsd10 and I am being asked for the kernel sources
===>>> Launching child to update lsof-4.89.b,8 to lsof-4.89.d,8
===>>> All >> lsof-4.89.b,8 (9/9)
===>>> Currently installed version: lsof-4.89.b,8
===>>> Port directory: /usr/ports/sysutils/lsof
===>>> This port is marked... |
You can do it:
git clone https://github.com/freebsd/freebsd.git /usr/src
cd /usr/src; make clean
| How do you install the FreeBSD10 kernel sources? |
1,356,020,314,000 |
I've been trying to understand the booting process, but there's just one thing that is going over my head..
As soon as the Linux kernel has been booted and the root file system (/) mounted, programs can be run and further kernel modules can be integrated to provide additional functions. To mount the root file system,... |
Nighpher, I'll try to answer your question, but for a more comprehensive description of boot process, try this article at IBM.
Ok, I assume, that you are using GRUB or GRUB2 as your bootloader for explanation. First off, when BIOS accesses your disk to load the bootloader, it makes use of its built-in routines for dis... | How does Linux load the 'initrd' image? |
1,356,020,314,000 |
Imagine there's a company A that releases a new graphics adapter. Who manages the process that results in this new graphics adapter being supported by the Linux kernel in the future? How does that proceed? I'm curious how kernel support for any new hardware is handled; on Windows companies develop drivers on their own... |
Driver support works the same way as with all of open source: someone decides to scratch their own itch.
Sometimes the driver is supplied by the company providing the hardware, just as on Windows. Intel does this for their network chips, 3ware does this for their RAID controllers, etc. These companies have decided tha... | How is new hardware support added to the linux kernel? |
1,356,020,314,000 |
I would like to understand the term "system call". I am familiar that system calls are used to get kernel services from a userspace application.
The part i need clarification with is the difference between a "system call" and a "C implementation of the system call".
Here is a quote that confuses me:
On Unix-like sys... |
System calls per se are a concept. They represent actions that processes can ask the kernel to perform.
Those system calls are implemented in the kernel of the UNIX-like system. This implementation (written in C, and in asm for small parts) actually performs the action in the system.
Then, processes use an interface ... | What is meant by "a system call" if not the implementation in the programing language? |
1,356,020,314,000 |
I read through this popular IBM doc (I see it referred quite often on the web) explaining the function of the initial RAM disk.
I hit a wall in conceptualizing how this works though.
In the doc it says
The boot loader, such as GRUB, identifies the kernel that is to be
loaded and copies this kernel image and any as... |
The entire kernel is loaded into memory at boot, typically along with an initramfs nowadays. (It is still possible to set up a system to boot without an initramfs but that's unusual on desktops and servers.)
The initramfs's role is to provide the functionality needed to mount the "real" filesystems and continue bootin... | Is the entire kernel loaded into memory on boot? |
1,356,020,314,000 |
My server has two 1-Gbit and two 10-Gbit onboard network cards.
I need to disable the 1-Gbit network cards completely, so that ifconfig -a does not show them.
The network cards use different kernel modules. The 10-Gbit use ixgbe, and the 1-Gbit use igb.
01:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit... |
You should be able to blacklist the igb “module”, even when built-in, by blacklisting its initialisation function: add
initcall_blacklist=igb_init_module
to your kernel’s boot parameters.
See How do I disable I2C Designware support when it's not built as a module? for background information. The general recipe here i... | disable kernel module which is compiled in kernel (not loaded) |
1,356,020,314,000 |
Is there a site someplace that lists the contents of /proc and what each entry means?
|
The documentation for Linux's implementation of /proc is in Documentation/filesystems/proc.txt in the kernel documentation.
Beware that /proc is one of the areas where *ixes differ most. It started out as a System V specific feature, was then greatly extended by Linux, and is now in the process of being deprecated by... | Where are the contents of /proc of the Linux kernel documented? |
1,356,020,314,000 |
My question is why nowadays some operating system event handling is still written in assembly language instead of a higher level language such as C, when the kernel itself is written mostly in C?
|
The language abstracts away access to CPU registers, and an OS when handling events has to save context, so it needs access to the registers at the point of the event, thus breaking the C spec.
| Why some operating systems event handling is written in asm instead of c? |
1,356,020,314,000 |
How to add more /dev/loop* devices on Fedora 19? I do:
# uname -r
3.11.2-201.fc19.x86_64
# lsmod |grep loop
# ls /dev/loop*
/dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/loop-control
# modprobe loop max_loop=128
# ls /dev/loop*
/dev/loop0 /dev/loop1 /dev/loop2 ... |
You have to create device nodes into /dev with mknod. The device nodes in dev have a type (block, character and so on), a major number and a minor number. You can find out the type and the major number by doing ls -l /dev/loop0:
user@foo:/sys# ls -l /dev/loop0
brw-rw---- 1 root disk 7, 0 Oct 8 08:12 /dev/loop0
This ... | How to add more /dev/loop* devices on Fedora 19 |
1,356,020,314,000 |
I'm interested in theoretical limits, perhaps with examples of systems having huge numbers of CPU's.
|
At least 2048 in practice. As a concrete example, SGI sells its UV system, which can use 256 sockets (2,048 cores) and 16TB of shared memory, all running under a single kernel. I know that there are at least a few systems that have been sold in this configuration.
According to SGI:
Altix UV runs completely unmodifi... | How many cores can Linux kernel handle? |
1,356,020,314,000 |
I have always found it difficult to find information about the system itself in Unix, whether it be
Which OS I am using (version number and all, to compare it with the latest available builds)?
Which Desktop Environment am I using? If I am using KDE, most of the programs begin with a K and I can say I am using KDE, b... |
In addition to uname -a, which gives you the kernel version, you can try:
lsb_release -idrc # distro, version, codename, long release name
Most Desktop Environments like GNOME or KDE have an "about" or "info" menu option that will tell you what you use currently, so no commandline needed there really.
| How to find information about the system/machine in Unix? |
1,356,020,314,000 |
So, I thought this would be a pretty simple thing to locate: a service / kernel module that, when the kernel notices userland memory is running low, triggers some action (e.g. dumping a process list to a file, pinging some network endpoint, whatever) within a process that has its own dedicated memory (so it won't fail... |
What you are asking is, basically, a kernel-based callback on a low-memory condition, right? If so, I strongly believe that the kernel does not provide such mechanism, and for a good reason: being low on memory, it should immediately run the only thing that can free some memory - the OOM killer. Any other programs can... | How to trigger action on low-memory condition in Linux? |
1,356,020,314,000 |
What are the differences in dependencies between select and depends on in the kernels Kconfig files?
config FB_CIRRUS
tristate "Cirrus Logic support"
depends on FB && (ZORRO || PCI)
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
---help---
This enables support for Cirrus Logic GD542x/543x based ... |
depends on A indicates the symbol(s) A must already be positively selected (=y) in order for this option to be configured. For example, depends on FB && (ZORRO || PCI) means FB must have been selected, and (&&) either ZORRO or (||) PCI. For things like make menuconfig, this determines whether or not an option will be... | What is the difference between "select" vs "depends" in the Linux kernel Kconfig? |
1,356,020,314,000 |
I'd like to block all distribution-shipped kernel updates due to a nasty thing that recently happened to me. (I'm on a Ubuntu 12.04 amd64 derivative.)
I'd like to block all updates to installed kernels of the minor version 3.2 to the linux-headers, linux-headers-generic, linux-image, and linux-image-extra packages. Th... |
What you need to use is a feature of apt-get called holding
You can either do this via Synaptic or Dpkg, Here is how I would hold my kernel using the dpkg method.
First check your kernel image name
dpkg -l | grep linux-image
output for me:
ii linux-image-3.2.0-4-amd64 3.2.35-2 ... | Blocking kernel updates with dpkg |
1,356,020,314,000 |
I have been using Linux Mint Debian with Debian unstable and noticed that when I press restart, instead of going all the way back to the BIOS, then grub, then booting up, I seem to be shutting down then loading back up without going back to the BIOS or GRUB.
This is an amazing feature I have not seen before until now.... |
It looks like your system has kexec enabled. Kexec allows the Linux kernel to load another kernel and hand the system over to that system. It's named after the exec family of functions that replace a process by a new executable image. Instead of calling the reboot utility, your system is set up to call kexec when you ... | Rebooting without shutting off? |
1,514,121,729,000 |
Just as a curiosity; something went wrong with a Linux machine, making the root file system show up as "64Z". A few commands work, like top, df, and kill, but others like reboot come up with "command not found" (since it can't read the root filesystem), and chmod comes up with a segmentation fault.
Is there any way to... |
Try to reboot with magic sysrq key:
echo b > /proc/sysrq-trigger
For more information read wiki or kernel documentation.
| Any way to restart a Linux machine via SSH if the root filesystem is not working? |
1,514,121,729,000 |
I understand this is somewhat less Ubuntu related, but it affects it.
So,what is so new about it that Linus decided to name it 3.0? I'm not trying to get information about the drivers that got into it or stuff that always gets improved. I want to know what really made it 3.0. I read somewhere that Linus wanted to get ... |
Nothing new at all. Citation below are from https://lkml.org/lkml/2011/5/29/204
I decided to just bite the bullet, and call the next version 3.0. It
will get released close enough to the 20-year mark, which is excuse
enough for me, although honestly, the real reason is just that I can
no longe rcomfortably coun... | What is new in Kernel 3.0? |
1,514,121,729,000 |
So i always thought MMU is part of the unix kernel that translates addresses to physical addresses but in the MMU wiki page it says its a computer hardware that usually have its own memory, but that page doesn't talk much about Unix/Linux operating systems
So I'm confused, does the all the translation happen in hardwa... |
The MMU (memory management unit) is a physical component of the computer system, typically part of the CPU (but not necessarily). It translates virtual addresses (also known as linear addresses in the x86 world) to physical addresses; it can also enforce memory access control, cache control, and bus arbitration. It do... | Is the MMU inside of Unix/Linux kernel? or just in a hardware device with its own memory? |
1,514,121,729,000 |
I'm building a custom kernel based off 4.11 (for Mintx64, if it matters). I've already compiled and installed it to prove that it works. Now I've made a few small changes to a couple of files (in the driver and net subsystems, this is why I need to compile a custom kernel in the first place!)
Now I want to build the m... |
The make clean is only for the deb-pkg target. Take a look at scripts/package/Makefile:
deb-pkg: FORCE
$(MAKE) clean
$(call cmd,src_tar,$(KDEB_SOURCENAME))
$(MAKE) KBUILD_SRC=
+$(call cmd,builddeb)
bindeb-pkg: FORCE
$(MAKE) KBUILD_SRC=
+$(call cmd,builddeb)
If you buil... | Re-building Linux kernel without "clean" |
1,514,121,729,000 |
Recently saw a question that sparked this thought. Couldn't really find an answer here or via the Google machine. Basically, I'm interested in knowing how the kernel I/O architecture is layered. For example, does kjournald dispatch to pdflush or the other way around? My assumption is that pdflush (being more generic t... |
Before we discuss the specifics regarding pdflush, kjournald, andkswapd`, let's first get a little background on the context of what exactly we're talking about in terms of the Linux Kernel.
The GNU/Linux architecture
The architecture of GNU/Linux can be thought of as 2 spaces:
User
Kernel
Between the User Space and... | How do pdflush, kjournald, swapd, etc interoperate? |
1,514,121,729,000 |
I would like to capture traffic on Linux virtual interfaces, for debugging purposes. I have been experimenting with veth, tun and dummy interface types; on all three, I am having trouble getting tcpdump to show anything.
Here is how I set up the dummy interface:
ip link add dummy10 type dummy
ip addr add 99.99.99.1 de... |
The traffic is going over the lo interface.
When an IP is added to a box, a route for that address is added to the 'local' table. All the routes in this table route traffic over the loopback interface.
You can view the contents of the 'local' table with the following:
ip route show table local
Which on my system look... | How does one capture traffic on virtual interfaces? |
1,514,121,729,000 |
Can I take a Linux kernel and use it with, say, FreeBSD and vice versa (FreeBSD kernel in, say, a Debian)? Is there a universal answer? What are the limitations? What are the obstructions?
|
No, kernels from different implementations of Unix-style operating systems are not interchangeable, notably because they all present different interfaces to the rest of the system (user space) — their system calls (including ioctl specifics), the various virtual file systems they use...
What is interchangeable to some... | Are different Linux/Unix kernels interchangeable? |
1,514,121,729,000 |
I am learning about journald and rsyslog and while reading I saw that rsyslog reads from /dev/kmsg and that journald can read from both /dev/kmsg and /proc/ksmg.
I know these are both kernel logs, but what is the difference between /proc/kmsg and /dev/kmsg? Why is one appear to be a process and another appear to be a... |
/proc/kmsg provides a root-only, read-only, consuming view of the kernel log buffer. It’s equivalent to calling syslog(2) with the SYSLOG_ACTION_READ action. As mentioned in the proc manpage,
A process must have superuser privileges to read this file, and only one process should read this
file. This ... | What is the difference between /proc/kmsg and /dev/kmsg? |
1,514,121,729,000 |
I'd like to know more about the advanced uses of the /proc and /sys virtual filesystems, but I don't know where to begin. Can anyone suggest any good sources to learn from? Also, since I think sys has regular additions, what's the best way to keep my knowledge current when a new kernel is released.
|
Read this blog post: Solving problems with proc
There are a few tips what you can do with the proc filesystem. Among other things, there is a tip how to get back a deleted disk image or how to staying ahead of the OOM killer.
Don't forget to read the comments, there are good tips, too.
| How do I learn what I can do with /proc and /sys [closed] |
1,514,121,729,000 |
I would like to try compile mmu-less kernel. From what I found in configuration there is no option for such a thing. Is it possible to be done?
|
You can compile a Linux kernel without MMU support on most processor architectures, including x86. However, because this is a rare configuration only for users who know what they are doing, the option is not included in the menu displayed by make menuconfig, make xconfig and the like, except on a few architectures for... | MMU-less kernel? |
1,514,121,729,000 |
When I execute route -n, from where exactly (from which structs) is the information displayed retrieved?
I tried executing strace route -n but I didn't help me finding the right place it's stored.
|
The route or the ip utility get their information from a pseudo filesystem called procfs. It is normally mounted under /proc. There is a file called /proc/net/route, where you can see the kernel's IP routing table. You can print the routing table with cat instead, but the route utility formats the output human readabl... | Where is routing table stored internally in the Linux kernel? |
1,514,121,729,000 |
When I type the command service vboxdrv setup in my CentOS 7 terminal, I get the following error:
Your kernel headers for kernel 3.10.0-229.el7.x86_64 cannot be found
How can I resolve this error?
When I open the log file by typing vi /var/log/vbox-install.log, the contents are:
Uninstalling modules from DKMS
... |
The solution is likely to be found at this question the short version being, run
sudo yum install "kernel-devel-uname-r == $(uname -r)"
That will install the kernel headers for the version of the kernel you are currently running.
I suspect that at some point you did a yum update or similar, and that actually installe... | Your kernel headers for kernel 3.10.0-229.el7.x86_64 cannot be found |
1,514,121,729,000 |
I know, that there are several websites, that will list the changelog of kernel versions (e.g. what is new in 4.17) (KernelNewbies, heise.de), but where do I find information about a minor change (e.g. 4.17.1 -> 4.17.2)?
(I try to hunt a bug, that appears in a very old kernel version, but not in a slightly newer one, ... |
The changelogs are on kernel.org.
The URLs have a predictable pattern. The current kernel change log is at:
https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.17.8
So, to read the changes from 4.17.1, you would go to:
https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.17.2
| Where to find the Linux changelog of minor versions |
1,514,121,729,000 |
What are the basic differences between spin locks and semaphores in action?
|
Both manage a limited resource. I'll first describe difference between binary semaphore (mutex) and spin lock.
Spin locks perform a busy wait - i.e. it keeps running loop:
while (try_acquire_resource ());
...
release();
It performs very lightweight locking/unlocking but if the locking thread will be preempted by othe... | what is the difference between spin locks and semaphores? |
1,514,121,729,000 |
When I visited the kernel.org website to download the latest Linux kernel, I noticed a package named 2.6.37-rc5 in the repository. What is the meaning of the "rc5" at the end?
|
Release Candidate.
By convention, whenever an update for a program is almost ready, the test version is given a rc number. If critical bugs are found, that require fixes, the program is updated and reissued with a higher rc number. When no critical bugs remain, or no additional critical bugs are found, then the rc d... | Meaning of "rc5" in "linux kernel 2.6.37-rc5" |
1,514,121,729,000 |
If you ran the following, what would happen?
# Do not run.
# cat /dev/random > ~/randomFile
Would it be written until the drive runs out of space, or would the system see a problem with this and stop it (like with an infinite symlink loop)?
|
It writes until the disk is full (usually there is still some space reserved for the root user). But as the pool of random data is limited, this could take a while.
If you need a certain amount of random data, use dd.
For 1MB:
dd if=/dev/random iflag=fullblock of=$HOME/randomFile bs=1M count=1
Other possibilities are... | Writing /dev/random to file? |
1,514,121,729,000 |
Once, I was installing some kernel patches & something went wrong on a live server where we had hundreds of clients. Only one kernel was there in the system. So, the server was down for some time, and using a live CD, we got the system up & running & did the further repairing work.
Now my question: Is it a good idea t... |
Both RedHat and Debian-based distribution keep several versions of Kernel when you install a new one using yum or apt-get by default. That is considered a good practice and is done exactly for the case you describe: if something goes wrong with the latest kernel you can always reboot and in GRUB choose to boot using o... | Is it good to have multiple version of Linux Kernel? |
1,514,121,729,000 |
I have a kernel in which one initramfs is embedded.
I want to extract it.
I got the output x86 boot sector when I do file bzImage
I have System.map file for this kernel image.
Is there any way to extract the embedded initramfs image from this kernel with or without the help of System.map file ?
The interesting string... |
There is some information about this in the gentoo wiki: https://wiki.gentoo.org/wiki/Custom_Initramfs#Salvaging
It recommends the usage of binwalk which works exceedingly well.
I'll give a quick walk-through with an example:
first extract the bzImage file with binwalk:
> binwalk --extract bzImage
DECIMAL HEXADE... | extract Embedded initramfs |
1,514,121,729,000 |
So i was just wondering if my explanations of udev and how it works seem correct and my understanding is correct please let me know.
SO my understanding of udev is that it is a dynamic device manager on Linux which runs as a daemon.
when a change to a device occurs such as if a device is plugged in the kernel sends ... |
UDEV
Udev stand for "userspace /dev" it is a device manager for the Linux kernel. It is part of systemd (an init system used to bootstrap user space and manage user processes).
Originally udev was independent from systemd, it was merged with systemd in 2012, this lead to some complication for distribution running with... | How does udev/uevent work? |
1,514,121,729,000 |
What does it mean when code is executed in kernel or user mode?
|
Kernel Mode
A program running in this mode has full access to the underlying hardware. It can execute any CPU instruction, access any memory address and essentially do anything it wants.
User Mode
Code executing in this mode is restricted to hardware modification via the OS's API. It cannot access the hardware direc... | What does it mean when code is executed in [kernel|user] mode? |
1,514,121,729,000 |
I'm just trying to understand the modinfo output that describes a kernel module. For instance, in the case of the module i915, the output looks like this:
$ modinfo i915
filename: /lib/modules/4.2.0-1-amd64/kernel/drivers/gpu/drm/i915/i915.ko
license: GPL and additional rights
description: Intel Graphi... |
firmware:
firmware: i915/skl_dmc_ver1.bin
Many devices need two things to run properly. A driver and a firmware. The driver requests the firmware from the filesystem at /lib/firmware. This is a special file, needed by the hardware, it's not a binary. The diver then does what it needs to do to load the firmware ... | How to understand the modinfo output? |
1,514,121,729,000 |
I have just set up a Gentoo base system (which means I can boot and log in and do stuff with it now). My root partition is in an LVM2 virtual group (with a separated /boot partition). In order to boot I need to pass the parameters below to the kernel:
root=/dev/ram0 real_root=/dev/vg/rootlv init=/linuxrc dolvm
Appare... |
Simple answer: No. If you want LVM you need an initrd.
But as others have said before: LVMs don't slow your system down or do anything bad in another way, they just allow you to create an environment that allows your kernel to load and do its job.
The initrd allows your kernel to be loaded: If your kernel is on an LVM... | Is it possible to put root in LVM without using initrd? |
1,514,121,729,000 |
I want to check if my Linux kernel is preemptive or non-preemptive.
How can I check this using a command, something such as uname -a?
|
Whether a kernel is preemptive or not depends on what you want to preempt, as in the Linux kernel, there are various things that can have preemption enabled/disabled separately.
If your kernel has CONFIG_IKCONFIG and CONFIG_IKCONFIG_PROC enabled, you can find out your preemption configuration through /proc/config.gz (... | How can I check my kernel preemption configuration? |
1,514,121,729,000 |
In Arch Linux, after installing the most recent updates today, I see the following errors in the journal:
kernel: FS-Cache: Duplicate cookie detected
kernel: FS-Cache: O-cookie
There are about 20 lines in total that are like these. I don't find any info on this via a search. Is this a serious or known problem?
My CP... |
This appears to be working as intended. The Duplicate cookie detected errors are not indicative of a situation that requires action by the sysadmin.
As has been pointed out on the upstream bug report this may well be working as intended https://bugzilla.kernel.org/show_bug.cgi?id=200145#c12
https://git.kernel.org/pub... | kernel: FS-Cache: Duplicate cookie detected - what is this? |
1,514,121,729,000 |
I configured and compiled Linux kernel with nouveau driver built-into kernel, i.e. with <*> as opposed to <M> when doing make menuconfig inside Linux kernel source directory.
Now, I intend to use another driver rather than nouveau. If nouveau was a module, I would add a line like blacklist nouveau inside /etc/modprob... |
You can also temporarily blacklist them on the grub command line (linux line) when you boot with the syntax
module_to_blacklist.blacklist=yes
OR
modprobe.blacklist=module_to_blacklist
You need to modify the grub,cfg to make the changes permanent.
Mind you, this solution will not work for few modules
| How to block drivers built-into Kernel, i.e. drivers who are not a module |
1,514,121,729,000 |
I'm trying to figure out how to blacklist modules, and I'm trying it on the USB storage. Unfortunately it seems to have no effect, and I get the module in even if it's not used (apparently).
My experiment is taking place on an Ubuntu 12.04.3 LTS.
raptor@raptor-VirtualBox:/etc/modprobe.d$ lsmod | grep usb
usb_storage ... |
Your problem probably results from the fact that a copy of /etc/modprobe.d/blacklist.conf is located in the initramfs. When you reboot your computer, it is still using the old copy that doesn't contain your change. Try to rebuild the initramfs with the following command and then reboot:
sudo update-initramfs -u
| Kernel module blacklist not working |
1,514,121,729,000 |
I've the following one-liner to show files opened by process:
sudo dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'
however I've plenty of repeated errors such as:
dtrace: error on enabled probe ID 4 (ID 946: syscall::open_nocancel:entry): invalid user access in action #2 at DIF offset ... |
This is potentially related to El Capitan and its System Integrity Protection (csrutil status) which can affect the dtrace behaviour.
The potential fix includes rebooting Mac into recovery mode (⌘-R at boot time), then in Terminal run:
csrutil enable --without dtrace
to keep SIP enabled, but disable DTrace restricti... | Error on enabled probe: syscall::open_nocancel:entry): invalid user access in action #2 at DIF |
1,514,121,729,000 |
What is the reason for the root filesystem being mounted ro in the initramfs (and in initrd).
For example the Gentoo initramfs guide mounts the root filesystem with:
mount -o ro /dev/sda1 /mnt/root
Why not the following?
mount -o rw /dev/sda1 /mnt/root
I can see that there is a probably a good reason (and it probab... |
The initial ramdisk (initrd) is typically a stripped-down version of the root filesystem containing only that which is needed to mount the actual root filesystem and hand off booting to it.
The initrd exists because in modern systems, the boot loader can't be made smart enough to find the root filesystem reliably. Th... | Why does initramfs mount the root filesystem read-only |
1,514,121,729,000 |
I use Knoppix (or other Live CDs/DVDs) as a secure environment for creating valuable crypto keys. Unfortunately entropy is a limited resource in such environments. I just noticed that each program start consumes quite some entropy. This seems to be due to some stack protection feature that needs address randomization.... |
If this is indeed due to address randomization (ASLR has to do with where the program is loaded, see here: http://en.wikipedia.org/wiki/Address_space_layout_randomization) then you can disable it by passing norandmaps to the kernel in the boot options (see here: http://www.linuxtopia.org/online_books/linux_kernel/kern... | Can entropy consumption at program start be prevented? |
1,514,121,729,000 |
I'm running Ubuntu 11.10, which came with kernel version 3.0.0-14. I downloaded and built a kernel from the 3.1.0 branch. After installing the new kernel, I see that my /boot/initrd.img-3.1.0 file is HUGE. It's 114MB, while my /boot/initrd.img-3.0.0-14-generic is about 13MB. I want to get rid of the bloat, which is cl... |
When building the kernel and module using make oldconfig, make and make install, the resulting modules will have debug information available in the files.
Use the INSTALL_MOD_STRIP option for removing debugging symbols:
make INSTALL_MOD_STRIP=1 modules_install
Similarly, for building the deb packages:
make INSTALL_MO... | Why is my initial ramdisk so big? |
1,514,121,729,000 |
The default PID max number is 32768. To get this information type:
cat /proc/sys/kernel/pid_max
32768
or
sysctl kernel.pid_max
kernel.pid_max = 32768
Now, I want to change this number... but I can't. Well, actually I can change it to a lower value or the same. For example:
linux-6eea:~ # sysctl -w kernel.pid_max... |
The value can only be extended up to a theoretical maximum of 32768 for 32 bit systems or 4194304 for 64 bit.
From man 5 proc:
/proc/sys/kernel/pid_max
This file (new in Linux 2.5) specifies the value at which PIDs wrap around
(i.e., the value in this file is one greater than the maximum PID). The
default val... | How to change the kernel max PID number? [duplicate] |
1,514,121,729,000 |
If I write a program that tries to read memory at every possible address, and I run it on a "full" Unix, it will not be able to access all of the physical RAM. But how does the operating system prevent it from doing so?
I am more familiar with small CPU architectures where any piece of assembly code can access everyt... |
It's not the kernel that's preventing bad memory accesses, it's the CPU. The role of the kernel is only to configure the CPU correctly.
More precisely, the hardware component that prevents bad memory accesses is the MMU. When a program accesses a memory address, the address is decoded by the CPU based on the content o... | How does the kernel prevent a malicious program from reading all of physical RAM? |
1,514,121,729,000 |
According to the man page of lsmod the command shows “what kernel modules are currently loaded”.
I wrote a script that uses modinfo to show what kernel object (.ko) files are actually in use:
#!/bin/sh
for i in `lsmod | awk '{print $1}' | sed -n '1!p'`; do
echo "###############################$i#######################... |
Your nvidia module is perfectly loaded and working. The problem lies in modinfo.
modinfo fetch the list of known modules by reading the /lib/modules/$(uname -r)/modules.* files, which are usually updated with depmod.
If depmod -a has not been run after installing the nvidia module, then modinfo does not knows about it... | Why does modinfo say “could not find module”, yet lsmod claims the module is loaded? |
1,514,121,729,000 |
I've noticed that when I do heavy write applications, the whole system slows down. To test this further I ran this to do a (relatively) low-CPU, high disk activity:
john -incremental > file_on_SSD
This pumps out tens of thousands of strings per second to a file on my system disk.
When it's doing this, the mouse lags,... |
This has been a known issue for awhile. Using an SSD-tuned FS like Btrfs might help, but it might not.
Ultimately, it is a bug in the IO scheduler/memory management systems. Recently, there have been some patches that aim to address this issue. See Fixed: The Linux Desktop Responsiveness Problem?
These patches may eve... | Heavy write activity on SSD nukes system performance |
1,514,121,729,000 |
I'm trying to get a deeper understanding of how system calls and hardware interrupts are implemented, and something that keeps confusing me is how they differ with respect to how they're handled. For example, I am aware that one way a system call (at least used to) be initiated is through the x86 INT 0x80 instruction.... |
INT 0x80h is an old way to call kernel services (system functions). Currently, syscalls are used to invoke these services as they are faster than calling the interrupt. You can check this mapping in kernel's Interrupt Descriptor Table idt.c and in line 50 in the irq_vectors.h file.
The important bit that I believe ans... | Do system calls actually "interrupt" the CPU the same way that hardware interrupts do? |
1,299,848,475,000 |
Running Xubuntu 16.04.1 LTS 64-bit.
/proc/sys/kernel/yama/ptrace_scope keeps resetting to 1 if I reboot, despite me changing it to 0 manually. How can I keep ptrace_scope set to a value of 0?
|
/proc values are stored in RAM so it isn't persistent. But it read its initial values from a file. You can permanently change the value of /proc/sys/kernel/yama/ptrace_scope to 0 by editing the file /etc/sysctl.d/10-ptrace.conf and change the line:
kernel.yama.ptrace_scope = 1
To
kernel.yama.ptrace_scope = 0
| /proc/sys/kernel/yama/ptrace_scope keeps resetting to 1 |
1,299,848,475,000 |
I have a perplexing problem. I have a library which uses sg for executing customized CDBs. There are a couple of systems which routinely have issues with memory allocation in sg. Usually, the sg driver has a hard limit of around 4mb, but we're seeing it on these few systems with ~2.3mb requests. That is, the CDBs ... |
The 1 GiB limit for Linux kernel memory in a 32-bit system is a consequence of 32-bit addressing, and it's a pretty stiff limit. It's not impossible to change, but it's there for a very good reason; changing it has consequences.
Let's take the wayback machine to the early 1990s, when Linux was being created. Back in t... | memory limit of the Linux kernel |
1,299,848,475,000 |
What is the loopback interface and how does it differ from the eth0 interface?
And why do I need to use it when mounting an ISO or running a service on localhost?
|
The loopback networking interface is a virtual network device implemented entirely in software. All traffic sent to it "loops back" and just targets services on your local machine.
eth0 tends to be the name of the first hardware network device (on linux, at least), and will send network traffic to remote machines. Y... | What is the loopback interface |
1,299,848,475,000 |
I have an application that reads a file. Let's call it processname and the file ~/.configuration. When processname runs it always reads ~/.configuration and can't be configured differently. There are also other applications that rely on "~/.configuration", before and after, but not while processname is running.
Wrappi... |
In recent versions of Linux, you can unshare the mount namespace. That is, you can start processes that view the virtual file system differently (with file systems mounted differently).
That can also be done with chroot, but unshare is more adapted to your case.
Like chroot, you need superuser priviledged to unshare t... | Making a process read a different file for the same filename |
1,299,848,475,000 |
After configuring and building the kernel using make, why don't I have vmlinuz-<version>-default.img and initrd-<version>.img, but only got a huge vmlinux binary (~150MB)?
|
The compressed images are under arch/xxx/boot/, where xxx is the arch. For example, for x86 and amd64, I've got a compressed image at /usr/src/linux/arch/x86/boot/bzImage, along with /usr/src/linux/vmlinux.
If you still don't have the image, check if bzip2 is installed and working (but I guess if that were the problem... | vmlinuz and initrd not found after building the kernel? |
1,299,848,475,000 |
I saw a kernel option today in menuconfig that used braces for its checkbox.
{*} Button
This isn't listed in the legend at the top of the screen.
[*] built-in [ ] excluded <M> module < > module capable
What do the braces signify?
|
It represents an option that has been implied to a specific value by another option.
This Gentoo's wiki has a clear explanation and lists all the available types that menuconfig can display. For example: the hyphen is also listed there.
| What do the kernel options in braces mean? |
1,299,848,475,000 |
I'm having CentOS 7 64 installed on my desktop. After recent system update, I am getting below error while booting the CentOS 7.
Some time system is able to boot and I can work on it. but it gives the same error at the time of next boot.
after entering this:
systemctl status kdump.service
I get this:
● kdump.... |
Install the required packages
yum --enablerepo=debug install kexec-tools crash kernel-debug kernel-debuginfo-`uname -r`
Modify grub
A kernel argument must be added to /etc/grub.conf to enable kdump. It’s called crashkernel and it can be either auto or set as a predefined value e.g. 128M, 256M, 512M etc.
The line will... | Kdump.service FAILED centOS 7 |
1,299,848,475,000 |
I want to enable reversed path filtering to prevent source ip spoofing on my server. I noticed that I have the following settings at current:
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.lo.rp_filter = 0
net.ipv4.conf.p4p1.rp_filter = 1
net.ipv4.conf.eth0.rp_filter = 1
The settin... |
According to this post titled: all vs. default in /proc/sys/net/ipv4/conf [message #3139]:
When you change variables in the /proc/sys/net/ipv4/conf/all directory, the variable for all interfaces and default will be changed as well. When you change variables in /proc/sys/net/ipv4/conf/default, all future interfaces wi... | What is the difference between all and default in kernel setting? [duplicate] |
1,299,848,475,000 |
I don't have enough confidence to do this alone and risk the server not to boot or something.
I would like to upgrade kernel from:
$ uname -r
4.9.0-6-amd64
$ uname -v
#1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07)
to kernel version 4.15 or 4.16. Whichever you recommend.
I just think I know how to list versions availabl... |
If you want to install a newer Debian-packaged kernel, you should use one from the backports repository. You seem to have that repository already added to your apt configuration, so you're all set.
Since your current kernel is the basic amd64 version, I assume you won't need the realtime scheduler version, nor the clo... | What is the proper way of installing new kernel manually on Debian 9? |
1,299,848,475,000 |
Is there a way to tell from Bash what distro version # I'm running and also what Kernel version is included?
|
Basic commands will be the following:
# cat /etc/gentoo-release
Gentoo Base System release 2.1
# uname -r
3.1.6-gentoo
Also you can obtain this information in a "gentoo-way" using app-portage/gentoolkit package utils:
# equery list baselayout
* Searching for baselayout ...
[IP-] [ ] sys-apps/baselayout-2.1:0
# ... | How do I tell what version of Gentoo & Linux is running? |
1,299,848,475,000 |
I know that many of the same programs run flawlessly on top of both kernels. I know that historically, the two kernels came from different origins. I know philosophically too that they stood for different things. My question is, today, in 2011, what makes a Unix kernel different from a Linux one, and vice versa?
|
There is no unique thing named "the Unix kernel". There are multiple descendants of the original Unix kernel source code trunk that forked branches from it at different stages and that have evolved separately according to their own needs.
The mainstream ones these days are found in Operating Systems created either fr... | What are the main differences between Unix and Linux kernels today? |
1,299,848,475,000 |
I've read that the color red indicates "kernel processes." Does that mean little daemons that are regulating which task gets to use the CPU? And by extension, transaction costs in an oversubscribed system?
I'm running some large-scale geoprocessing jobs, and I've got two scripts running in parallel at the same time... |
Red represents the time spent in the kernel, typically processing system calls on behalf of processes. This includes time spent on I/O. There’s no point in trying to reduce it just for the sake of reducing it, because it’s not time that’s wasted — it’s time that’s spent by the kernel doing useful stuff (as long as you... | Lots of red in htop -- does that mean my tasks are tripping over each other? |
1,299,848,475,000 |
What is the between likely and unlikely calls in Kernel. While searching through the kernel source i found these statements.
# define likely(x) __builtin_expect(!!(x), 1)
# define unlikely(x) __builtin_expect(!!(x), 0)
Could somebody shed some light into it?
|
They are compiler hints for GCC. They're used in conditionals to tell the compiler if a branch is likely to be taken or not. It can help the compiler laying down the code in such a way that's optimal for the most frequent outcome.
They are used like this:
if (likely(some_condition)) {
// the compiler will try and ma... | What is the difference between likely and unlikely calls in Kernel? |
1,299,848,475,000 |
I want to add a particular new system call in the linux kernel 3.2.x but as a loadable kernel module (as I don't want to recompile the kernel again and again)
I read through many posts on internet and also on SO, and some places claim that implementing system calls as loadable modules is not possible, while others sa... |
It is not possible because system call table (called sys_call_table) is a static size array. And its size is determined at compile time by the number of registered syscalls. This means there is no space for another one.
You can check implementation for example for x86 architecture in arch/x86/kernel/syscall_64.c file,... | Adding a new System call to Linux 3.2.x with a loadable kernel module [closed] |
1,299,848,475,000 |
I'm modifying a bunch of initramfs archives from different Linux distros in which normally only one file is being changed.
I would like to automate the process without switching to root user to extract all files inside the initramfs image and packing them again.
First I've tried to generate a list of files for gen_ini... |
It's very reliable and supported by all kernel versions that support initrd, AFAIK. It's a feature of the cpio archives that initramfs are made up of. cpio just keeps on extracting its input....we might know the file is two cpio archives one after the other, but cpio just sees it as a single input stream.
Debian adv... | Appending files to initramfs image - reliable? |
1,299,848,475,000 |
When you compile a kernel source, you can choose to sign kernel modules using the CONFIG_MODULE_SIG* options. The modinfo tool should handle the task of verifying the module signature, but there has been some bug in it for years, and the tool simply can't do the job anymore. All I get is the following:
sig_id: ... |
Yes, that's possible, but it's quite involved.
First you have to extract the module signature -- you can use the extract-module.sig.pl script from the kernel source for that:
$ scripts/extract-module-sig.pl -s MODULE.ko >/tmp/modsig.
Read 789006 bytes from module file
Found magic number at 789006
Found PKCS#7/CMS enca... | How to verify a kernel module signature? |
1,299,848,475,000 |
I updated archlinux with "pacman -Syu" and then when I've restart, the system can't start. This is the report:
Warning: /lib/modules/4.11.9-1-ARCH/modules.devname not found - ignoring
version 232
Error: device 'UUID=b5a9a977-e9a7-4d3d-96a9-dcf9c3a9010d' not found. Skipping fsck.
Error: can't find UUID=b5a9a977-e9a7-4d... |
I just forgot mount boot (thank you, jasonwryan).
The solution to this problem, in my case was:
Use a livecd to mount all partitions and use chroot.
Update:
pacman -Syu
Regenerate initramfs using:
mkinitcpio -p linux
If you use grub:
grub-mkconfig -o /mnt/boot/grub/grub.cfg
Restart.
| Cannot start archlinux after update: Cannot find uuid |
1,299,848,475,000 |
There used to be a kernel config option called sched_user or similar under cgroups. This allowed (to my knowledge) all users to fairly share system resources. In 2.6.35 it is not available. Is there a way I can configure my system to automatically share io/cpu/memory resources between all users (including root?). I ha... |
The kernel documentation provides a general coverage of cgroups with examples.
The cgroups-bin package (which depends on libcgroup1) already provided by the distribution should be fine.
Configuration is done by editing the following two files:
/etc/cgconfig.conf
Used by libcgroup to define control groups, their param... | How can I configure cgroups to fairly share resources between users? |
1,299,848,475,000 |
Given a distribution and its version, I can find which version of kernel it uses, e.g. for Ubuntu they are listed here, and for currently supported versions of Fedora they are here.
In general, however, I'm interested in a reverse lookup: given kernel version X I'd like to find which distros are still using X or older... |
So I'm not sure if you're looking to do this programmatically or not. But the first step you'd need to accomplish this is a database that catalogues all of this sort of information for each distribution and their respective releases.
Luckily… that is exactly what distrowatch.com is.
You can gather this information us... | How to find out what distros are using particular Linux version? |
1,299,848,475,000 |
How to know whether a particular patch is applied to the kernel? Especially RT-Preempt Patch.
|
In the case of preempt you can just use uname:
uname -v
#23 SMP PREEMPT RT Fri Oct 16 11:52:29 CET 2012
The string PREEMPT shows that you use a kernel version with the realtime patch.
Some other patches might also changes the uname string. So it might also be a help. If this is not the case you can try to look at you... | Checking linux Kernel for RT-Preempt Patch |
1,299,848,475,000 |
I'd like to have all my modules built-in, but this fails with iwlagn:
iwlagn 0000:03:00.0: request for firmware file 'iwlwifi-6000-4.ucode' failed.
iwlagn 0000:03:00.0: no suitable firmware found!
The microcode file exists in /lib/firmware and the whole thing works just fine if I compile iwlagn as module. I have no i... |
Have a look at the CONFIG_FIRMWARE_IN_KERNEL, CONFIG_EXTRA_FIRMWARE, and CONFIG_EXTRA_FIRMWARE_DIR configuration options (found at Device Drivers -> Generic Driver Options).
The first option will enable firmware being built into the kernel, the second one should contain the firmware filename (or a space-separated list... | Custom kernel: fails to load firmware when module built-in |
1,299,848,475,000 |
I just updated one of our debian jessie servers and the kernel was updated, nothing special, as we have done this many times. But the first time there were some warnings when the grub configuration file was being generated. I have never seen them before. As far as I can tell the system runs nicely after a reboot.
Sett... |
according to info from Peter Rajnoha about an old 2014 fedora bug 1152185, "The warning is there because if lvmetad is already instantiated and running, then using use_lvmetad=0 will cause LVM commands run under this setting to not notify lvmetad about any changes - therefore lvmetad may miss some information - hence ... | kernel update - WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it! |
1,299,848,475,000 |
I have an Intel wireless card driven by iwlwifi, and I can see the following message in dmesg:
iwlwifi 0000:03:00.0: loaded firmware version 17.168.5.3 build 42301
Given that I know which blob is loaded, how I can find out the version of this blob (.ucode file)?
If you look at the below where the ucode is loaded, it ... |
The iwlwifi driver loads the microcode file for your wifi adapter at startup. If you want to know the version of the blobs you have on your machine, try Andrew Brampton's script. Run:
## Note the firmware may stored in `/usr/lib`
./ucode.py /lib/firmware/iwlwifi-*.ucode
And compare the output to your journal (dmesg o... | How can I parse the microcode (ucode) in iwlwifi to get the version numbers? |
1,299,848,475,000 |
I've been wondering for last few days how exactly does it work. We can set kernel runtimes parameters using sysctl or echo boolen 1> /proc/sys/module/exactParameter but in /sys/modules/module/parameters/parameter we can also set values.
Are parameters for modules in /proc/sys/ related only to hard complied into kernel... |
There is little relation between /proc/sys and /sys other than the fact that both are kernel interfaces and a coincidence of names.
/proc/sys is an interface to sysctl, which are kernel configuration parameters. Reading or modifying /proc/sys/foo/bar is equivalent to getting or setting the foo.bar sysctl. Sysctl value... | /proc/sys vs /sys/modules/mod/parameter |
1,299,848,475,000 |
Is there any developed automatic linux kernel configuration tool?
I have found a method of make localmodconfig, but it is certainly very limited. I have searched the web but unfortunately have not come to any acceptable result.
Although I am quite conversant in kernel configuration issues, I would like to optimize my ... |
Now, that we talked about this a bit in the comments the answer for you is: no, there isn't.
The main reason for that conclusion is that I think you are not looking for a tool to configure a kernel, but to automatically tune the kernel for your specfic (and yet unstated) use case.
As stated in the comments, you can sk... | Automatic kernel configuration tool |
1,299,848,475,000 |
I have my terminal always opened (Fedora 22), because all my work I do from there. Sometimes I search some info in browser or just have fun. After 20-30 minutes of browsing (browser starts not from command line) I return to terminal and saw something strange - it was in all tabs of terminal:
Message from syslogd@local... |
Seems like a bug in the updated kernel; but, this maybe related to your laptop's battery poor performance. This you can be more affirmative by checking ACPI(Advanced Configuration and Power Interface) modules.
When my kernel was updated, I restarted my system and started the new kernel---however it failed to load and ... | What does "kernel:NMI watchdog: BUG: soft lockup" followed by other errors mean? |
1,299,848,475,000 |
While troubleshooting a Oracle Linux 6.3 server (RHEL Derivative) I tried to use some of the Magic SysRq Key commands for the first time. No such luck so I had to hard reboot. When it came back up I checked if SysRq was enabled...
> sysctl kernel.sysrq
kernel.sysrq = 0
But on our Oracle Linux 7.2 (RHEL Derivative) sy... |
You might not want to have the ability for some random person to walk up to the keyboard and reset the machine, or even worse, start printing registers, syslog or all tasks to the console, all without logging in. Its a potential security issue.
I selectively enable it, for example, on hardware in our datacenter hooke... | Why is Magic SysRq not enabled by default on some systems? Is there a risk? |
1,299,848,475,000 |
ksplice is an open source extension of the Linux kernel which allows system administrators to apply security patches to a running kernel without having to reboot the operating system. (From Wikipedia.)
Is there a downside to using ksplice? Does it introduce any kind of instability? If not, why is it not included by de... |
Technically it's very sound, I think that the fact distributions do provide this method of patching yet is:
It does not integrate with the existing update methods (packaging wise)
It adds to the burden of the distro to provide another method of upgrading.
| Is there a downside to ksplice? |
1,299,848,475,000 |
I'm running a fresh install of Kubuntu 20.04. Many times when I shutdown (not every time, but often), it pauses for a minute or so before showing the error:
[drm:intel_cpu_fifo_underrun_irq_handler [i915]] *ERROR* CPU pipe A FIFO underrun
This is usually associated with screen flickers. The screen also sometimes f... |
I was able to prevent this from happening by disabling C-States in my laptop's firmware configuration ("BIOS"). For reference, it's a Dell Latitude 5490.
Found the solution here: https://askubuntu.com/questions/895329/flickering-screen-cpu-pipe-b-fifo-underrun-when-i-use-the-termnal
| [drm:intel_cpu_fifo_underrun_irq_handler [i915]] *ERROR* CPU pipe A FIFO underrun |
1,299,848,475,000 |
In my systemd jounal (journalctl) I often see this message:
hibernation is restricted; see man kernel_lockdown.7
This seems to stem from the kernel lockdown feature that (only?) is active when you boot in UEFI mode with secure boot enabled.
As far as I understand that this feature is supposed to prevent a program ru... |
As mentioned in the manpage,
Unencrypted hibernation/suspend to swap are disallowed as the kernel image is saved to a medium that can then be accessed.
Unencrypted hibernation stores the contents of the hibernated system’s memory as-is on disk. This allows an attacker to modify those contents while the system is hib... | Why does the kernel lockdown prevent hibernation? |
1,299,848,475,000 |
On Linux and Windows, I'm used to the situation that I require a 64-bit kernel to have a system with multiarch/WoW where I can run 32-bit and 64-bit software side-by-side.
And then, years ago it blew my mind when someone showed me that MacOS 10.6 Snow Leopard could run 64-bit applications with the kernel in 32-bit mod... |
Running 64-bit applications requires some support from the kernel: the kernel needs to at least set up page tables, interrupt tables etc. as necessary to support running 64-bit code on the CPU, and it needs to save the full 64-bit context when switching between applications (and from applications to the kernel and bac... | What does it take to run 64-bit userland software on a 32-bit kernel? |
1,299,848,475,000 |
There are some tools in side the kernel,
<kernel source root directory>/tools
perf is one of them.
In ubuntu I think the tools inside this folder is available as package linux-tools
How can I compile it form source and install it and run it?
|
what's wrong with the following?
make -C <kernel source root directory>/tools/perf
| How can I compile, install and run the tools inside kernel/tools? |
1,299,848,475,000 |
I already posted this over at reddit, but got no response until now.
I bought this cable just to find out my system doesn't do anything. Both lsusb and tail -f /var(log/kern.log don't show any difference when plugging the cable in and out. Is it worth trying to get this to work or should I just send it back directly? ... |
[EDIT: I append at the end of this answer a very brief update, one year after i gave the answer here. If this update should be a second, separate answer, please lmk. Apart from this update at the end, the answer is unchanged]
Your questions are very timely, even though you asked them 7 months ago. And you asked two qu... | USB C → DisplayPort Adapter support |
1,299,848,475,000 |
I'm running Linux Mint, version 19 Tara.
My battery life is really bad right now and my fan is always on because my computer is constantly at 70% CPU usage on this kworker thread. It's really starting to annoy me. I run top as soon as I boot up and before I even open a single program (other than the terminal), this pr... |
I've been researching on this problem also. I've tried changing the BIOS settings and all kinds of tweaks. I finally came across this link (https://forum.manjaro.org/t/kworker-kacpid-cpu-100/131532) and it worked for a while. As I have been switching between Ubuntu, Mint and Win10, once the problem happens, it becomes... | kworker thread kacpid_notify/kacpid hogging 60-70% of CPU |
1,299,848,475,000 |
Based on part of the first answer of this questions:
read from a file (the kernel must check that the permissions allow you to read from said file, and then the kernel carries out the actual instructions to the disk to read the file)
It requires to have root privilege to change permission to a file. With root privi... |
First, a clarification:
It requires to have root privilege to change permission to a file.
From man 2 chmod we can see that the chmod() system call will return EPERM (a permissions error) if:
The effective UID does not match the owner of the file, and the process is not privileged (Linux: it does not have the CAP_... | What is the relationship between root and kernel? [closed] |
1,394,457,423,000 |
I understand that /dev/kmem and /dev/mem provide access to the memory (i.e. raw RAM) of the system. I am also aware, that /dev/kmem can be completely disabled in kernel and that access can be restricted for /dev/mem.
It seems to me, having raw access to memory can be useful for developers and hackers, but why should I... |
There's a slide deck from Scale 7x 2009 titled: Undermining the Linux Kernel:
Malicious Code Injection via /dev/mem that contained these 2 bullets.
Who needs this?
X Server (Video Memory & Control Registers)
DOSEmu
From everything I've found from search thus far it would appear that these 2 bullets are the front-r... | kernel: disabling /dev/kmem and /dev/mem |
1,394,457,423,000 |
I've been reading Linux Kernel Development and there's something that's not entirely clear to me -- when an interrupt is triggered by the hardware, what's the criterion to decide on which CPU to run the interrupt handling logic?
I could imagine it having to be always the same CPU that raised the IO request, but as th... |
On a multiprocessor/multicore system, you might find a daemon process named irqbalance. Its job is to adjust the distribution of hardware interrupts across processors.
At boot time, when the firmware hands over the control of the system to the kernel, initially just one CPU core is running. The first core (usually co... | What's the policy determining which CPU handles which interrupt in the Linux Kernel? |
1,394,457,423,000 |
I have a Lenovo IdeaPad Yoga 13 with Ubuntu 13.10 Installed. The device has a "Toggle TouchPad" button on the keyboard (F5). The keyboard's F* buttons are reversed (so to get F5, I need to press Fn + F5, and F5 is actually the toggle key).
I've found out that the button is actually read by the keyboard (rather than th... |
As it turns out the kernel did pick it up, but kept complaining that it's not recognised.
For anyone else having this issue, or wants to map a key that's not read by the OS, read on.
Open a terminal and run dmesg | grep -A 1 -i setkeycodes. This will give you multiple entries like this:
[ 9.307463] atkbd serio0: Un... | Capturing key input from events device and mapping it (toggle TouchPad key is unmapped) |
1,394,457,423,000 |
Whenever there is high disk I/O, the system tends to be much slower and less responsive than usual. What's the progress on Linux kernel regarding this? Is this problem actively being worked on?
|
I think for the most part it has been solved. My performance under heavy IO has improved in 2.6.36 and I expect it to improve more in 2.6.37. See these phoronix Articles.
Wu Fengguang and KOSAKI Motohiro have published patches this week that they believe will address some of these responsiveness issues, for which the... | What's the progress regarding improving system performance/responsiveness during high disk I/O? |
1,394,457,423,000 |
I'm just wondering where these values are being set and what they default to? Mine is currently 18446744073692774399. I didn't set it anywhere that I can see.
$ cat /proc/sys/kernel/shmmax
18446744073692774399
$ sysctl kernel.shmmax
kernel.shmmax = 18446744073692774399
|
The __init function ipc_ns_init sets the initial value of shmmax by calling shm_init_ns, which sets it to the value of the SHMMAX macro.
The definition of SHMMAX is in <uapi/linux/shm.h>:
#define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */
On 64-bit machines, that definition equals the value yo... | Where does Linux set the default values for SHMMAX? |
1,394,457,423,000 |
Sometimes I see the Linux kernel being mentioned in the list of upgrades, when running pacman -Syu (updating my packages in Arch Linux). Whenever this happens, after installation of the packages, I can not mount USB drives anymore until I restart. I would just like to know if this is something that is common and expec... |
Probably, on that distribution, it is normal. It depends on how the package manager installs the new kernel.
I suppose that your package manager (when upgrading the kernel) deletes the old kernel-modules directory immediately. This way, when you try to mount a vfat-formatted usb stick, the kernel will fail to load the... | Is it normal that a restart is required to mount USB after a kernel upgrade? |
1,394,457,423,000 |
I have a USB rocket launcher that I wish to experiment with through libusb. However, libusb cannot claim the interface; presumably because the output of usb-devices lists 'usbhid' as the driver for the device.
From reading around on the internet, I've only come to the conclusion that I need to detach this driver from ... |
If you simply run the libusb program as root,
usb_detach_kernel_driver_np()
actually works as expected.
| Prevent claiming of novelty usb device by usbhid so I can control it with libusb? |
1,394,457,423,000 |
If I disable memory overcommit by setting vm.overcommit_memory to 2, by default the system will allow to allocate the memory up to the dimension of swap + 50% of physical memory, as explained here.
I can change the ratio by modifying vm.overcommit_ratio parameter.
Let's say I set it to 80%, so 80% of physical memory m... |
What the system will do with the remaining 20%?
The kernel will use the remaining physical memory for its own purposes (internal structures, tables, buffers, caches, whatever). The memory overcommitment setting handle userland application virtual memory reservations, the kernel doesn't use virtual memory but physica... | Where the remaining memory of vm.overcommit_ratio goes? |
1,394,457,423,000 |
When my kernel boots, apart from the useful important information, it prints lots of debugging info, such as
....
kernel: [0.00000] BIOS-e820: [mem 0x0000000000000000-0x000000000009d3ff] usable
kernel: [0.00000] BIOS-e820: [mem 0x000000000009d400-0x000000000009ffff] reserved
kernel: [0.00000] BIOS-e820: [mem 0x000000... |
For syslog You can add following line to /etc/syslog.conf:
kern.info; kern.debug /dev/null
It will discard kernel .info and .debug messages ( which are discarded with loglevel=5 )
Also, dmesg can be used with option -n to show messages with certain loglevel.
| decrease kernel boot log verbosity level |
1,394,457,423,000 |
I'm running Debian Testing (Last updated 31/10/2017) and when I play a video in full screen through a browser from either Twitch or iView it hangs the GPU, so the GUI is all frozen.
The computer I have is an 'Up Squared' with an Intel 505HD.
The kernel is still running though, as I can still access it via ssh.
I'm ru... |
Please do as root:
EDIT /etc/default/grub
Find the line that starts with GRUB_CMDLINE_LINUX and append i915.enable_rc6=0, giving you for example: GRUB_CMDLINE_LINUX="splash quiet i915.enable_rc6=0"
EXECUTE: update-grub
REBOOT
(optional step) EXECUTE systool -m i915 -av | grep enable_rc6 to check whether you have set... | drm/i915: Resetting chip after gpu hang |
1,394,457,423,000 |
Does the latest version of the Linux kernel (3.x) still use the Completely Fair Scheduler (CFS) for process scheduling which was introduced in 2.6.x ?
If it doesn't, which one does it use, and how does it work? Please provide a source.
|
That's still the default, yes, though I would not call it the same, as it is constantly in development. You can read how it works with links to the code at http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=Documentation/scheduler/sched-design-CFS.txt
| Does Linux kernel 3.x use the CFS process scheduler? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.