date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,455,343,387,000 |
While an application is running, I can monitor disk bandwidth usage using linux tools including dstat.
Now I'd like to know how many sequential or random disk I/Os are occurring in the system.
Does any one know any ways to achieve this?
|
Ypu can write your own FUSE filesystem (what you can do using almost any scripting/programming language, even bash) , that would just proxy filesystem calls to pointed filesystem (and eventually translate paths) plus monitor what you minght want to monitor.
Otherwise you might investigate output of strace for programs... | Is there a way to monitor disk i/o patterns? (i.e. random or sequential i/o?) |
1,455,343,387,000 |
My IOstat doesn't change...at all. It'll show a change in blocks being read and written, but it doesn't change at all when it comes to blocks/kB/MB read and written. When the server sits idle...it shows 363kB_read/s, 537kB_wrtn/s.
If I put it under heavy load...it says the same thing. Is it bugged out? How do I fix i... |
Could you list the specific command you are using?
The first printout is usually the average over the life of the system it rarely changes.
Run "iostat -x 1 10" that will get you 10 runs of iostat in 1 second intervals with extended statistics. run 2 - 10 should have the data you want. If it does then you can fiddl... | Why doesn't my IOstat change its output at all? |
1,455,343,387,000 |
I have a CentOS 7 server (kernel 3.10.0-957.12.1.el7.x86_64) with 2 NVMe disks with the following setup:
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme0n1 259:0 0 477G 0 disk
├─nvme0n1p1 259:2 0 511M 0 part /boot/efi
├─nvme0n1p2 259:4 0 19.5G 0 part
│ └─md2 9:2 ... |
The source of the abysmal iostat output for %util and svctm seems to be related to a kernel bug which will be solved in kernel-3.10.0-1036.el7 or in RHEL/CentOS release 7.7. Devices that have the scheduler set to none are affected, which is the default for NVME drives.
For reference, there is a Redhat solution (logi... | NVMe disk shows 80% io utilization, partitions show 0% io utilization |
1,455,343,387,000 |
I'm using iostat to get the current disk load each second with iostat -dx 1 (specially, %util column). However, I'd like to put this in a bash script and control the interval with the watch command such as: watch -n 1 ./script.sh.
Running the following in script.sh won't print a thing:
io_load=`iostat -dx 1`
echo $io_... |
The man page of iostat says:
The interval parameter specifies the amount of time in seconds between each
report. The first report contains statistics for the time since system
startup (boot), unless the -y option is used (in this case, this report is
omitted). Each subsequent report contains statis... | Current disk load |
1,455,343,387,000 |
I see conflicting information online about use of IOSTAT. In particular I would like to be able to show an average since boot. Based on information I have read if I have never issued the command IOSTAT it will show the average since boot. But if at some point I have issued an IOSTAT command the next execution will ... |
iostat displays stats since boot, once (per command run, not per boot). Then depending on parameters (eg: running iostat 2, for every two seconds), it will display stats since previous display in the same command run:
The first report generated by the iostat command provides statistics
concerning the time since the... | Does IOSTATS show output since boot or since last execution? |
1,455,343,387,000 |
We presume to have a faulty cable that connects the SAN to a direct I/O LDOM. This is a snippet of the error when running iostat -En
c5t60060E8007C50E000030C50E00001067d0 Soft Errors: 0 Hard Errors: 696633 Transport Errors: 704386
Vendor: HITACHI Product: OPEN-V Revision: 8001 Serial No: 504463
Size: 214... |
A search through the Illumos fiber-channel device code for ENODEV shows 13 uses of ENODEV in the source code that originated as OpenSolaris.
Of those instances, I suspect this is the one most likely to cause your "No device" errors:
pd = fctl_hold_remote_port_by_pwwn(port, &pwwn);
if (pd == NULL) {
fcio->fcio_err... | What does "no device" mean when running iostat -En |
1,455,343,387,000 |
I would like to remove both headers (that are incidentally repeated). Any solution for it?
[root@report]# iostat -xd 5
Linux 3.10.0-693.21.1.el7.x86_64 (mdds-pgbackup-01) 07/05/2018 _x86_64_ (2 CPU)
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_a... |
The easiest way is just to use `egrep':
iostat -xd 5 | egrep -v "Linux|Device"
egrep prints lines with multiple strings via extended regular expressions and -v prints lines not containing those strings which, in this case, are "Linux" and "Device".
Output:
vda 0.07 0.28 0.31 4.22 9.25 2... | How can I remove the headers |
1,455,343,387,000 |
I don't see 'sar' command accepts date-and-time as starttime(-s) or endtime(-e) than just time. So, how to query 'sar' for more than one day's data point with older date and times(-f not going to help here). The output of the 'sar' command should have date value too as well for the data points - instead of just time ... |
You cannot do so directly. sar(systat) and friends are fundamantally limited to daily records.
From "sadc.c" (in sysstat-11.7.2):
485 void setup_file_hdr(int fd)
486 {
...
507 file_hdr.sa_day = rectime.tm_mday;
508 file_hdr.sa_month = rectime.tm_mon;
509 file_hdr.sa_year = recti... | how to query sar(sysstat) for more than one day data points |
1,455,343,387,000 |
/dev/sdc is a SATA hard drive. Do the kB_read and kB_wrtn fields sometimes, in some situations, show total counts? Here it seems to be just the same as the per second value.
Linux kernel 5.4.0-26-generic.
sysstat version 12.2.0
iostat -dz 1
Device tps kB_read/s kB_wrtn/s kB_dscd/s kB_read ... |
kB_wrtn is the total amount written during the iostat update interval. I suppose you used an interval of one second to generate the output in your question, which has the effect that kB_wrtn/sec is the same. Try a different interval to see the difference.
| In iostat, why are kB_wrtn/s and kB_wrtn the same? |
1,455,343,387,000 |
I've been looking and looking and everybody explains the /proc/diskstats file, but nobody seems to explain where that data comes from.
I found this comment:
Just remember that /proc/diskstats is tracking the kernel’s read requests–not yours.
on this page:
https://kevinclosson.net/2018/10/09/no-proc-diskstats-does-not... |
So I found it...
it seems the kernel supplies helper functions for you....
you need the request_queue, the bio and the gendisk, call these before and after you process the io...
unsigned long start_time;
start_time = jiffies;
generic_start_io_acct(q, bio_op(bio), bio_sectors(bio), &gd->part0);
generic_end_io_acct(q, ... | How do I get the linux kernel to track io stats to a block device I create in a loadable module? |
1,455,343,387,000 |
I have a bash script to do calculation. This calculation generates big scratch files as big as 12 GB and the disk usage of scratch folder is ~30 GB. I want to know how much total data is written to disk during the process and how much total data is read. This will help me to understand the disk IO bottlenecks and choo... |
You can read the I/O stats from /proc/self/io before and after your task, and subtract the values from the "write_bytes" and "read_bytes" lines. See "man proc" for some details.
It does not differentiate by device or folder, though.
Here's an example:
#!/bin/bash
cat /proc/$$/io
dd if=/dev/zero of=/tmp/iotest bs=1M co... | Track total data written in and read from a folder within bash script |
1,455,343,387,000 |
First off, I asked this question 5 days ago over on Serverfault. I hope I'm not doing a bad by bringing it over here to the Unix&Linux Stack. I have also asked this question on 3 other sites not related to Stack, with no answers. I plan on updating each site with an answer, if I can just get it answered. Here we go.
I... |
Here are some hints. Yes, it should, because zfs volume is created on zpool which is located on a storage device. If that storage is shared between other resources, they can affect zfs pools and volumes.
Unfortunately, I do not know what Proxmox is, but %util usually shows the time the device has a positive queue of t... | Reading iostat utilization with ZFS zvols |
1,569,400,546,000 |
After running below command i got error:
# apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.9.0-3-amd64
E: Couldn't find any package by glob 'linux-headers-4.9.0-3-amd64'
E: Couldn't find any p... |
For
apt-get install linux-headers-$(uname -r)
to work, you need to be running a kernel which is still available from the distribution repositories; in most cases, this basically means you need to be running the latest supported kernel for your distribution.
On Debian, the simplest option is
apt-get update
apt-get ins... | Failed to update Linux headers on debian stretch / Debian 9 |
1,569,400,546,000 |
I've been browsing my /usr/include folder trying to get acquainted with the layout and I've noticed that there are multiple copies of header files (at least by name, I didn't actually diff them to see if they were exact copies) found in several sub directories of /usr/include. This is especially the case for standard ... |
No, they aren't exact copies.
If you care to investigate, you'll find that the files at the top level /usr/include will normally have a lot of #ifdefs or other conditionals, and they'll only define the architecture-independent parts and will #include other stuff from architecture-specific directories deeper within the... | Why are there multiple copies of header files in /usr/include? |
1,569,400,546,000 |
I am trying to install kernel headers version 4.14.71-v6 (uname -r) for Kali Linux. I already did the common commands...
apt update
apt upgrade
apt dist-upgrade
apt install linux-headers-generic
alt install linux-headers-$(uname -r)
...with and without option -y
Also did reboots. I searched the repos by apt search 4.... |
You are not finding the headers for your kernel version, in the official distribution repository, because you are dealing with a Kali setup using a custom made kernel version.
Whist we do not have all data, from you uname -r, it leds me to suspect it was made using these scripts/tools https://github.com/Re4son/re4son-... | Kali Linux kernel headers for 4.14.71-v6 |
1,569,400,546,000 |
It might be a incoherent question about kernel headers as I don't have clear understanding about it and where and how it is used. I think it might get flagged down. My question has 3 parts:
I think Kernel headers provide a interface so that other part of the kernel, like modules, can use them. That's my bookish knowl... |
Welcome to Unix & Linux StackExchange!
Yes, the kernel headers provide an interface for other parts of the kernel - in this you're entirely correct. They also include definitions for the interface between the kernel and the userspace - but usually the "raw" kernel interface is not used directly, but through the C libr... | What is kernel headers that can be used in userspace? Do their signature or interface differ than the headers in different directories? |
1,569,400,546,000 |
Am currently running POP_OS 20.04 (LTS). When I open the terminal and run the command,
dpkg --list | grep linux-image
it returns a list of apparently installed images, including my current (6.0.12) and most recent (5.17.5), about nine images from version set 5.0 and six from version set 5.3 ...plus one from 4.18 and ... |
The rc marker at the start of each line indicates that the packages are removed, but configured — i.e. all their contents have been removed, apart from configuration files. Packages in this state don’t appear in Synaptic by default.
You can remove them with sudo dpkg --purge or sudo apt purge, listing the packages you... | How to remove old kernel images |
1,569,400,546,000 |
From my nginx server I want to get an auth response with custom headers from an external Apache server. The problem is, I can't get the custom header's value.
location /app {
auth_request /auth;
add_header custom $http_x-customheader;
}
location = /auth {
... |
Got it:
auth_request_set $myheader $upstream_http_x_costumheader;
add_header costum $myheader;
| NGINX can't read custom headers from response |
1,569,400,546,000 |
The last time I needed to deal with kernel headers was back in the Pleistocene (2.6 or so) and I remember back then that you needed to match your kernel headers not to the kernel you were running but to the kernel version glibc was compiled against. But this was a long time ago and before the kernel exported its own h... |
I have an old Slackware server running a 4.6 kernel instead of its original 3.10 and have not had to mess with the headers. I've built at least a dozen kernels for half a dozen Slackware versions over the years and never did anything about headers or glibc on any of those.
Of course, without the newer headers, you may... | Should my Linux headers match my running kernel or what glibc was compiled against? |
1,569,400,546,000 |
I try to install VirtualBox Guest Additions on a CentOS 7 VM.
I installed the prerequisites via
sudo yum install perl gcc dkms kernel-devel kernel-headers make bzip2
then I "inserted" the Guest Additions CD image and the Guest Additions auto runner came up and ran.
However the Guest Additions installation errored out... |
Please install headers exactly based on your kernerl release.
sudo yum install kernel-headers-$(uname -r) kernel-devel-$(uname -r)
| Want to install VirtualBox Guest Additions on CentOS 7 but get a header mismatch |
1,569,400,546,000 |
So, I am writing a module, that is working in kernel space.
My code compiles correctly and works correctly.
The thing is that there are some header files, which I couldn't find anywhere.
That doesn't make sense to me, how come everything goes right when header files are not present.
They must be present somewhere.
The... |
You’ll find the header files used by your build in /lib/modules/$(uname -r)/build/, see for example
find /lib/modules/$(uname -r)/build/ -name timeconst.h
All these files are generated during the build, in various ways; timeconst.h is built by kernel/time/timeconst.bc.
/lib/modules/$(uname -r)/build/ stores the gener... | Can't find the source of some "asm", "generated" header files in linux kernel? |
1,569,400,546,000 |
I have Ubuntu 16.04 LTS installed and have installed linux-headers. I am in the middle of trying to build uClibc-ng and it needs the linux headers. So when I run the following command from the linux-headers directory I get the following error messages. What step am I missing?
sudo make INSALL_HDR_PATH=/tmp/linux-he... |
I finally figured this out. I went to GitHub and get the Linux sources associated with the version of Ubuntu I am running. I was able to run:
make \
ARCH=<arch-name> O=. -C <path-to-linux-sources> \
headers_install INSTALL_HDR_PATH=<output-directory>
This worked like a charm and did not require having to run i... | make headers_install not working as expected |
1,569,400,546,000 |
When I run vmware in Kali Linux, this keeps showing up:
I have kernel headers for version 6.3.0-kali1-amd64. What path do I use? When I choose a folder, this shows up:
I looked up the answers online and ran this script: sudo apt-get install linux-headers-$(uname -r) but it returns E: Unable to locate package linux-h... |
You have updated the system, but have not yet rebooted, so the system is still running on the old (pre-update) kernel. The package management system refuses to install an older linux-headers package because after just one boot you will be running a newer kernel and any modules built for the old one will be useless.
Yo... | What folder do I choose in the VMware kernel module updater? |
1,569,400,546,000 |
I want to build an out-of-tree driver using a kernel built from the latest mainline source code. I use localmodconfig when building, which reduces the number of modules and kernel symbols exported to match devices available on the system, per my understanding. The out-of-tree driver requires symbols that aren't used b... |
I suspect there’s some misunderstanding of what TRIM_UNUSED_KSYMS does. Its Kconfig description is as follows:
The kernel and some modules make many symbols available for
other modules to use via EXPORT_SYMBOL() and variants. Depending
on the set of modules being selected in your kernel configuration,
many of those e... | What is the correct usage of CONFIG_TRIM_UNUSED_KSYMS and the whitelist file? |
1,569,400,546,000 |
Basically, I am working with Nvidia's new github repos and trying to compile them in a cross-platform setup. Specifically, I am trying to compile them on Fedora 33.
I have run into an issue:
In file included from /home/chris/.../sample_example.cpp:55:
/home/chris/.../nvml_monitor.hpp:19:10: fatal error: cfgmgr32.h: N... |
In Linux, this information is available in /proc/stat’s cpu line, and is usually parsed from there — I don’t think there’s a user-space-accessible function which will provide the same information.
The values in that line give the time spent user mode, the time spent in user mode with low priority, the time spent in sy... | C-std headers containing helper functions for system, user and kernel times? |
1,569,400,546,000 |
I'm trying to understand how Linux works and how to build modules.
So far I saw that Linux headers are stored in /usr/include and that the compiled implementation of these interfaces are located in /usr/lib/x86_64-linux-gnu. I have a few questions:
How does Linux or any C program know where to look for the headers an... |
I'm trying to understand how Linux works and how to build modules.
Building kernel modules doesn’t involve the “standard” C compiler directories; instead, see /lib/modules/$(uname -r)/build.
C programs don’t know where to look for headers and libraries; the C preprocessor and compiler do. You can see the standard i... | How are conflicts avoided in Linux Headers? |
1,569,400,546,000 |
I'm using Debian 12 Bookworm, and currently, when I run uname -a, it shows:
Linux pctxd 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
The package linux-image-6.1.0-21-amd64 and related packages are ready to install. However, the corresponding linux-headers-6.1.0-21-amd64 package... |
The kernel image and headers packages come from the same source package, so they are available simultaneously on the mirror network (barring failures on a specific mirror). If you follow the amd64 link on the linux-headers-6.1.0-21-amd64 package page, you’ll find a package download link which works; that’s the package... | How to defer kernel updates until the corresponding "linux-headers" package is available? |
1,569,400,546,000 |
I have an Open SUSE micro OS host with kernel 6.5.9-1-default and an Ubuntu 22.04 distrobox container.
I need to install the linux-headers-$(uname -r) and linux-modules-extra-$(uname -r) packages and the problem is that Ubuntu 22.04 at the time I'm writing doesn't have these packages, their most recent kernel is 6.2.
... |
Ultimately, you’ll need to load your modules into the host kernel, so you need to build them with the host’s configuration exactly. Even finding a matching kernel in your Ubuntu container wouldn’t help, you need the headers matching the host’s kernel and configuration.
I don’t know whether micro OS even supports this,... | Linux header and extra modules on ubuntu container from an open suse micro os host with mismatch kernel versions |
1,569,400,546,000 |
I'm creating a program that interacts withkernel headers. The user can provide a path to the location of the headers, but first I would like to be able discover existing kernel headers on the users's machine based on convention. This apparently varies between distributions and tools. I know technically linux is fully ... |
Normally make modules_install but of course distros just package all these modules.
This looks like a Debian/Ubuntu thing. depmod just traverses all the subdirectories under /lib/modules/$version
For Fedora/RHEL/CentOS or the Linux kernel installed from source - the answer is yes.
Normally they are always symlinks
Al... | what are the conventions around /lib/modules? |
1,569,400,546,000 |
My current use case is installing PyODBC via poetry in a Jenkins job build, which is failing because sql.h can't be found.
For background, I have two servers, one RHEL 6, one RHEL 7; the RHEL 6 server has unixODBC installed and working with (among other things) odbc.ini in /etc/, sql.h and other headers in /usr/inclu... |
The installation on your RHEL 6 server was probably done using the RHEL package of UnixODBC. This is easy to replicate on your RHEL 7 server:
yum install unixODBC-devel
will install the headers, development files and all their dependencies.
We won’t be able to tell you why the two installations were performed differe... | UnixODBC-dev installed in /usr/local/, resulting in gcc reporting sql.h can't be found |
1,569,400,546,000 |
I have a ts7400v2 sbc and I am trying to install the linux-headers. I run:
sudo apt-get install build-essential linux-headers-$(uname -r)
but get the following error:
sudo: unable to resolve host ts7400-4e7b7c
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable t... |
The TS4700 v2 SBC isn’t supported by the standard Debian kernel, it uses a variant provided by the manufacturer. This means you can’t use Debian-provided kernel packages, including the header packages.
To build extra modules for the system, you should cross-compile, building the kernel on the SBC isn’t recommended. Se... | trying to install linux headers but not found in sources |
1,569,400,546,000 |
I'm trying to install VirtualBox guest additions on Kali Linux 2018.1 with the kernel version 4.14.0
But when I try to install them from the guest additions ISO by running the VBoxLinuxAdditions.run file it gives the error for missing the linux-headers-4.14.0-kali3-amd64 header.
When I search the apt cache it doesn't... |
Kali Linux is based on Debian testing and therefor the injectable ISO from virtualbox will usually be for an earlier version of the Linux kernel. I want to generalize this answer as this same problem will always apply to Kali Linux so long as its based on Debian testing (aka Sid).
If you do not need x support install ... | Kali Linux VirtualBox Header Problems [duplicate] |
1,315,584,183,000 |
I posted a question and noticed people weren't distinguishing correctly between many of these things: Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment. Can someone please clear this up, i.e. tell us the difference between them and how they are related perhaps?
What category does Xorg fall... |
From the bottom up:
Xorg, XFree86 and X11 are display servers. This creates the graphical environment.
[gkx]dm (and others) are display managers. A login manager is a synonym. This is the first X program run by the system if the system (not the user) is starting X and allows you to log on to the local system, or netw... | Windows Managers vs Login Managers Vs Display Managers Vs Desktop Environment |
1,315,584,183,000 |
I'm using linux mint with Cinnamon. The login screen comes to type a username but it also displays that in 10 seconds userx will be automatically logged in.
And it happens.
How to make it wait indefinitely?
|
Edit
/etc/mdm/mdm.conf
and set
AutomaticLoginEnable=false
| how to disable auto login in linux mint |
1,315,584,183,000 |
I need to run the web browser with another user but I don't want the user to be shown at the login screen. How can I create a user that will not be listed on the login screen? GNOME/Scientific Linux 6.3.
|
Edit /etc/gdm/custom.conf and add or change the Exclude directive in the [greeter] section:
[greeter]
Exclude=nobody,alice,bob
Users alice and bob won't be shown on the list at the login screen but can still log in by typing their name and password (if they have a password).
See more details in How to hide users from... | How to create a user that doesn't show up on the login screen? |
1,315,584,183,000 |
I have installed xmobar, xmonad on ubuntu 11.04.
#!/bin/bash
trayer --edge top --align right --SetDockType true --SetPartialStrut true \
--expand true --width 10 --transparent true --tint 0x191970 --height 12 &
nm-applet --sm-disable &
sleep 3
gnome-power-manager &
xmonad
I put this in my .xsession file. But i... |
I think the most probable stopper here would be that your .xsession script lacks the execute permission (+x).
In gdm, you also need to choose “Custom Session” (and not the standard “Xmonad” session) in the Session menu before logging in.
| My .xsession and .xinitrc files are not executing |
1,315,584,183,000 |
I am on SLiM, and I don't like the default login screen. I want a login screen like the one shown below:
But instead I have a pretty minimal one which has just one textbox and nothing else on the screen. I can't find a screenshot of it, but that is what I got when I am done installing.
Is changing to GDM the only w... |
I found that this is possible by editing the slim.conf file available in /etc.
You would need admin credentials to open this file.
SLiM themes are placed in /usr/share/slim/themes:
In the slim.conf file, there is a section that mentions the theme:
# current theme, use comma separated list to specify a set to
#... | How to change login screen in CrunchBang? |
1,315,584,183,000 |
I have installed sway window manager on Fedora 27. The system uses gdm as its login manager. But gdm does not provide sway for selection as the login session. Only Gnome, which is also installed on the system, is shown. I did not had this problem with i3wm, when I tried it.
Is sway compatible with gdm?
Does gdm suppo... |
Is sway compatible with gdm?
yes
Does gdm support wayland or only Xorg?
gdm3 itself runs on wayland. It supports both wayland and Xorg sessions.
How to configure gdm for sway?
You are missing an entry in /usr/share/wayland-sessions. This folder contains wayland desktop session entries for display managers in gen... | How to configure gdm for login into a sway session? |
1,315,584,183,000 |
Is it possible to change the location for .Xauthority, to something other than $HOME/.Xauthority ? AFAIU, this file is being created every time I log into LXDE, by my login manager slim.
The problem I am having is following:
I want to set my home to "immutable" using extended attributes:
chattr +i /home/martin/
This ... |
The location of the X cookie file can be configured with the XAUTHORITY environment variable. The default is ~/.Xauthority.
Of course, the location that you pass to applications has to match the location where the cookie is stored. SLiM doesn't offer a way to add the cookie to a different file: it has ~/.Xauthority ha... | change location of $HOME/.Xauthority |
1,315,584,183,000 |
I'm about to start working on my own display/login manager. I think I'll be able to handle all of the X11 stuff, but I realized I have no clue what to do when the user types in their username and password.
Once a display manager has a username and password, what does it do? How does it log you in? Are there any other ... |
I think I've made some progress on understanding this question, so I'll post what I know here. This answer is currently for those systems that use PAM. I'll add more on other methods of login as I encounter them.
After you type in your username and password into the fields of your display manager, the display manager ... | How do display managers log a user in? |
1,315,584,183,000 |
I am disappointed with existing Display Managers, and so I was wondering wheteher I could live without one. I have very basic needs on my laptop. I have one user martin who wants to be logged into LXDE automatically after boot.
I have made following change in /etc/inittab
#1:2345:respawn:/sbin/getty 38400 tty1
1:2345:... |
Use small footprint Display Manager.
SLIM
With this display manager, some manual configuration is needed. Please refer to their official document and write your /etc/slim.conf and ~/.xinitrc. The command you should put in your ~/.xinitrc to start LXDE is:
exec startlxde
The above is coming from : http://wiki.lxde.or... | starting LXDE automatically (without Display Manager) |
1,315,584,183,000 |
To meet my security needs I set up quite long user password on my notebook. But when I am at home or other secure location, typing it down is cumbersome.
It would be nice to let the gdm (or: mdm, since I am using Mint 13 with Mate) search for a specific file (on a pendrive), and when it is present, treat is as a secu... |
You want to use pam_usb.
Read more here:
http://pamusb.org/
| Mint 13: Is it possible to skip standard login password dialog in presence of a pendrive with the key |
1,315,584,183,000 |
I have Debian installed, and am using XFCE. How do I figure out which login manager I have installed?
|
This command should list all of your Login managers installed:
dpkg -l | grep -i 'Display Manager\|Login Manager' | awk '$2 !~ /^lib/'
It will search for the keywords "Display Manager" and "Login Manager" and show only things that do not start with "lib" on the second column.
Note: If you have more than one Display M... | Which login manager am I using? [duplicate] |
1,315,584,183,000 |
I'm running Redhat 5.6 with the gnome display manager. I would like to configure the login manager so that there is no echo of the password when typing it in (no asterisks or the like). I have edited the files /usr/share/gdm/defaults.conf and /usr/share/gdm/factory-defaults.conf and changed the line
#UseInvisibleInE... |
Given that a reboot fixed the problem, what you missed is that you needed to tell the login manager (gdm) to reload its configuration. Most system services do not reload their configuration when you change it, in fact few applications automatically reload their configuration files if you edit the file directly (as opp... | Trying to remove password echo in Redhat 5 when logging in |
1,315,584,183,000 |
I have Linux Mint 14 Xfce (4.10) and have also installed LXDE desktop, so I can choose between these sessions if I want. Normally I would set one as default and at startup I am not asked for username&password and am logged in automatically as intended.
(Under Settings/Login Window/Security - "Enable automatic login" i... |
Trying many possible combinations of settings I solved it but the conclusion is that there is something amiss with Xfce's session manager settings or GUI.
What I have verified is:
As stated in the question, when this problem happens, under Settings/Login Window/Security - "Enable automatic login" is checked, like so:... | How to enter/choose session after logout without password in (Linux Mint) Xfce? |
1,315,584,183,000 |
How to add a user that accept any password as a valid password?
PS:
I am aware of the security issue. The user will have a very restricted access (as the guest user in Ubuntu).
related question: How to log into another user if the entered password is wrong?
|
This configuration was tested on Ubuntu 16.04.1 LTS Server. Modify /etc/pam.d/common-auth.
# [...]
auth [success=2 default=ignore] pam_unix.so nullok_secure
auth [success=1 default=ignore] pam_succeed_if.so user = the_username
# [...]
auth requisite pam_deny.so
# [...]
auth required pam_permit.so
# [...]
The success... | How to add a user that accept any password as a valid password? |
1,315,584,183,000 |
Currently when I login I do not have to provide a login password. I simply click on my user name and I get in. I would like to change that. In order to accomplish that I went to settings >> users and then in Login options there was no password set next to the Password label. So I clicked on it and was prompted to ent... |
Have you tried passwd from the command prompt?
| setting up a startup login password Fedora 20 |
1,315,584,183,000 |
I've upgraded from Fedora 27 to 29. The upgrade itself passed fine, just after final reboot, the graphical login screen (sddm) just flickered standard screen with users and then displays virtual keyboard on black background. Similar to this picture:
What can I do to avoid this behaviour?
|
The virtual keyboard should be by default diplayed on devices without HW keyboard (like tablets). However not on normal PC with keyboard attached.
To avoid virtual keyboard in the sddm open /etc/sddm.conf, find the section [General] and put there InputMethod= without any value. Like this:
[General]
InputMethod=
As of... | Fedora 29 graphical login screen (sddm) displays only virtual keyboard |
1,315,584,183,000 |
Recently sddm has become very slow to show the login screen on Arch Linux. After I see the bootup message "Reached Graphical User Interface target" (or similar), there is a long delay of more than 10 seconds before the sddm greeter is displayed.
The logs below show that the whole bootup process is slow:
Startup fini... |
Over on the Arch Linux BBS, Haller wrote:
It's a kernel problem:
https://bbs.archlinux.org/viewtopic.php?id=236696
This resolved it for me:
pacman -Syu haveged
systemctl enable haveged.service
systemctl start haveged.service
That change reduced this phase of startup from 13 seconds to about 1 second:
I tested this o... | sddm slow to launch [duplicate] |
1,315,584,183,000 |
I have looked and not found one. I'm surprised, as something as trivial as this should be configurable via a GUI. Even SDDM for KDE doesn't offer this and KDE is normally super configurable via GUI.
This is NOT about doing this by command line and editing config files, that is possible.
|
You absolutely can change the SDDM background through the GUI, it's right there in System Settings.
| Is there a login / display manager in Linux with a config GUI for setting wallpaper (NOT editing config files by CLI)? |
1,315,584,183,000 |
I'm working towards an Arch install with a tiling window manager (probably i3) but was wondering whether it's possible to use a login manager and have the Gnome 3 desktop available as a fallback.
So that one user would have the option to select either the Gnome desktop, or the i3 window manager on login. Or would it o... |
Most display managers let the user choose a session type when logging in. The primitive xdm doesn't but more recent ones such as gdm, kdm, lightdm, etc. do. There's a directory, usually either under /etc/X11 or under the display manager's configuration directory, that records session names with the program associated ... | Can I use a login manager to choose different window managers? |
1,395,332,081,000 |
How can I select a bunch of text and comment it all out?
Currently I go to the first line, go to insert mode then type # left-arrowdown-arrow and then I repeat that sequence, perhaps saving a few keystrokes by using the . repeat feature to do each line.
Is there anyway I could (for instance) select either multiple li... |
Ranges:
You can do it with the following commands:
for commenting:
:66,70s/^/#
for uncommenting:
:66,70s/^#/
Obviously, here we're commenting lines from 66 to 70 (inclusive).
| How to comment multiple lines at once? [duplicate] |
1,395,332,081,000 |
How can I configure a shortcut key to send a text string to the current program?
The purpose is to type common entries quicker (email address, street address, phone number, username, favorite quote, etc).
I don't need any further automation than just entering the text.
Gentoo Linux (3.2.12-gentoo)
Xfce Desktop Environ... |
One simple approach is xdotool, like
xdotool type 'text'
| Keyboard Shortcut To Send Text Strings To Program |
1,395,332,081,000 |
In vim, if I'm working on a Python script, I will commonly type:
:! python this_script.py
to execute the script. Is there a shortcut for the name of the current file? If not, can I easily make one? I'm new at vim, and I'm not sure how to google for this.
|
You can just use % for current file. This command should serve your purpose:
:! python %
| Is there a vim shortcut for <name of current file>? |
1,395,332,081,000 |
I have a small numpad keyboard which I would like to use for launching macros and shortcuts, along side my regular keyboard. I can attach macros and shortcuts to these keys (i.e, numpad 1 minimises the active window), but my primary keyboard numpad also activates the shortcut.
I would like a way to have the secondary ... |
While my other answer will probably work on most Linuxes, even if they're many years old, SystemD and udev actually makes things easier:
use lsusb to find the vendor and product code of your additional keyboard. (In my case, it's Vendor 145F, Product 0177. Make sure to have the letters in uppercase.)
create a file /e... | Can I launch macros and shortcuts from a second keyboard on Linux? |
1,395,332,081,000 |
When I type the character q on my keyboard in vim, it exits vim. Why?
Today I tried it edit a file with the file extension .man. I wanted to edit the file with a macro, so I tried to type qq -- but when the first q was entered, vim closed!
vim test.man
This is on a fresh install on Debian 12. I do not have a .vimrc d... |
The Vim editor will load the man filetype plugin (ft-man-plugin) whenever it opens a file which has a .man filename suffix.
A more usable way of using this plugin is by loading it with
:runtime ftplugin/man.vim
... and then using the :Man command, e.g.,
:Man ls
One of the things the man filetype plugin changes is th... | Why does typing 'q' exit vim? (.man file) |
1,395,332,081,000 |
I have an application which is built using GTK+. The application has a very simple interface. When started, the same window always opens, with a few input controls.
We want to write a script to fill in text in a couple fields, check a check box, then click a button. Pretty simple, and would be easy to do if a command-... |
Give xdotool (Ubuntu man page) a look.
It's extremely powerful and should be able to do whatever you need.
http://www.semicomplete.com/projects/xdotool/
| Interacting with X applications programmatically |
1,395,332,081,000 |
I'm a big fan of keyboards, so a lot of thing a done by combination of keys, like open a file browser, web browser etc.
Is there some daemon that can monitor my key presses, and launch some program afterwards, so that I won't have to configure anything else after moving to another desktop environment?
|
I'm not sure what you're trying to do. If you want to make a key combination perform an action, you can use XBindKeys. The companion program xbindkeys_config can help define bindings. If you want to act on existing windows, invoke a program such as xdotool or wmctrl.
If you want to make a key combination simulate a se... | Making shortcuts cross desktop environment, possible? |
1,395,332,081,000 |
I can successfully create a tags file for vim with exctags (Exuberant Ctags).
However, creating tags allowing to jump to the prototype of a function does not work, due the system headers using a syntax-mangling macro of the form
#define _EXFUN(name, proto) name proto
and in, e.g. string.h using
char *_EXFUN(st... |
To handle that particular macro, you could use the --regex-<LANG> option:
ctags --regex-c='/^[^#]*_EXFUN *\( *([^ ,]+),.*/\1/p/' ...
Which generates a tags file with:
_EXFUN test.c 1;" d file:
strchr test.c /^char *_EXFUN(strchr,(const char *, int));$/;" p
| Undoing C syntax mangling macros to make exctags able to create prototype tags |
1,395,332,081,000 |
Question:
I'm using i3-wm and I have Mod3 working as a hotkey. I have the following in ./config/i3/config:
#This command works
bindsym Mod3+f exec "firefox"
#This doesn't work nor do my other scripts
bindsym Mod3+w exec "openBrowser"
Both of these commands work fine when I run them from bash but only the 'fire... |
I attempted to duplicate the issue you describe. What I found is that I had two i3 config files existing at the same time. ~/.config/i3/config and ~/.i3/config.
In my case, editing ~/.config/i3/config had no effect because it seems that ~/.i3/config trumps it.
It's a long shot, but see if maybe you have more than one ... | Execute script from i3 config |
1,395,332,081,000 |
Is there a way to make a macro operate up to a marker? I know if I do 5@a my macro will operate on 5 lines. Example:
set marker with `mc`
record a macro with `qa`
... now what?
Obviously 'c@a just moves the cursor to the marker at c. I've tried buffers, "b'c, but that just goes to the marker. I'm probably missing som... |
You might try this:
:.,'c normal @a
This uses the “ranged” :normal command to run the normal-mode command @a with the cursor successively positioned on the first column of each line starting with current line and going down to to the line with mark c. If the mark happens to be above the cursor, then Vim will ask if y... | Vim markers and macros |
1,395,332,081,000 |
Could you show me how to write macro in xmacro (that will work in whole desktop environment) that is able to expand strings?
E.g. I will type "thx" and it will expand to "thank you".
|
xmacro is a basic macro-recorder/macro-player.. it is good for some things, but is not suited to monitoring your keystrokes dynamically (other than for recording)...
xmacro: Record / Play keystrokes and mouse movements in X displays
You are probably better off using a tool like autokey.. You can find some tutorials... | Automating typing strings in xmacro |
1,395,332,081,000 |
I am on Linux Mint 18 Cinnamon 64-bit.
I was about to compile file-roller known as Archive manager for GNOME from source.
But when running:
./autogen.sh
There is a following M4 macro missing:
Checking for required M4 macros...
yelp.m4 not found
***Error***: some autoconf macros required to build Package
were not fou... |
You can use apt-file for this, without necessarily knowing where the M4 files go:
apt-file search yelp.m4
will tell you where the particular file should be located even without having the package (yelp-tools) installed.
yelp-tools: /usr/share/aclocal/yelp.m4
This tells you that installing yelp-tools should allow the... | Checking for required M4 macros... yelp.m4 not found |
1,395,332,081,000 |
I have following macro defined in my muttrc:
macro index s ":set confirmappend=no delete=yes auto_tag=yes\n\
<save-message>=archive\n<sync-mailbox>:set delete=ask-yes\n"
When I press s on a message, it will immediately be moved into my archive folder.
I would like to modify my macro, so that I will be asked for... |
Remove the \n from after the folder name so the command you are looking for is
macro index s ":set confirmappend=no delete=yes auto_tag=yes\n\
<save-message>=archive<sync-mailbox>:set delete=ask-yes\n"
| mutt: ask for confirmation before moving message to archive |
1,395,332,081,000 |
Is there anyway to let VIM expand the glob pattern to all files that match it?
e.g when I type *.c, and press some key, it would become a.c b.c
|
Take a look at the glob function (:help glob())
For example, this command
:nmap <leader>* ciW<C-r>=substitute(glob(@"),'\n',' ','g')<cr>
defines a normal-mode mapping that replaces the current word with space separated output of glob. Note that it will clobber your " register, which should not be a big deal as long ... | Expand pattern under cursor to all files matching it |
1,395,332,081,000 |
Inside of an RPM I have
%{__install} %{SOURCE2} %{buildroot}
I believe that %{__install} is a macro. Where do I find where it is defined? What is the definition? Was it provided by the system or distro, or is it a core rpm thing?
|
Using __install as an example you can see where it's defined with
rpm --showrc | grep __install
Or you can see the definition with
rpm --eval "%{__install}"
| How can I find where an RPM macro is defined or what it expands to? |
1,395,332,081,000 |
I have a list of 20 e-mail addresses that I'm trying to put in a macro variable as multiple rows in a shell script. In "wide" format it works fine and appears as:
to_list="[email protected],[email protected],[email protected],[email protected]"
I want something like below, and I'm having trouble with the quotes, comm... |
You want something like this:
to_list=(
"[email protected],"
"[email protected],"
"[email protected],"
"[email protected]"
)
mail -s "Subject text here." "${to_list[@]}" < body_text.txt
That is using an array, where you were trying to create a string.
| Put long list of e-mail addresses in multiple-row macro variable |
1,395,332,081,000 |
In the following makeffile one macro process it's arguments to call another macro. I expect that makefile below will generate two targets and correct list of the targets in $TARGETS. But in fact it only generates one target with correct list. How to do such macro call in correct way?
all: $TARGETS
define f2
.PHONY: t... |
Let's add some more debugging code.
all: $TARGETS
define f2
$$(info f2 called on $(1))
.PHONY: target$(1)
target$(1):
echo "We are in $(1)"
TARGETS+=target$(1)
endef
define f1
VAR$(1)=ValueWith$(1)
$(info too early: VAR$(1) is $$(VAR$(1)))
$$(info right time: VAR$(1) is $$(VAR$(1)))
$(eval $(call f2,$(VAR$(1))))
... | Gmake macro expansion: macro calls macro with variable in arguments |
1,395,332,081,000 |
I want to be able to run certain scripts by shortcut the way I do in ubuntu - for example some similar to this awesome script. (On that model I can search google the text selected in any text editor, or even translate it various languages, search it on different sites, etc).
How to use this type of script in elementar... |
It seems elementary-tweaks has no longer key bindings in elementary Freya. But luckily there is mode to bind keys in Freya also. You can use program named xbindkeys. Details about how to configure and use it you can find here.
excerpt
We only need xbindkeys, a simple yet powerful command line tool to
bind commands ... | How to run a script by shortkey in elementaryOS? |
1,395,332,081,000 |
My goal is to create a m4 macro, that reads a value from a file (BUILD), increases it and then saves the output into the file. I came up with the following solution (BUILD.m4):
define(`__buildnumber__',`esyscmd(cat BUILD)')dnl
define(`counter',__buildnumber__)dnl
popdef(__buildnumber__)dnl
define(`count',`define(`coun... |
The shell will always first empty file BUILD whenever you use > BUILD
in a command, before running m4, so this can never work.
What you can try is putting the write into BUILD within the m4 script.
For example, replace the last line count dnl with
syscmd(`echo 'count` >BUILD')dnl
| output redirection issue - m4 macro with self increasing build counter |
1,395,332,081,000 |
Is it possible to define a m4 macro (without arguments), which expands to 1 on first invocation, expands to 2 on second invocation, and so on? In other words, it should have internal memory storing the number of times it is invoked. Can this be done?
|
You can do that by having two macros, a counter holding the current value, and a count macro that expands to the value and redefines `counter'. For example, it could look like this
define(`counter',`0')dnl
define(`count',`define(`counter',eval(counter+1))counter')dnl
When the count macro is used, it firstly redefines... | m4 macro implementation of global (non-volatile) counter |
1,395,332,081,000 |
The dot command in Vim repeats the "last change", but I am not exactly sure what constitutes the "last change". For example, if I type the sequence:
A;{ESC}j.
Then a semi-colon is appended to the current line, but I have to type "j" again.
In other words, the dot macro only does "A;{ESC}", so apparently the ESC is d... |
A change is any command that modifies the text in the current buffer. You'll find all commands listed under :help change.txt. In insert mode, a change is further limited to a sequence of continually entered characters, i.e. if you use the cursor keys to navigate (which you shouldn't), only the last typed part is repea... | dot command in Vim, last change? |
1,395,332,081,000 |
I use mutt and I like to sort out some emails from various mailing lists. I still like them to come to my inbox, but when read, I want to move them somehow automatically.
Currently, I do the following:
Select the mails matching a pattern, e.g.: T~f facebook.com
Move them to some place: ;s=Facebook
I made some macros... |
I'm not a mutt user, but it looks like tag-prefix-cond can do this. It is like tag-prefix but if there aren't any tagged
messages, the command buffer is flushed without doing anything (in
other words, whatever hook you're in stops dead in its tracks), from this [email protected] archive.
| Mutt: move emails only if some emails are tagged |
1,395,332,081,000 |
Here's my .screenrc:
defscrollback 5000
vbell on
vbell_msg " dierre!!! ---- Wuff!! "
screen -t GRINDER ssh [email protected]
screen -t TRUNK
attrcolor b ".I"
termcap xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce "on"
# caption always "%3n %t%? @%u%?%? [%h]%?%=%c"
# hardstatus alwaysignore
hardstatus al... |
Add at the end of your .screenrc the following lines:
split
focus
other
To run multiple command, each in a separated split window:
screen -t title1 app1
split
focus
screen -t title2 app2
split
focus
screen -t title3 app3
and so on.
| Is it possible to have a screen macro for this? |
1,395,332,081,000 |
Recently upgraded from Debian Wheezy to Jessie (yeah, I know...). During said upgrade, the LibreOffice suite got upgraded from version 3.5.4 to 4.3.3.
Well, lots of my Writer macros were broken after said upgrade.
Is anyone aware of any issues that could have caused this as a result of said upgrade?
|
Apparently, at some time after version 3.5.4, LibreOffice changed the protocol by which they title various styles (FYI, in the example shown below, it is a paragraph style that is referenced).
A snippet of code from a Writer macro which was broken by the subject upgrade (FYI, I use the Record method to create most of ... | LibreOffice Upgrade from 3.5.4 to 4.3.3 Broke Lots of Macros |
1,395,332,081,000 |
I edit and correct a lot of identical files
using those commands
:%norm f^ID
:%s/\s\+$//
:%norm A,
:%norm GG$x
I also used the macro mode
qa
for record macro a
and
@a
to execute
But for some strange reason
or probably my error
it applied only some commands
My question is: is possible to save
those command in a scri... |
This is not exactly what you asked, but you can create vim scripts with your content. Lets start with a simple case:
$ cat noendspaces
#!/usr/bin/vim -s
:%s/ *$//
:r ! echo "\#last changed by $USER in :" `date`
:x
and then...
$ chmod 755 noendspaces
$ for a in file*.txt
do
./noendspaces $a
done
| vim: how to record norm commands? |
1,395,332,081,000 |
I have a spec file where its Requires: fields depend on the specific distribution it's being built on. So I need to be able to create a conditional structure along the lines of:
%if %{?fedora}
Requires: xterm libssh clang
BuildRequires: wxGTK3-devel cmake clang-devel lldb-devel libssh-devel hunspell-devel sqli... |
Quoting from https://fedoraproject.org/wiki/Packaging:DistTag#Conditionals :
Keep in mind that if you are checking for a specific family of
distributions, that you need to use:
%if 0%{?rhel}
and NOT
%if %{?rhel}
Without the extra 0, if %{rhel} is undefined, the %if conditional will
cease to exist, and the rpm w... | How to determine whether the system an RPM package is built on is CentOS from within a spec file? |
1,395,332,081,000 |
I have defined in Mutt two "trash" macros -- one for the Trash folder (just mark as deleted and sync) and one for the remaining folders (save into Trash and sync):
folder-hook . 'macro index <delete> "s=Trash<enter><enter><sync-mailbox><change-folder>^<enter>"'
folder-hook =Trash 'macro index <delete> "<delete-message... |
I think changing delete option at the beginning of the macro to ask-no and reseting to yes at the end should do the trick.
folder-hook =Trash 'macro index <delete> "set delete=ask-no;<delete-message><sync-mailbox><change-folder>^<enter>set delete=yes"'
| Mutt: ask before deleting messages from Trash |
1,395,332,081,000 |
I have to modify a LibreOffice template with a number of conditional statements.
I managed to figure out one can add such statements through Insert > Fields > More fields, tab Functions, type Placeholders and format Text (as of LibreOffice 5.0.6.2), but I can't seem to find the list of available functions.
Where do I ... |
I figured this is not a LibreOffice standard macro language, but relatorio, a subset of Genshi (the question was in the context of tryton).
According to the first link, supported directives from Genshi are :
py:for ;
py:if ;
py:choose ;
py:when ;
py:otherwise ;
py:with.
It seems that inside a TEST="" statement, stan... | LibreOffice placeholder fields documentation |
1,395,332,081,000 |
I noticed there's a similar answered question here, but that one's pertaining to the me package. I'd like to know if and how, if so, is it possible to that using ms instead.
|
Well this is embarrassing! A short while after giving up and posted this question I stumbled upon the answer:
.ds FAM H
If it's the first line in the document it'll set all text to use Helvetica by default, requiring you to use \f[font family descriptor] to change it to e.g. Times Bold-Italics. If it comes after the ... | How can you customise headings in the ms package for groff? |
1,395,332,081,000 |
I'd like to write a macro (index, pager) that saves a message to the Archive mailbox but keep the current message open / selected, or even to to the previous entry.
My current macro:
macro index,pager a "<save-message>=Archive<enter><previous-entry><enter>" Archive
The problem is that <save-message> seems to jump to ... |
Attention! It disables the confirmation dialog temporarily.
macro index,pager a ":set confirmappend=no<enter><tag-prefix><copy-message>=Archive<enter><sync-mailbox>:set confirmappend=yes<enter>" Archive
| Mutt: Save message to different folder but stay on it |
1,355,581,038,000 |
Is there any command that by using I can clean the cache in RHEL?
I used this command:
sync; echo 3 > /proc/sys/vm/drop_caches
but it didn't work.
|
Try sync; echo 1 > /proc/sys/vm/drop_caches.
| How to clear memory cache in Linux [duplicate] |
1,355,581,038,000 |
As described here, redirections use open() to write to a file. There's an inner (?) file descriptor created in the shell, and then used when needed.
Is the inner descriptor created for the whole duration of the script or the shell lifetime? Is it destroyed after some time, a number of operations, etc?
I mean in partic... |
Briefly: A shell will almost certainly close file descriptors related to redirections immediately after the command completes.
Details: There's no explicit mention of closing the files opened through redirections in POSIX (as far as I can see).
But not closing them immediately wouldn't be very useful.
The rules for t... | What's the lifespan of a file descriptor? |
1,355,581,038,000 |
I've been trying to understand the difference in use cases for Zswap, Zram, and Zcache. Apologies in advance for the long/slightly sloppily worded question.
I've done a bunch of googling, and I understand that zram is basically a block device for compressed swap, while zswap compresses in kernel using the frontswap ap... |
The best way I can attempt to answer those questions is to say what those three actually are.
zRAM
zRAM is nothing more than a swap device in essence. The memory management will push pages out to the swap device and zRAM will compress that data, allocating memory as needed.
Zswap
Zswap is a compressed swap space that ... | Zswap, Zram, Zcache desktop usage scenarios |
1,355,581,038,000 |
Executing (for example) the following command to get the list of memory mapped pages:
pmap -x `pidof bash`
I got this output:
Why some read-only pages are marked as "dirty", i.e. written that require a write-back? If they are read-only, the process should not be able to write to them... (In the provided example dirt... |
A dirty page does not necessarily require a write-back. A dirty page is one that was written to since the kernel last marked it as clean. The data doesn't always need to be saved back into the original file.
The pages are private, not shared, so they wouldn't be saved back into the original file. It would be impossibl... | Why read-only memory mapped regions have dirty pages? |
1,355,581,038,000 |
On a modern 64-bit x86 Linux, how is the mapping between virtual and physical pages set up, kernel side? On the user side, you can mmap in pages from the page cache, and this will map 4K pages in directly into user space - but I am interesting in how the pages are mapped in the kernel side.
Does it make use of the "w... |
On a modern 64-bit x86 Linux?
Yes. It calls kmap() or kmap_atomic(), but on x86-64 these will always use the identity mapping. x86-32 has a specific definition of it, but I think x86-64 uses a generic definition in include/linux/highmem.h.
And yes, the identity mapping uses 1GB hugepages.
LWN article which mentions ... | How is the page cache mapped in the kernel on 64-bit x86 architectures? |
1,355,581,038,000 |
A swap partition doesn't contain a structured filesystem. The kernel doesn't need that because it stores memory pages on the partition marked as a swap area. Since there could be several memory pages in the swap area, how does the kernel locate each page when a process requests its page to be loaded into memory? Let's... |
Swap is only valid during a given boot, so all the tracking information is kept in memory. Swapping pages in and out is handled entirely by the kernel, and is transparent to processes. Basically, memory is split up into pages, tracked in page tables; these are structures defined by each CPU architecture. When a page i... | How does the kernel address swapped memory pages on swap partition or swap file? |
1,355,581,038,000 |
From my understanding, when Linux swaps a physical page frame in/out RAM, it needs to set valid bit for all virtual pages mapping into this physical page. Mapping a virtual page to physical page frame seems to be well explained in textbooks, but how does the kernel find all virtual pages from a physical page frame? Ac... |
Each physical page of memory is tracked in the kernel using struct page. This allows the kernel to describe how each page is used; in particular, for anonymous and file-backed mappings, the mapping field points to the address_space structure used to describe the mapped object.
For code which needs to find virtual mapp... | How does Linux translate a physical address to (possibly multiple) virtual address? |
1,355,581,038,000 |
Can a Linux swap partition be too big?
I'm pretty certain the answer is, "no" but I haven't found any resources on-point, so thought I'd ask.
In contrast, the main Windows swap file, pagefile.sys, can be too large. A commonly cited cap is 3x installed RAM, else the system may have trouble functioning.
The distinction... |
Seeing articles like this disturbs me although I haven't researched the issue enough to confirm their conclusions. Having an overly-large swap partition on Linux will not cause any performance problems. Swap is used as necessary and can be somewhat controlled by swappiness. The amount of swap space allocated is never ... | Can a Linux Swap Partition Be Too Big? |
1,355,581,038,000 |
I have found some explanations about what "address binding" is. They say that "address binding is an operation of mapping virtual or logical addresses to physical addresses."
Is this definition correct?
I cannot make sure whether it is correct or not because a university presentation says that converting virtual addre... |
The explanation on Quora seems to me to be rather confusing, and mixes up a number of concepts.
The term “address binding”, in the context of memory addresses (as opposed to network addresses for example), comes from Leon Presser and John R. White’s 1972 paper on linkers and loaders (see also the ACM entry), where it ... | What is Address Binding? |
1,355,581,038,000 |
Does the process pre-allocate heap and stack memory while dividing it into pages?
If yes, will all those pages be empty initially?
|
Processes (or the kernel, acting on behalf of processes) pre-allocate address space, not pages. When a process allocates memory, the corresponding page-table entries are allocated, and initialised to point to the zero page (except on architectures which forbid this). The zero page is set up to return all zeroes on rea... | How does the paging concept work with heap and stack memory? |
1,355,581,038,000 |
I am studying Professional Linux Kernel Architecture and I am in Chapter 3 Memory Management. While I studied kernel address space itself is split into direct mapping area, vmalloc area, kmap area and fixed mapping area.
What I am wondering is just like below.
Can direct mapping area(896MB) of kernel address space ... |
Answers to questions 1 and 2: no, once paging has been enabled, the CPU instructions only use virtual addresses, which are translated to physical addresses using the MMU before reading or writing RAM. The __va and __pa macros don't access memory, they just convert addresses between the address spaces. On a 32-bit mach... | Kernel address space and Kernel page table |
1,355,581,038,000 |
On what basis the size of User and kernel virtual memory is decided in Linux? (32-bit, if that's relevant.) Is it configurable?
If we have 512 MB RAM What will be the size of user and kernel virtual address?
|
The available address space depends on the architecture. One limit is the amount of address space made available by the architecture itself. 64-bit architectures usually allow 64-bit pointers, and 32-bit architectures allow 32-bit pointers. The amount of addressable space can be limited by the architecture beyond thes... | Size of virtual memory in Linux |
1,355,581,038,000 |
I have an ARM Linux system running kernel version 2.4, but I'm not sure if the processor has a memory-management unit, so how can I tell whether the system is running a uClinux kernel or a vanilla Linux kernel? The system does not have uname.
|
I think 2.4 supports the uname system call. Try this
/*
* Author: NagaChaitanya Vellanki
*/
#include <sys/utsname.h>
#include <stdio.h>
#include <errno.h>
int main() {
struct utsname buf;
if(uname(&buf) != -1) {
printf("Operating System name: %s\n", buf.sysname);
printf("Node name: %s\n", buf.nodename);... | Determing if an embedded Linux system runs uClinux |
1,355,581,038,000 |
I use Linux only but I want to understand what this means:
From the Linux Programming Interface:
Blocks of memory allocated using memalign() or posix_memalign()
should be deallocated with free().
On some UNIX implementations, it is not possible to call free() on a
block of memory allocated via memalign(), because the... |
Only posix_memalign should be used since it's defined by POSIX, as its name suggests. For issues with memalign see for example the Solaris 10 manual page for memory allocation functions:
The argument to free() is a pointer to a block previously allocated by malloc(), calloc(), or realloc(). After free() is executed, ... | On some UNIX implementations, it is not possible to call free() on a block of memory allocated via memalign() |
1,355,581,038,000 |
As per Robert Love 's Linux Kernel Development , an x86 ISA device cannot perform DMA in to the full 32 bit address space because ISA devices can access only the first 16MB of physical memory(range 0MB-16 MB). Why is that so?
|
The 16-bit ISA bus only has 24 address lines, so it can only encode addresses up to 16MiB. This matches the 80286 CPU for which it was designed (as an extension to the 8-bit expansion bus used with the 8086 and its 20 address lines).
The ISA bus itself was never extended beyond 24 address lines. It was replaced by MCA... | Why x86 ISA devices cannot perform DMA in to the full 32 bit address space? |
1,355,581,038,000 |
I'm reading "Understanding the Linux Virtual Memory Manager" by Gorman.
In Chapter 4 about Process Address Space, when VMA operations are introduced, for example create, lock and unlock, the text mentions "fix up region". What does "fix up" means specifically? Does it apply in the same way to different VMA operations?... |
In this context, “fixing up” means merging or splitting the VMAs as appropriate so that they match the regions being manipulated:
if a region to be locked (or unlocked) is smaller than the VMA containing it, the VMA needs to be split;
if consecutive VMAs can be merged, they should be.
The documentation you’re readin... | what does fix mean in VMA operation in virtual memory managment |
1,355,581,038,000 |
What happens if a Linux, let’s say Arch Linux or Debian, is installed with no swap partition or swap file. Then, when running the OS while almost out of RAM, the user opens a new application. Considering that this new application needs more RAM memory than what’s needed, what will happen?
What part of the operating s... |
The Linux kernel has a component called the OOM killer (out of memory). As Patrick pointed out in the comments the OOM killer can be disabled but the default setting is to allow overcommit (and thus enable the OOM killer).
Applications ask the kernel for more memory and the kernel can refuse to give it to them (becaus... | What happens if a Linux distro is installed with no swap and when it’s almost out of RAM executes a new application? [duplicate] |
1,355,581,038,000 |
I executed this command to create a RAM-Disk:
mount -t tmpfs -o size=60G tmpfs /tmp/ramdisk
After that I copied several files into this virtual filesystem as follows:
cp /mnt/user/hugefile.bin /tmp/ramdisk/hugefile.bin
cp /mnt/user/hugefile2.bin /tmp/ramdisk/hugefile2.bin
cp /mnt/user/hugefile3.bin /tmp/ramdisk/hugef... |
I found this solution as well, but I'm afraid of killing data of other processes. Isn't there a more selective solution?
echo 3 > /proc/sys/vm/drop_caches does not and cannot kill any processes or cause any harm to your system - it just evicts everything from your caches, not shared memory. ipcs has no relationship ... | How do I delete shared memory that was used by mounted tmpfs directory? |
1,355,581,038,000 |
In 32 bit systems with more than 896 MB of RAM it is obvious, that the mapping of kernel addresses need to be changed because of kernel virtual addresses and the non-continuous mapping.
But how is this handled in 64 bit? As the RAM can always be mapped entirely in the address space, the master kernel page table needs... |
In 32 bit systems with more than 896 MB of RAM it is obvious, that the mapping of kernel addresses need to be changed because of kernel virtual addresses and the non-continuous mapping.
Yes, this is known as highmem.
But how is this handled in 64 bit? As the RAM can always be mapped entirely in the address space, t... | Does the kernel address region in user page tables need to be updated in an 64 bit system? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.