date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,572,335,195,000
I'm stuck at figuring out how to sum ls 5th column result with awk. If I add $bytesum+=... then the program obviously breaks. Any ideas? bytesum=0 for i in `cat fileextensions.txt | sort | uniq` do ls -Rl "$folder" | grep $i | awk '{bytesum+=$5}; {print $9 " " $5}' done echo $bytesum
With GNU find all you need is: find . -type f -printf '%s\n' | awk '{s+=$0} END{print s+0}' With any find: find . -type f -exec stat -c '%s\n' {} \; | awk '{s+=$0} END{print s+0}' To just find and stat files with a specific extension in a specific directory ("folder" is a Windows term, in UNIX terminology it's a directory) as it looks like you might be trying to do would be: dir='whatever' ext='pdf' find "$dir" -type f -name "*.${ext}" -printf '%s\n'
How to iteratively sum file sizes with given file extensions?
1,572,335,195,000
I set var inside loop, like this: eval "PB_$i=`cat btc_pub_$i.key`" where $i is the index of loop. I want to do echo or printf of $PB_$i ($PB_0,$PB_1, etc) I tried with echo $PB_${i} but dosen't work
It sounds like what you're looking for is a dereference: $ foo=bar $ bar=somewords $ printf "The value of %s is '%s'\n" "${foo}" "${!foo}" The value of bar is 'somewords' $ var_1=foo $ var_2=bar $ for i in 1 2; do v="var_${i}"; printf "%s\n" "${!v}"; done foo bar I might, though, suggest rather than using a series of numerically suffixed variables, look into an array: $ var=("foo" "bar") # var[0]=foo; var[1]=bar $ for v in ${var[@]}, do printf "%s\n" "${v}"; done foo bar
Echo variable with index
1,572,335,195,000
I am trying to loop through multiple remote servers with respective users and ssh and run some command. I tried, something like in shell script: #!/bin/bash Q_HOST=host1 host2 host3 #list of hosts Q_USER=user1 user2 user3 #list of users for host in Q_HOST; user in Q_USER; do ssh $user@host df -h done but I think this is not proper way to loop like this, can you guys please guide me on how to achieve
You've got the syntax for assigning to arrays slightly wrong, and your loop can't work like that in bash. In fact, the loop that you've written looks almost like what's possible to do in the zsh shell. You also have forgotten to double quote your variables. For a zsh solution: #!/usr/bin/zsh hosts=( host1 host2 host3 host4 ) # array of hosts users=( user1 user2 user3 user4 ) # array of users # loop over these and do the ssh thing for user host in ${users:^hosts}; do ssh $user@$host df -h done The parameter substitution ${users:^hosts} is special to the zsh shell and would result in a list of elements from the two arrays users and hosts, alternating between the two. For the example above, this would generate the list user1 host1 user2 host2 user3 host3 user4 host4. A for loop in zsh can set several separate variables, so we use this to pick out the username-hostname pair in each iteration and call ssh. Note that quoting of variables is not really needed in the zsh shell as the shell won't split them on whitespaces or perform filename globbing on them by default. A bash solution: #!/bin/bash hosts=( host1 host2 host3 host4 ) # array of hosts users=( user1 user2 user3 user4 ) # array of users # set the positional parameters to the hosts set -- "${hosts[@]}" # Loop over the users. # In each iteration, ssh to $1 for $user, then # shift the next host into $1 when done. for user in "${users[@]}"; do ssh "$user@$1" df -h shift done This avoids having to deal with array indices to pair up the elements of the two arrays. It does this by looping over the elements of one of the arrays while at the same time shifting off successive elements of the other, which are kept in the list of positional parameters.
ssh multiple hosts with respective users
1,573,673,756,000
I have a csv file 20 columns. in the first part of the file is the geolocation info. What I am trying to do is to find the geolocation data for a certain record. First if identifies the user "ROSA". On that line search through the first 10 columns and if any of them contains "GeoLocation" print only the next record not the whole line. awk -F"," '($0~/ROSA/) {for(i=1;i<=10;i++) {($i~/GeoLocation/) print $(i+1)}}' filename.csv I came up with the line above but I am getting flagged for syntax error right at the "p" in print. Can you guys spot what I am missing?
Try this: awk -F"," '($0~/ROSA/) {for(i=1;i<=10;i++) {if ($i~/GeoLocation/) print $(i+1)}}' filename.csv. Additionally I would avoid searching whole line for ROSA of You know field number or at least include the delimiters in regex to not match substrings. Also You do not want to print the next record (that would be the whole next line) but the next field...
awk command combining if and for
1,573,673,756,000
I'm trying to do "one line script" or really small bash script. It have to find file (for example ./xxx/one.php) and if that file exist edit (with printf or echo) other file IN SAME directory (for example ./xxx/test.php). Right now I made second part - editing existing file, but I don't have idea how to, or where to enter "if". Actually I have something like that for file in `find . -name "test*.php"` ; do (printf "It's me, on first line \n and me on second line\n" && cat $file) > "$file".bak && mv "$file".bak "$file" done It's should be something like this? if [[ `find . -name "one*.php` ]]; do for file in `find . -name "test*.php"` ; do (printf "It's me, on first line \n and me on second line\n" && cat $file) > "$file".bak && mv "$file".bak "$file" done done
The -execdir option to find is handy here: find -name 'one*.php' -execdir bash -c ' if [ -e test.php ] ; then printf ... && mv test.bak test.php fi' {} \; -execdir is Like -exec, but the specified command is run from the subdirectory containing the matched file, which is not normally the directory in which you started find. -execdir will run the given command in the directory the found file was in, so the test.php file "next to" it will be right there to manipulate. Here we launch bash in that directory and run a small script there to make the manipulations you want. There's no need to complex path manipulations or re-finding the file. Above I check that the file exists, but if it will always be there (or you want to create it unconditionally) you can take the if out. -execdir is a GNU find extension, not in POSIX, but you very likely have that given your tags. One caveat is that your PATH environment variable can't contain . or any other relative paths (including an empty element), for security reasons, so if your ambient one does you'll need to reset it first: PATH=... find ....
Find file while other file exist in same directory
1,573,673,756,000
I'm trying to replicate the setup of 50 printers from one server to another server. Command: lpadmin -p printer_name -v printer_ip -E and some more parameters. I have the printer names in one text file and the printer IPs in another text file. Printername.txt contains name of printers in separate lines Printerip.txt contains ip of same printers in separate lines I want to pass the printer name and printer ip from these two files as an argument to the command mentioned above. I know how to do it for 1 parameter i.e by using For i in cat file but I'm not able to do it with two files.
You can take one line each from each file using paste: paste Printername.txt Printerip.txt Then use awk to insert the option arguments in that: paste Printername.txt Printerip.txt | awk '{print "-p", $1, "-v", $2, "-E ..."}' And finally use xargs to use this as arguments for the command: paste Printername.txt Printerip.txt | awk '{print "-p", $1, "-v", $2, "-E ..."}' | xargs -L1 lpadmin -L1 lets xargs use one line of input for each run of the command. It will do some splitting, so -p, the printer name etc. are passed as separate arguments. This works best of the printer names don't have whitespace or other special characters in them. Alternatively, you can use sh with xargs to position the input as arguments: paste -d '\n' Printername.txt Printerip.txt | xargs -d '\n' -n2 sh -c 'lpadmin -p "$1" -v "$2" -E ...' _
How to pass arguments to a command from two files?
1,573,673,756,000
I have below code snippet working in bash: for i in `ps -eaf | grep -i <pattern> | awk '{print $3}'`; do kill -9 $i; done But I have a requirement to port this code to work in csh shell due to some legacy application is written using csh. Sample output of "ps -eaf | grep -i | awk '{print $3}'" 5284 3543 14390 4811 4814 I am on RHEL 7.2 (tcsh-6.18.01-8.el7.x86_64, bash-4.2.46-19.el7.x86_64)
foreach i (`echo 1 2 3`) echo $i end Using your example: foreach i (`ps -eaf | grep -i <pattern> | awk '{print $3}'`) kill -9 $i end
for loop logic porting from bash to csh
1,573,673,756,000
Im collecting the LPAR names and assigning to a variable on AIX , Then using multiple commands for processing. LPAR Names on the system are : ABCD56777 TSM Mobile CD CPT 2 for lparname in `lssyscfg -r lpar -m $system -F name,lpar_env |cut -f 1 -d, | sort`; But the above for loop variable doesn't pick up the complete LPAR value after the space. (Exact LPAR name is: ABCD56777 TSM Mobile CD CPT 2 ) It assigns the value of LPAR as ABCD56777 alone. Could you advise me on how to assign variable with spaces. Unfortunately awk is not installed and only sed will work.
The issue is that your command substitution expands to a whitespace-delimited string and the loop will iterate over all words in that string. A "word" is anything delimited by a space, tab or newline character. Also note that in Bourne-like shells other than zsh, those words are further subject to filename generation (aka globbing), so wildcard characters (and { in some shells) would also be a problem in addition to space and tab. lssyscfg -r lpar -m "$system" -F name,lpar_env | cut -d, -f 1 | sort | while IFS= read -r lpar; do echo "$lpar" done This uses a while loop instead of a static for loop. The while loop body is executed in a subshell (in bash), so the lpar variable will not exist after the end of the loop body. That's not an issue if you only use the variable in the loop body though. Related: Understanding "IFS= read -r line" Another solution would be to set IFS to a newline before the loop (and reset it afterwards): oldIFS=$IFS IFS=$'\n' # assumes bash set -o noglob for lpar in $( lssyscfg -r lpar -m "$system" -F name,lpar_env | cut -d, -f 1 | sort ) do echo "$lpar" done set +o noglob IFS=$oldIFS The default value of $IFS includes spaces, which is why your original loop iterates over the wrong things. I have also turned off filename globbing for the loop, as we otherwise might get unexpected results if the text returned from lssyscfg includes filename globbing patterns as discussed above. This last variation is IMHO quite inelegant, and downright inappropriate for commands that produce more than a handful of lines of output.
for loop variable assignment with whitespaces
1,573,673,756,000
I have a file to process and get some entries from it. The file format is: Example Input: String1:"Hello" String2:"World" String3:"Question" End String1:"HelloAgain" String5:"Answer" End String1:"NewEntry" String2:"Foo" String5:"NewFile" End Script will iterate and try to find String1 and print it, if String2 also present in that block append it to String1 and print. Example Output: Hello World HelloAgain NewEntry Foo I need to loop through every such block.What I mean by a block here is content between every "End" string. I have a script like: cat $1 | while read line do if [[ $line == "String1="* ]]; then string1=$line fi if [[ $line == "String2="* ]]; then string2=$line fi if [[ $line == "End" ]]; then if [ $string1 ]; then echo "string1/"$string1" fi if [ $string1 ] && [ $string2 ]; then echo $string1" "$string2 fi #Reset values string1='' string2='' fi done This code works fine but the processing in between these blocks can become more complex, whats the best way to iterate such blocks and process those block entries. NOTE:The file is kind of a property file.
Given your provided input and requested output: $ awk -F: '$0 == "End" { printf "\n" } $1 ~ /^String[12]$/ { gsub( /\"/, "", $2 ); printf( "%s ", $2)}' input Hello World HelloAgain NewEntry Foo
Iterate over some pattern using shell
1,573,673,756,000
I have several files to copy from various directories but each file has the same name so I need to copy them to a single directory and rename each in turn as "expect1, expect2, expect3", etc. The code I've tried so far is let i=1; for file in delay* ; do ( cd $file cp expectation_file ~/target_dir cd ~/target_dir/ mv expectation_file expect{i} ((i++)) ); done But this just makes every file called "expect1". Can someone help out? I think it's the counting loop that's wrong but can't figure it out. Thanks! EDIT: Made a mistake in code there. Had 1=1 instead of i=1 and then ++i not i++.
This may be more versatile. #!/bin/bash i=0 source_files=$(find /tmp -name "*.zip") target_dir=~/temp1/ for source in ${source_files}; do ((i++)) mv ${source} ${target_dir}/$(basename ${source})${i} done source_files expression can be anything like $(ls *.zip), this example finds all zip files under /tmp/.
Copy multiple files from different directories while renaming?
1,573,673,756,000
I am trying to write a script that will connect to Oracle from a jump server (i.e) I will execute my script from a jump server, In my script I will have a config file as below #USERNAME PASSWORD TNSNAMES SUCCESS/FAIL ODB ODB123 ODB1 CDC CDC123 CDC1 So , Now i will pass the config file in a loop and will execute ${ORACLE_HOME}/bin/sqlplus -S ${USER}/${PASSWORD}@${TNSNAMES} So by executing the above query for the first time in a loop. It should try logging into the server using the above username and password and it should write into the config file like PASS if the connection succeeded and FAIL if connection failed. #USERNAME PASSWORD TNSNAMES SUCCESS/FAIL ODB ODB123 ODB1 PASS CDC CDC123 CDC1 FAIL And again it should read the updated config file and if it is PASS it should get into the database and do respective sqls we call. And it should ignore the database if FAIL. I have tried the below script which will write the contents to other file. #!/bin/sh . ~/.ODBenv cat test.txt | grep '^#' > test1.txt cat test.txt | grep -v '^#' | awk 'NF'|while read i;do #if [ -z "$i" ] #then #break; #fi user_name=`echo $i|awk {'print $1'}` password=`echo $i|awk {'print $2'}` TNS_NAME=`echo $i|awk {'print $3'}` echo "exit" | ${ORACLE_HOME}/bin/sqlplus -S ${user_name}/${password}@${TNS_NAME} |grep -E 'ORA|SP2' > /dev/null if [ $? -ne 0 ] then echo -e "${user_name}\t ${password}\t ${TNS_NAME}\t PASS">>test1.txt else echo -e "${user_name}\t ${password}\t ${TNS_NAME}\t FAIL">>test1.txt fi done #done < test.txt|grep -v "^#" | awk "NF" I tried writing the same contents into a new file and the above script worked. Any idea how to write in the Original file like PASS/FAIL. Original file is as mentioned below. #USERNAME PASSWORD TNSNAMES SUCCESS/FAIL ODB ODB123 ODB1 CDC CDC123 CDC1
So it's just about the editing in place. I prefer sed -i for this: tail -n+2 test.txt|while read -r line ; do user_name=`echo "$line"|cut -d\ -f 1` password=`echo $line|cut -d\ -f 2` TNS_NAME=`echo $line|cut -d\ -f 3` echo "exit" | ${ORACLE_HOME}/bin/sqlplus -S ${user_name}/${password}@${TNS_NAME} |grep -E 'ORA|SP2' > /dev/null if [ $? -ne 0 ]; then result=PASS else result=FAIL fi sed -i -E "/$line/s/\t*FAIL|\t*PASS|$/$result/" test.txt done So, for the given $line I remove any trailing PASS or FAIL with it's tab and replace it by the $result. Hope it works for you.
How to execute a script based on a file
1,573,673,756,000
Suppose I want to unzip files recursively that have the pattern ${file}*.zip in some directory /home/A/XML using find command find /home/A/XML -type f -name "${file}*.zip" -exec unzip '{}' -d /target/path \; For now, I wish to parse a list of directories instead of just /home/A/XML for dir in "${path}"; do find "${dir}" -name "${file}*\.zip" -type f -exec unzip '{}' -d "${dir}"/"${file}" \; done I tries using a for loop to parse the directories but the unzip stop right after the 1st directories, meaning it done the same thing as the previous code, it only unzipped in the directory /home/A/XML. caution: not extracting; -d ignored I got the error above for the remaining directories. Can anyone please guide me on this? Thanks in advance.
If that list of directories is stored newline-delimited (one on each line) in a scalar variable $path (not a good name for a variable as it's special in several shells, though not bash), you'd do: IFS=$'\n' # split on newline set -o noglob # disable glob for dir in $path # invoke the split+glob operator ($path unquoted) do find "$dir" -name "$file*.zip" -type f -exec unzip -d "$dir/$file" {} \; done If $path was a bash array instead as in path=(dir1 dir2...), change the loop to for dir in "${path[@]}" If using GNU find, you may want to add a -quit predicate at the end or your find command to allow only one successful unzip per directory unless you want all the zip files to be merged into the same directory. Note that options should be placed before non-option arguments.
Can list of directories be parsed into a find command?
1,573,673,756,000
I'd like to repeatedly iterate over, alternate between, and/or cycle through multiple commands; in a kind of pattern or loop. The desired end result could be thought of as not totally unlike watch. I've been experimenting with variations of this basic formula; but something is missing, wrong, or otherwise: for x in {1..60}; do <first command> && sleep 1 && <second command>; done I think it's just reiterating (doing) the <first command> && sixty times, then all subsequent operations just one time, like normal. I've tried a few different things; like using {braces}, 'quotes', "quotes", and so on; in an attempt to group commands together, without success.
It's alright, I think I figured it out. I think I just need to add another && sleep 1 between the <second command> and ; done. Something like: for x in {1..60}; do <first command> && sleep 1 && <second command> && sleep 1; done
How to repeatedly alternate between two (or more) commands?
1,573,673,756,000
I've following array and variable : httpurl="http://www.nnin.com" firstquery=$(curl -s -X POST -d "UID=user1&PWD=1111" $httpurl) name="firstcust" ip="105.105.0.1" httpurl="http://www.mmim.com" secondquery=$(curl -s -X POST -d "UID=user2&PWD=2222" $httpurl) name="secondcust" ip="106.106.0.1" httpurl="http://www.ooio.com" thirdquery=$(curl -s -X POST -d "UID=user3&PWD=3333" $httpurl) name="thirdcust" ip="107.107.0.1" below is the code I use :- httpurl="http://www.nnin.com" firstquery=$(curl -s -X POST -d "UID=user1&PWD=1111" $httpurl) name="firstcust" ip="105.105.0.1" status=$? if [ $? -eq 0 ]; then echo "$name : $ip (success)" exit $status else echo "$name : $ip (failed)" exit $status fi how do I grouped the query&variable? (the variable $status stored the error code for curl command). How do i make the code read each of the following query&variable and print the output (someone suggest I use for) and move to next query&variable. the purpose of this script to check the return code from the following url and print the output Success for 0 and failed for non-zero.
Use some thing like: httpurl[0]="http://www.nnin.com" query[0]="curl -s -X POST -d 'UID=user1&PWD=1111'" name[0]="firstcust" ip[0]="105.105.0.1" httpurl[1]="http://www.mmim.com" query[1]="curl -s -X POST -d 'UID=user2&PWD=2222'" name[1]="secondcust" ip[1]="106.106.0.1" httpurl[1]="http://www.ooio.com" query[1]="curl -s -X POST -d 'UID=user3&PWD=3333'" name[1]="thirdcust" ip[1]="107.107.0.1" for i in 0 1 2 do ${query[$i]) ${httpurl[$i]} status=$? if [ $? -eq 0 ]; then echo "${name[$i]} : ${ip[$i]} (success)" #exit $status else echo "${name[$i]} : ${ip[$i]} (failed)" #exit $status fi done Reference: Bash Reference Manual - Arrays
How to grouped the following variable and command and read 1 by 1
1,573,673,756,000
I want to parse data of particular columns from several files(aprilPlate.txt, mayPlate.txt, junePlate.txt, julyPlate.txt, augustPlate.txt) using For loop. The data of input files (aprilPlate.txt, mayPlate.txt, junePlate.txt, julyPlate.txt, augustPlate.txt) look like: Incl Cal Ps Name Q Con Std Status True 255 A1 Sample 1 35.86 0 True 255 A2 Sample 2 36.06 0 True 255 A3 Sample 3 17.45 0 True 255 A4 Sample 4 17.56 0 True 255 A5 Sample 5 17.55 0 True 255 A6 Sample 6 40.00 0 True 255 A7 Sample 7 36.38 0 True 255 A8 Sample 8 27.98 0 True 255 A9 Sample 9 27.95 0 True 255 A10 Sample 10 28.19 0 True 255 A11 Sample 11 36.93 0 True 255 A12 Sample 12 37.74 0 True 255 A13 Sample 13 17.88 0 True 255 A14 Sample 14 17.82 0 True 255 A15 Sample 15 17.90 0 . . . By using FOR loop, I able to get the task done. However, in order to get desire data from all files, I have to modify the file name in the script (below) manually. #!/bin/bash # parse the data of desire columns from target file # rename the column name # redirect the stdoutput to a text file for z in A B; do for i in 3 4 5 13 14 15; do grep $z$i aprilPlate.txt | awk -F "\t" '{print $3 "\t" $5}' | sed -e 's/A[3-5]/st_SWC/g;s/A[1][0-9]/st_SWD/g;s/B[3-5]/st_TZC/g;s/B[1][0-9]/st_TZD/g;' >> stone.txt; done; done for z in E F; do for i in 8 9 10 18 19 20; do grep $z$i aprilPlate.txt | awk -F "\t" '{print $3 "\t" $5}' | sed -e 's/E[8-9]\|E[1][0]/su_SWC/g;s/E[1][0-9]\|E[2][0]/su_SWD/g;s/F[8-9]\|F[1][0]/su_TZC/g;s/F[1][0-9]\|F[2][0]/su_TZD/g;' >> suy.txt; done; done paste -d'\t' stone.txt suy.txt >> aprilPlate.data.txt My apologies, I made a mistake in my previous coding. The correction was done. The output of parsed data file should looks like: st_SWC 17.45 su_SWC 28.85 st_SWC 17.56 su_SWC 28.79 st_SWC 17.55 su_SWC 28.82 st_SWD 17.88 su_SWD 29.24 st_SWD 17.82 su_SWD 29.18 st_SWD 17.90 su_SWD 29.23 st_TZC 18.06 su_TZC 25.99 st_TZC 18.09 su_TZC 25.98 st_TZC 18.13 su_TZC 26.02 st_TZD 17.75 su_TZD 25.00 st_TZD 17.70 su_TZD 25.01 st_TZD 17.69 su_TZD 24.98 I would like to ask, is there anyway I can have the files as 3rd variable in the script? Other solutions are welcome.
Something like will help you for file in aprilPlate.txt mayPlate.txt junePlate.txt julyPlate.txt augustPlate.txt; do for z in A B; do for i in 3 4 5 13 14 15; do grep $z$i $file | awk -F "\t" '{print $3 "\t" $5}' | sed -e 's/A[3-5]/SWC/g;s/A[1][0-9]/SWD/g;s/B[3-5]/TZC/g;s/B[1][0-9]/TZD/g;' >> stone.txt; done; done <snip> done
How to use 3rd variable in BASH for loop?
1,573,673,756,000
I've a script with this code for i in {2..9} do grep "Node${i}\|01, source address = 00:00:00:00:00:0${i}" t1.txt > t2.txt done Is it possible to expand the loop from "9" to the "f" character of the exadecimal MAC address, in order to handle the "a" to "f" cases too?
Just add another brace expansion for the letters: for i in {2..9} {a..f} do grep "Node${i}\|01, source address = 00:00:00:00:00:0${i}" t1.txt > t2.txt done Note that this is likely not what you really want. Each time this code runs, it will overwrite the contents of t2.txt which means you will only ever see the results for the final iteration. If that didn't match, you'll have an empty file even if something else did match. Maybe you want to append instead: for i in {2..9} {a..f} do grep "Node${i}\|01, source address = 00:00:00:00:00:0${i}" t1.txt >> t2.txt done Or, more likely, you don't need a loop at all and should instead do this: grep -E 'Node[2-9a-f]|01, source address = 00:00:00:00:00:0[2-9a-f]' t1.txt > t2.txt
Loop through MAC addresses, how to handle both numbers (0-9) and letters (a-f) in a "for" loop
1,573,673,756,000
Imagine I have two folders in my current working directory: back/ and front/. I am trying to enter inside each of them and do some stuff. From the simple script below: for dir in */ ; do echo "$(dir)" done I was expecting an output like: back front However, what I am getting is: back front back front I don't understand. The consequence is that, if I try to cd into the folder: for dir in */ ; do echo "$(dir)" cd $(dir) echo "$(pwd)" cd .. done I get: back front /path/to/back back front /path/to/back I.e. I never enter front/. Could someone please help me understand what I am doing wrong?
In POSIX-like shells, $(cmd) is the syntax for command substitution, $(cmd) is expanded to the output of cmd minus the trailing newline characters. What you want instead is parameter expansion: $dir or ${dir} (here with the parameter being the dir variable). pwd (print working directory) is the command that outputs the contents of the $PWD¹ special variable which itself contains a path to the current working directory, so $(pwd) expands to the same thing as $PWD as long as $PWD doesn't end in newline characters. So you want: for dir in */; do ( printf '%s\n' "$dir" cd -- "$dir" && printf '%s\n' "$PWD" ) done Or: for dir in */; do ( printf '%s\n' "$dir" cd -- "$dir" && pwd ) done Also remember that echo can't be used to output arbitrary data, use printf instead you should generally check the exit status of commands. Here not checking the output of cd would mean that the following cd .. would land you in the wrong place if the first cd failed. better to run cd in a subshell (using (...)) rather than using cd .. as the latter is not always guaranteed to get you back to the initial place (if there are symlinks involved and/or some path components have been renamed in the interval) -- must be used to separate options from non-options when the non-options can't be guaranteed not to start with - (or + which can be a problem as well for some commands). in POSIX-like shells, parameter expansions and command substitutions (and arithmetic expansions) must be quoted as otherwise they undergo implicit split+glob (except in zsh) which you generally don't want. Also beware that in bash (and other POSIX shells except zsh), when a glob doesn't match any file, it is left unexpanded. So if the current working directory doesn't contain any non-hidden file that can be determined to be of type directory, the */ glob pattern will just expand to itself */ instead of an empty list and you'll likely see an error by cd that it can't enter that */ directory. In zsh, you'd use the N glob qualifier as in for dir in */(N); do... (or for dir in *(N-/); do... to avoid $dir ending in /). In ksh93: for dir in ~(N)*/; do.... In bash, you can set the nullglob option on globally temporarily: shopt -s nullglob for dir in */; do ... done shopt -u nullglob For completeness, $(var) is the syntax for macro expansions in Makefiles as used by the make command. In the awk language, $ is a unary operator to dereference fields, and you just use var to refer to an awk variable. So there, $(var) would be the same as $var or $ var and expand to the varth field (or the whole record if var is 0). In rc-like shells, $(var) same as $var, $ var, $ 'var', $ ( 'var' ) would also work, as that's a list of one element passed to $, so you're dereferencing the var variable, though you would normally use just $var. In TCL, $(var) would expand to the value of the array variable with empty name for the var key: $ tclsh % array set {} {foo 1 bar 2} % puts $(foo) 1 ¹ Yes, P for Print doesn't make much sense if this context. As you can guess the pwd command (from Unix V5 in the mid-70s) was first, and $PWD and the logical handling of the current working directory both of which have been specified by POSIX came later (in ksh in the early 80s, where pwd was actually an alias for print - $PWD (yes with the missing -r and quotes!) and $PWD was bracronymed Present Working Directory in the documentation). tcsh has a $cwd (current working directory) variable for the same purpose
Output of loop variable shows different value than expected
1,573,673,756,000
This command gives an error "sh: -c: line 1: syntax error: unexpected end of file" for file in /dev/DataStage/myProject/source/TEST/MyFile_*.csv; do echo "Testing" done What is wrong with the above command ? Thank you
You have to add ; before done, or put new line here. for file in /dev/DataStage/myProject/source/TEST/MyFile_*.csv; do echo "Testing" ; done
sh: -c: line 1: syntax error: unexpected end of file
1,573,673,756,000
This is the code and I need to display in the terminal like this way: (1,1) (1,2) (1,3) (1,4) (1,5) (2,1) (2,2) (2,3) (2,4) (2,5) (3,1) (3,2) (3,3) (3,4) (3,5) (4,1) (4,2) (4,3) (4,4) (4,5) but my output it's like this: 1,1) 1,1) 1,1) 1,1) 1,1) 2,1) 2,1) 2,1) 2,1) 2,1) 3,1) 3,1) 3,1) 3,1) 3,1) 4,1) 4,1) 4,1) 4,1) 4,1) I don't know where I had make the mistake. I am sorry if the mistake is obvious. for (( i = 1; i < 5; i++ )) do for (( j=1; j<=5; j++)) do echo -n "$i,1) " done echo " " done
The $j variable was unused: for (( i=1; i<5; i++ )); do for (( j=1; j<=5; j++)); do echo -n "($i,$j) " done echo done
Script with nested for loops [closed]
1,573,673,756,000
I was editing a shell script and I want to know how can use for to use all directories listed by a list or variables and then execute a command. Example: I have this directories: /dirname1/app1 /dirname1/app2 /dirname2/app1 /dirname2/app2 The thing is each directory have 8 application directory, and I need to get the value of each one using du for usage of each one. I have this example piece of code that I made, but I want to convert it more better than the actually have. #!/bin/ksh #files="/dev /etc" inc=1 for f in /*; do vari=`du -ksh $f` [ -d $f ] echo "The value of each one is: ------ : $((inc++)): $vari" done; echo "Execution Done." exit 0 I hope to be cleared with this,
My advice is keep things simple. Don't write a whole script when there is a ready-made tool that already does what you want. du is the tool for reporting on disk usage, and find is the tool for finding files. Use them together. find dirname* -mindepth 1 -maxdepth 1 -type d -exec du -hs {} \; -maxdepth and -mindepth are GNU extensions; to handle this portably you need a slightly trickier command as described here: Limit POSIX find to specific depth? The command in this case would be either find dirname* -path '*/*' -prune -type d -exec du -hs {} \; or, if all of your dirname* directories are within, say, topdirectory and there are no other directories in there, use: find topdirectory -path '*/*/*' -prune -type d -exec du -hs {} \; This will only report on the directories within the directories within topdirectory, which seems to be what you're asking for. Update: I took another look at this and actually, you can do what you need entirely with shell globbing: du -hs dirname*/app*/ Your directory are probably not actually named like this, but you could even run du -hs */* and it would work—it just might include some other directories (or files) you didn't want to list, depending on how clean (uncluttered) you keep those directories.
for loop to evaluate multiple directories and execute command
1,573,673,756,000
What is wrong here? I am getting error near `done'. echo " Writing a program to print even numbers by adding 1 if the number is odd." for i in {1..10} do d=$(($i % 2)) if [[$d = 1]] then $iq=$(($i+1)) echo "$iq" done echo "end"
This should work: #!/bin/bash - echo " Writing a program to print even numbers by adding 1 if the number is odd." for i in {1..10} do d=$(($i % 2)) if [[ $d -eq 1 ]] then iq=$(($i+1)) echo "$iq" fi done echo "end" Inserted a fi, removed the $ from $iq=... and added spaces inside the [[ ... ]].
BASH syntax error near unexpected token 'done'
1,573,673,756,000
When I run ping example.com, it prints the result of each exchange in the console. I'd like to filter each result so that, instead of showing all the information, it shows only a subset of it. So, instead of: PING example.com (93.184.216.34) 56(84) bytes of data. 64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=2 ttl=55 time=1201 ms 64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=3 ttl=55 time=783 ms 64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=4 ttl=55 time=417 ms 64 bytes from 93.184.216.34 (93.184.216.34): icmp_seq=5 ttl=55 time=159 ms 64 bytes from 93.184.216.34: icmp_seq=6 ttl=55 time=886 ms I want the result printed in the terminal to be: 1201ms 783ms 417ms 159ms 886ms I'll accept ping specific answers, but I'd prefer a general answer that can accept any dynamic process and process each string it returns to some other string, because that would be more general. I'm especially interested in a shell solution to this, the same way xargs is a shell solution to the limitations of some programs to accept pipe redirection.
My suggestion uses sed. I don't understand what you mean about your dynamic strings, other than you want to transform something to something else. Most filters will do that. ping -c 3 1.1.1.1 | sed -En 's/.*=([0-9.]+) ([a-z]+)$/\1\2/p' 32.5ms 34.5ms 37.5ms
return substring of a dynamic ping
1,573,673,756,000
I am dealing with simple for loop, which loop the filles and execute on it some commands. I need to set up the filter with IF statement to consider only file started with the keyword "AllBoxes": for pdb in "${storage}"/"${experiment}"/*.pdb ; do pdb_name=$(basename "$pdb" .pdb) # if file starts with pharase AllBoxes do something on the file if [[ ${pdb_name} =='AllBoxes*' ]] ; then echo Vizualisation of ${pdb_name} is being processed! fi done This gives me an error in the IF statement. Also would it be enought to skipp all of the rest filles (that does not start with "AllBoxes" keyworld? Need I introduce something like Else or Elif Break to exit the loop ?
The error is probably because you need a space after the == however you won't be able to use wildcards like that in an expanded test. You could use =~ to do regex matching (something like AllBoxes.*) however if you quote it, it will be treated literally. If you only care about AllBoxes files however you could just modify your loop to: for pdb in "${storage}/${experiment}"/AllBoxes*.pdb ; do
bash: IF condition with keyworld within FOR loop
1,573,673,756,000
I've written a small script made to backup downloads from TOR because occasionally TOR will try to merge its place holder file (a zero byte file with original file name) and its actual download file (original file plus a .part extension) early which will result in a loss of all data. As an addition in this script I wanted to have the script delete the backed up .part file once the download was complete. The problem is that often times the downloaded file names contain spaces or special characters forcing me to use double quotes which works great until I have more than one file downloading, at which point find expands all the files on one line and I get no match on my test statement. Maybe my approach to this is all wrong but if not, how can I get seperated file names for the rm command? #!/system/bin/sh if [ ! -d /sdcard/Download/tordownloadbackup ]; then mkdir /sdcard/Download/tordownloadbackup fi echo 'backing-up' find /sdcard/Download/ -maxdepth 1 -name '*.part' -print -exec cp {} /sdcard/Download/tordownloadbackup/ \; for f in "`find /sdcard/Download/tordownloadbackup/ -type f |rev |cut -c 6-100| cut -d / -f 1 |rev`"; do if [ -s /sdcard/Download/"$f" ]; then if [ -f /sdcard/Download/tordownloadbackup/"$f".part ]; then rm /sdcard/Download/tordownloadbackup/"$f".part d="$f".part echo "deleting $d" fi fi done sleep 300 ~/run.sh
If you are certain there are no newlines in the file names then you can just do this: find /sdcard/Download/tordownloadbackup/ -type f -printf '%f\n' | awk '{ print substr($0,1,length($0)-5); }' | while IFS= read -r filename; do : ... done The general approach with whatever characters in the path is: find . -exec bash -c 'ls -l "$@"' bash {} +
How do I get the required input for this 'for' loop?
1,573,673,756,000
This works #!/bin/bash dir="/home/masi/Documents/CSV/Case/" targetDir="/tmp/" id=118 channel=1 filenameTarget=$targetDir"P"$id"C"$channel".csv" cat $dir"P"$id"C"$channel"T"*".csv" > $filenameTarget Successful output when debugging with bash -x ... + dir=/home/masi/Documents/CSV/Case/ + targetDir=/tmp/ + id=118 + channel=1 + filenameTarget=/tmp/P118C1.csv + cat /home/masi/Documents/CSV/Case/P118C1T1000-1010.csv /home/masi/Documents/CSV/Case/P118C1T1010-1020.csv The same expression in the for-for loops does not work #!/bin/bash dir="/home/masi/Documents/CSV/Case/" targetDir="/tmp/" ids=(118 119) channels=(1 2) # http://unix.stackexchange.com/a/319682/16920 for id in ids; do for channel in channels; do # example filename P209C1T720-T730.csv lastFile=$dir'P'$id'C'$channel'T1790-T1800.csv' # show error if no last file exists if [[ -f $lastFile ]]; then echo "Last file "$lastFile" is missing" exit 1 fi filenameTarget=$targetDir"P"$id"C"$channel".csv" cat $dir"P"$id"C"$channel"T"*".csv" > $filenameTarget done; done Output with the debugger bash -x ... + dir=/home/masi/Documents/CSV/Case/ + targetDir=/tmp/ + ids=(118 119) + channels=(1 2) + for id in ids + for channel in channels + lastFile=/home/masi/Documents/CSV/Case/PidsCchannelsT1790-T1800.csv + [[ -f /home/masi/Documents/CSV/Case/PidsCchannelsT1790-T1800.csv ]] + filenameTarget=/tmp/PidsCchannels.csv + cat '/home/masi/Documents/CSV/Case/PidsCchannelsT*.csv' cat: /home/masi/Documents/CSV/Case/PidsCchannelsT*.csv: No such file or directory Code 2 The if clause is always positive also for non-existing files, which is wrong #!/bin/bash dir="/home/masi/Documents/CSV/Case/" startTimes=( $(seq 300 10 1800) ) id=119 channel=1 # example filename P209C1T720-730.csv firstFile="${dir}P${id}C${channel}T300-T310.csv" # show error if no first file exists if [[ ! -f "${firstFile}" ]]; then echo "First file "${firstFile}" is missing" exit 1 fi cat ${firstFile} Output cat: /home/masi/Documents/CSV/Case/P119C1T300-310.csv: No such file or directory + for channel in '"${channels[@]}"' + for startTime in '"${startTimes[@]}"' + endTime=310 + filenameTarget=/tmp/P119C2.csv + cat /home/masi/Documents/CSV/Case/P119C2T300-310.csv OS: Debian 8.5 Linux kernel: 4.6
[[ -f $lastFile ]] is truthy if the file exists. It then follows that since you reached cat $dir"P"$id"C"$channel"T"*".csv" that path really does not exist. You probably wanted if ! [[ -f $lastFile ]]. Also, Use More Quotes™ properly - you should be quoting the variables. Quoting static strings is a nice safeguard but isn't really necessary. The generally recommended to write the "last" line would be cat "${dir}P${id}C${channel}T"*'.csv' > "$filenameTarget".
Why this expression does not expand in Bash for-for structure?
1,573,673,756,000
I am trying to do a simple script which runs a few commands N number of times, determined by the user's input. However, when it comes to run the commands (in a for loop) - The variable is ignored: read -p "Please enter the number of times you wish to fail over: " num ... for run in {1..$num} do echo "STOP: " date systemctl stop $broker date sleep $st echo "START: " date systemctl start $broker date sleep $st done fi + '[' y == n ']' + '[' y == N ']' + for run in '{1..$num}' + echo 'STOP: ' STOP: + date Tue Dec 4 16:14:11 GMT 2018 Can anyone explain why this is happening and what I need to do to rectify? Or does anyone have a better method for this?
Just a collection of - more or less secure - and possibly well known approaches: a=5 eval "for i in {1..$a}; do echo \$i; done" cat <<< "for i in {1..$a}; do echo \$i; done" | bash echo "for i in {1..$a}; do echo \$i; done" | bash for i in $(seq 1 $a); do echo $i; done
Why does this for loop ignore my variable? [duplicate]
1,573,673,756,000
I would like to order the 5th column by highest value and select the 4th if it matches the 5th column. cat TABLE_LIST C1 C2 C3 C4 C5 C6 3 No ENCRYPTION /opt/oracle/oradata/ORCLCDB/encryption.dbf 8 0 2 No RETENTION /opt/oracle/oradata/ORCLCDB/retention.dbf 5 0 4 No ORACLE /opt/oracle/oradata/ORCLCDB/oracle.dbf 2 0 1 No USERS /opt/oracle/oradata/ORCLCDB/users01.dbf 3 0` It should look like this. for file in $C5; do select $C4 from from dual; done select /opt/oracle/oradata/ORCLCDB/users01.dbf from dual; select /opt/oracle/oradata/ORCLCDB/retention.dbf from dual; select /opt/oracle/oradata/ORCLCDB/oracle.dbf from dual; select /opt/oracle/oradata/ORCLCDB/encryption.dbf from dual;` What I have tried so far is working but it read the output according to the value of C1, but I want to read according to C5, highest to lowest. for (( x=1; x <= ${FILE_COUNT}; x++)) ; do FILE_NAME=cat $TABLE_LIST|sort -rk5 |awk -vx="$x" '$1 == x {print $4} $3 == x {print $1}' FILE_SIZE=cat $TABLE_LIST|sort -rk5 |awk -vx="$x" '$1 == x {print $5} $3 == x {print $1}' done Thanks!
According to comments you want to list the 4th column in the order dictated by the 5th column (in reverse numerical order). $ sed '1d' <TABLE_LIST | sort -k5,5nr | awk '{ print $4 }' /opt/oracle/oradata/ORCLCDB/encryption.dbf /opt/oracle/oradata/ORCLCDB/retention.dbf /opt/oracle/oradata/ORCLCDB/users01.dbf /opt/oracle/oradata/ORCLCDB/oracle.dbf The sed command strips the header from the file and the sort sorts the remaining lines on the 5th column in decreasing numerical order. The final awk extracts the 4th column. This would work as long as none of the columns contained a whitespace character within the column itself. Would you want to insert those select and from dual; strings, then you could modify the awk part of the pipeline: $ sed '1d' <TABLE_LIST | sort -k5,5nr | awk '{ printf("select %s from dual;\n", $4) }' select /opt/oracle/oradata/ORCLCDB/encryption.dbf from dual; select /opt/oracle/oradata/ORCLCDB/retention.dbf from dual; select /opt/oracle/oradata/ORCLCDB/users01.dbf from dual; select /opt/oracle/oradata/ORCLCDB/oracle.dbf from dual;
bash script looping two functions
1,573,673,756,000
I have multiple image files in a folder and have created a folder for each file. Now I want to cp one file in each folder. I used for i in `seq 1 9`; do mkdir $i; done and then to copy all the files into the folders. I tried to use for s in Whats* && i in `seq 1 9`;do cp $s $i;done for s in *; do for i in `seq 1 9`;do mkdir $i;done;cp $s $i;done Which obviously did not work. (the names of all the files start with WhatsApp) How can I copy one file at a time in each folder?
Assuming you want directories with integer names, and that you want to have one directory per file that matches the ./WhatsApp* pattern: shopt -s nullglob counter=0 for name in ./WhatsApp*; do counter=$(( counter + 1 )) mkdir "$counter" && cp "$name" "$counter" done This tries to create a directory for each matching name, and if that succeeds, it copies the file to that new directory. The mkdir call would fail if that directory already exists, or if you don't have write and execute permissions in the current directory. I set the nullglob shell option before the loop to avoid running a single iteration of the loop if there are no names matching the given pattern. Without setting nullglob, the loop would run once with $name set to the literal string ./WhatsApp*.
How to specify 2 variables in a for loop in bash shell?
1,573,673,756,000
I have to execute following loop: root1=path/to/root1 root2=path/to/root2 for i in {1..2}; do ${root${i}}; done It doesn't give desired output: path/to/root1 path/to/root2 Admin suggested thread brought solutions that doesn't lead to result i seek, e.g. for i in {1..2}; do \$root$i; done Output: $root1 $root2
Assuming you are using the bash shell, it looks as if you want to use an array: root[1]=path/to/root1 root[2]=path/to/root2 for i in {1..2}; do printf '%s\n' "${root[i]}" done or, write the assignment to root as a single array assignment (note that the first index is 0 in a bash array unless explicit indices are used), root=( path/to/root1 path/to/root2 ) for i in {0..1}; do printf '%s\n' "${root[i]}" done and/or, loop over the values of the array (not its indices), root=( path/to/root1 path/to/root2 ) for i in "${root[@]}"; do printf '%s\n' "$i" done (to just output the array, the loop is not needed, printf '%s\n' "${root[@]}" will be enough to print the values of the array on separate lines) In general, you may not know what indices are used by the array (an array may have discontinuous indices), so to loop over the available indices, you would loop over "${!root[@]}": root=( path/to/root1 path/to/root2 ) for i in "${!root[@]}"; do printf '%s\n' "${root[$i]}" done
What is correct syntax to for loop variable in PATH?
1,573,673,756,000
I am currently using 2 scripts. 1 script to filter the files by year. 2nd script into which sits inside the year subfolders to filter by month # (01-12). Is there something that would be better than what I have below? All of the files are in 1 directory: SOURCE: ./tape_backup/sync1/* (1.4 million files) TARGET: ./tape_backup/<1990 - 2019>/<01-12>/ (Organized by year/month) The syntax of the filename: A1000_T195_R256393_D120498094600 _D = Unimporant D = Date start 1-2 = month 3-4 = Day (unimportant) 5-6 = Year 7-* = Timestamp (unimportant) Hence why I do the whole D????98 Something that would read like this: for f in ./sync1 do (check the month and year, then mv it into the month and years folder /) done I'm on Cygwin and the server 2012 r2 #C:/cygwin/bin/bash for filename in ./* ; do if [[ $filename == *D??90 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1990/ elif [[ $filename == *D??91 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1991/ elif [[ $filename == *D??92 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1992/ elif [[ $filename == *D??93 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1993/ elif [[ $filename == *D??94 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1994/ elif [[ $filename == *D??95 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1995/ elif [[ $filename == *D??96 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1996/ elif [[ $filename == *D??97 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1997/ elif [[ $filename == *D??98 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1998/ elif [[ $filename == *D??99 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/1999/ elif [[ $filename == *D??00 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2000/ elif [[ $filename == *D??01 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2001/ elif [[ $filename == *D??02 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2002/ elif [[ $filename == *D??03 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2003/ elif [[ $filename == *D??04 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2004/ elif [[ $filename == *D??05 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2005/ elif [[ $filename == *D??06 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2006/ elif [[ $filename == *D??07 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2007/ elif [[ $filename == *D??08 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2008/ elif [[ $filename == *D??09 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2009/ elif [[ $filename == *D??10 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2010/ elif [[ $filename == *D??11 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2011/ elif [[ $filename == *D??12 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2012/ elif [[ $filename == *D??13 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2013/ elif [[ $filename == *D??14 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2014/ elif [[ $filename == *D??15 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2015/ elif [[ $filename == *D??16 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2016/ elif [[ $filename == *D??17 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2017/ elif [[ $filename == *D??18 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2018/ elif [[ $filename == *D??19 ]] ; then mv $filename /cygdrive/d/RAID5/RAID200/invoices/1/2019/ fi done
If you're going to be calling mv 1.4 million times, it's going to be slow - no way around that. But you already know the pattern of the filenames, so why not batch them, calling multiple files with a single mv: for yy in {1990..2019} do y=${yy#[0-9][0-9]} # remove first two digits of year mv ./*D??"$y" "/cygdrive/d/RAID5/RAID200/invoices/1/$yy" done Or, if this runs into "argument length exceeded" errors, use xargs: for yy in {1990..2019} do y=${yy#[0-9][0-9]} printf "%s\0" ./*D??"$y" | # NUL-delimited filenames for xargs -0 xargs -0 -r mv -t "/cygdrive/d/RAID5/RAID200/invoices/1/$yy" done
bash if statement help
1,573,673,756,000
I have a directory that contains 10,665 jpeg files. I want to move 500 files to a new directory, and 500 to the next directory, etc. The largest files must be moved first: 500-1 contains the 500 largest files, 500-2 the next largest 500 files, etc. The reason I want to do this is that I want to give the JPEGs to someone and the file manager hangs because there are so many in one directory.
On a Linux-based system or other one using GNU find you can use a loop something like this find -maxdepth 1 -type f -printf '%s\t%P\0' | sort -z -rn | ( # x is max files per directory; d is directory number; k is file counter x=500 d=1 k=1 while IFS=$'\t' read -r -d '' size path do printf "%d\t%d\t%s\n" $k $d "$path" # File nr, Directory nr, Filename echo "##" mkdir -p "/path/to/dir-$d" echo "##" mv -f "$path" "/path/to/dir-$d/${path##*/}" [[ $((k++)) -ge $x ]] && { k=1; ((d++)); } # Next directory done ) Remove echo '##' from the two action lines in the loop when you are sure that they are going to do what you want them to do. Comment out the printf if you don't need a status report of what's going where.
Move every 500 files in new directory [closed]
1,573,673,756,000
The first part of what i am mucking around with simply creates a folder entitled command_manuals that contain text file copies of all the commands available at the bash shell, the filenames which are the command names themselves.Aside from some unusual error messages that do not affect the script from achieving it's goal, this part I have managed to get, but I would prefer to go to the most crippling issues first so I will leave it out for now. Those without manuals available have empty text files still, which brings me the goal of the second part, which is to delete these "0 size text files" and compile a single list for which I want to use in a later part, that checks the "undocumented man 7" and other parts every time i execute apt-update and uses one of the well known pattern searching packages to see if anything new has been added regarding those commands missing manuals, ra,ra,ra anyway not really important until i get over this drama of part two, which thus far i have successfully written an if condition into the for loop that simply prints out the subset of the folder's contents with a size of zero, but the trouble starts when i try to replay this basic echo command between "then" and "fi" that deletes the empty files. But this also brings me to an additional question concerning another odd thing i noticed, the basic template script that works as i desired, is missing the standard #!/bin/bash that is always required as the first line for .sh scripts in my previous experience, why? template_for_if_delete.sh TOTALnum=$(wc -l < filesizes.txt); for i in `seq 1 $TOTALnum`; do size=$(sed -n ''$i','$i'p' filesizes.txt) if [ $size -eq 0 ]; then echo $(sed -n ''$i','$i'p' filenames.txt); fi done; So far for the actual script for the second task i have: secondpart.sh #!/bin/bash cd; cd command_manuals; rm filenames.txt; ls -1 > filenames.txt; TOTALnum=$(wc -l < filenames.txt); for i in `seq 1 $TOTALnum`; do filename=echo $(sed -n ''$i','$i'p' filenames.txt); size=$(stat -c '%s' $filename); if [ $size -eq 0 ]; then rm $(locate $(sed -n ''$i','$i'p' filenames.txt)); fi done; which produces the output (in repetition a number of times as per the quantity defined in the for loop above): Try 'stat --help' for more information. ./secondpart.sh: line 9: [: -eq: unary operator expected ./secondpart.sh: line 8: x86_64-linux-gnu-gold.txt: command not found stat: missing operand I then tried to change to complex parameter expansion for the variable 'size' in the if statement: #!/bin/bash cd; cd command_manuals; rm filenames.txt; ls -1 > filenames.txt; TOTALnum=$(wc -l < filenames.txt); for i in `seq 1 $TOTALnum`; do filename=echo $(sed -n ''$i','$i'p' filenames.txt); size=$(stat -c '%s' $filename); if [ ${#size} -eq 0 ]; then rm $(locate $(sed -n ''$i','$i'p' filenames.txt)); fi done; which produced the concerning output asking me if i want to delete some random unrelated stuff, at which point i decided ok i better post a question before i mess up my virtual machine thats been running so well for me: ./secondpart.sh: line 8: filenames.txt: command not found stat: missing operand Try 'stat --help' for more information. rm: missing operand Try 'rm --help' for more information. ./secondpart.sh: line 8: file-roller.txt: command not found stat: missing operand Try 'stat --help' for more information. rm: missing operand Try 'rm --help' for more information./code> ./secondpart.sh: line 8: filesizes.txt: command not found stat: missing operand Try 'stat --help' for more information. rm: missing operand Try 'rm --help' for more information. ./secondpart.sh: line 8: file.txt: command not found stat: missing operand Try 'stat --help' for more information. rm: cannot remove adammvirtual/Win10UbuntuVM001_apt_sources_file.txt': No such file or directory rm: cannot remove '/home/adamvirtual/mapfile.txt': No such file or directory rm: remove write-protected regular file '/usr/share/doc/alsa-base/driver/Procfile.txt.gz'? I pressed ctrl+C to escape the prompt.
The issue is in ./secondpart.sh: line 8, which should set $filename. stat and rm have $filename as argument, so they are complaining. These errors are follow-ups. So you need to fix line 8. You should almost always have set -euo pipefail at the beginning of your scripts to let them exit on the first error and thus to prevent the follow-up errors. But in general, your script is overly complicated, using wc, a for loop and sed is not a proper way to read a file line by line. And instead using stat -c %s to determine if file size is zero, you might want to use the file test operator -s, which does exactly that (actually checking the opposite, if file size is not zero). Use e.g.: xargs -a filenames.txt -I{} sh -c '[ -s "$1" ] || rm -i "$1"' xargs-sh {} or readarray filenames < filenames.txt for filename in "${filenames[@]}"; do [ -s "$filename" ] || rm -i "$filename" done or while IFS= read -r filename; do [ -s "$filename" ] || rm -i "$filename" done < filenames.txt In general, having file names line by line in a text file is not a good idea, because file names are allowed to have newline characters in their name. Instead, you should always use null character (\0) as file delimiter.
Bash Script general questions [closed]
1,573,673,756,000
I want to make the script to extract the users of linux server and check if "/home/$user/public_html/vb/includes/config.php" is exist , i want the script to check all the users in the server and search many files in all users
This will search for public_html/vb/includes/config.php in the home directory of every user on the system, no matter how they are defined (/etc/passwd, ldap, yp, etc) file="public_html/vb/includes/config.php" for homedir in $(getent passwd | cut -d: -f6) ; do f="${homedir}/${file}" [ -e "$f" ] && echo "$f" done
Creating shell script with bash scripting [closed]
1,573,673,756,000
I am trying to make sh script which uses 'sed' to make bubblesort algorithm I am strugling, how to make for loop for n in $1 do echo $n done How can I change body of the for loop to make just n-1 cycles? I tried this $1-1 but it doesn't work. It will print part of the string and - 1.
n-1 cycles means that the last item shouldn't be considered. Use the following approach(assuming that your input argument will always be a string of space-delimited substrings): s=$1 for n in ${s:0:-2} do echo $n done ${s:0:-2} - slice of items containing all items except the last one ^ ^ | | from to
How to make for loop with $1 - 1 cycles [closed]
1,303,906,768,000
I'm a Windows guy, dual booted recently, and now I'm using Linux Mint 12 When a Windows desktop freezes I refresh, or if I am using a program I use alt + F4 to exit the program or I can use ctrl + alt + delete and this command will allow me to fix the Windows desktop by seeing what program is not responding and so on. Mint freezes fewer times than my XP, but when it does, I don't know what to do, I just shut down the pc and restart it. So is there a command to fix Linux when it freezes?
You can try Ctrl+Alt+* to kill the front process (Screen locking programs on Xorg 1.11) or Ctrl+Alt+F1 to open a terminal, launch a command like ps, top, or htop to see running processes, and then launch kill on non-responding process. Note: if not installed, install htop with sudo apt-get install htop. Also, once done in your Ctrl+Alt+F1 virtual console, return to the desktop with Ctrl+Alt+F7.
What to do when a Linux desktop freezes?
1,303,906,768,000
I have a really strange situation here. My PC works fine, at least in most cases, but there's one thing that I can't deal with. When I try to copy a file from my pendrive, everything is ok -- I got 16-19M/s , it works pretty well. But when I try to copy something to the same pendrive, my PC freezes. The mouse pointer stops moving for a sec or two, then it moves a little bit and it stops again. When something is playing, for example, in Amarok, the sound acts like a machine gun. The speed jumps from 500K/s to 15M/s, average 8M/s. This occurs only when I'm copying something to a pendrive. When the process of copying is done, everything backs to normal. I tried everything -- other pendrive, a different USB port on front panel or those ports from back, I even changed the USB pins on motherboard (front panel), but no matter where I put my USB stick, it's always the same. I tried different filesystem -- fat32, ext4. I have no problem with the device on Windows, on my laptop. It has to be my PC or something in my system. I have no idea what to look for. I'm using Debian testing with standalone Openbox. My PC is kind of old -- Pentium D 3GHz, 1GiB of RAM, 1,5TB WD Green disk. If you have something that would help me to solve this issue, I'd be glad to hear that. I don't know what else info I should provide, but if you need something, just ask, I'll update this post as soon as possible. I tried to reproduce this problem on ubuntu 13.04 live cd. I mounted my encrypted partition + encrypted swap and connected my pendrive to a usb port. Next I tried to start some apps, and now I have ~820MiB in RAM and about 400MiB in SWAP. There's no problem with copying, no freezing at all, everything is as it should be. So, it looks like it's a fault of the system, but where exactly? What would cause such a weird behavior?
Are you using a 64-bit version of Linux with a lot of memory? In that case the problem could be that Linux can lock for minutes on big writes on slow devices like for example SD cards or USB sticks. It's a known bug that should be fixed in newer kernels. See http://lwn.net/Articles/572911/ Workaround: as root issue: echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes I have added it to my /etc/rc.local file in my 64bit machines. TANSTAAFL; this change can (and probably will) reduce your throughput to these devices --- it's a compromise between latency and speed. To get back to the previous behavior you can echo 0 > /proc/sys/vm/dirty_background_bytes echo 0 > /proc/sys/vm/dirty_bytes ...which are the default values, meaning that the writeback behavior will be controlled by the parameters dirty_ratio and dirty_background_ratio. Note for the not-so-expert-with-linux people: the files in /proc are pseudofiles --- just communication channels between the kernel and user space. Never use an editor to change or look at them; get instead a shell prompt --- for example, with sudo -i (Ubuntu flavors) or su root and use echo and cat). Update 2016/04/18 it seems that, after all, the problem is still here. You can look at it at LWN.net, in this article about writeback queues.
Why is my PC freezing while I'm copying a file to a pendrive?
1,303,906,768,000
I've got an eeePC 900a: it has a 8GB flash as disk and only 1GB of RAM. The Linux distribution installed on it is ArchLinux. When the system runs out of memory it becomes extremely unresponsive: it takes several seconds/minutes to do things like switching to TTY1 or even moving the mouse pointer. Sometimes it looks like the system just freezes: three ours ago I let it alone and nothing at all is changed so far. I'd rather avoid creating a swap partition/file on this eeePC since the disk is already that small, and also because the many writes on the swap space would shorten a lot the flash card life. Moreover I think that a swap file/partition would just move the problem, rather than definitely fixing it. Isn't the kernel supposed to kill some random applications when it runs out of memory? Why does it fail (or takes ages) at doing that? A few months/years ago I already tried to look further into this, but couldn't find anything that would actually work...
Recently I found a solution to my problem. Since the Linux OOM killer isn't able to do its job properly, I started using a userspace OOM Killer: earlyoom. It's written in C, fairly configurable and it's working like a charm for me. I've also heard about some alternatives, like Facebook's OOMD, developed to run on their servers, but I haven't tried this one
System hanging when it runs out of memory
1,303,906,768,000
I use Ubuntu. Sometimes, the system does not have any response with mouse and keyboard. Is there any way to solve this problem except hitting the reset button on the machine?
If you want a way to reboot, without saving open documents, but without hitting the reset button, then there are ways that are less likely to cause data loss. First, try Ctrl+Alt+F1. That should bring you to a virtual console, as ixtmixilix said. Once you're in a virtual console, Ctrl+Alt+Delete will shut down and reboot the machine. If that technique doesn't work, there's always Alt+SysRq+REISUB. As for fixing the problem without rebooting, without more information about what is going on, it would be difficult to give a good answer. If you could describe the circumstances under which this occurs (the best way to do that is to edit your question to add the information), then that may help people to give good answers. The other thing to consider is that, if your computer is becoming unresponsive--especially if it takes more than a a few seconds for Ctrl+Alt+F1 to bring up a virtual console--then you almost certainly have a bug, and by reporting it you can both help the community and maybe get an answer. GUI Glitches Causing Unresponsive WM or X11/Wayland This might be happening due to an interaction between an application and a window manager--or the X11 server or Wayland. A sign that this is the nature of the problem is if an application stops responding and prevents you from entering input with the keyboard or mouse to other application windows. (No application should be able to do this; some GUI component must have a bug in it for this to occur.) If that's what's happening, then you can kill the offending process in a virtual console (as ixtmixilix alluded to): Press Ctrl+Alt+F1. Log in. You won't see anything as you enter your password. That's normal. Use a utility like ps to figure out the offending program's process name. Sometimes this is easy in Ubuntu, and other times it isn't. For example, the name of an Archive Manager process is file-roller. If you have trouble figuring it out, you can usually find the information online without too much trouble (or if you can't, you can post a question about it). You can pipe ps's output to grep to narrow things down. Suppose it was Archive Manager that was causing the problem. Then you could run: ps x | grep file-roller You'll see an entry for your own grep command, plus an entry for file-roller. Attempt to kill the offending process with SIGTERM. This gives it the chance to do last-minute cleanup like flushing file buffers, signaling to remote servers that it is about to disconnect (for protocols that do that), and releasing other sorts of resources. To do this, use the kill command: kill PID where PID is the process ID number of the process you want to kill, obtained from running ps in step 3. SIGTERM is a way to firmly ask a process to quit. The process can ignore that signal, and will do so when malfunctioning under certain circumstances. So you should check to see that it worked. If it didn't, kill it with SIGKILL, which it cannot ignore, and which always works except in the rare case where the process is in uninterruptible sleep (or if it is not really running, but is rather a zombie process). You can both check to see if the process is still running, and kill it with SIGKILL if it is, with just one command: kill -KILL PID If you get a message like kill: (PID) - No such process, you know killing it with SIGTERM worked. If you get no output, you know SIGTERM didn't work. In that case, SIGKILL probably did, but it's worth checking by running it again. (Press the up arrow key to bring up previous commands, for ease of typing.) In rare instances for your own processes, or always with processes belonging to root or another user besides yourself, you must kill the process as root. To do that, prepend sudo (including the trailing space) before the above kill commands. If the above commands don't work or you're told you don't have the necessary access to kill the process, try it as root with sudo. (By the way, kill -KILL is the same as the widely popular kill -9. I recommend kill -KILL because SIGKILL is not guaranteed to have 9 as its signal number on all platforms. It works on x86, but that doesn't mean it will necessarily work everywhere. In this way, kill -KILL is more likely to successfully end the process than kill -9. But they're equivalent on x86, so feel free to use it there if you like.) If you know there are no other processes with the same name as the one you want to kill, you can use killall instead of kill and the name of the process instead of the process ID number. A Process Monopolizing CPU Resources If a process runs at or very near the highest possible priority (or to state it more properly, at or near the lowest possible niceness), it could potentially render your graphical user interface completely, or near-completely, unresponsive. However, in this situation, you would likely not be able to switch to a virtual console and run commands (or maybe even reboot). If a process or a combination of processes running at normal or moderately elevated priority are slowing your machine down, you should be able to kill them using the technique in the section above. But if they are graphical programs, you can likely also kill them by clicking the close button on their windows--the desktop environment will give you the option to kill them if they are not responding. If this doesn't work, of course you can (almost) always kill them with kill -KILL. I/O Problems Buggy I/O can cause prolonged (even perpetual) unresponsiveness. This can be due to a kernel bug and/or buggy drivers. A partial workaround is to avoid heavy and simultaneous read and/or write operations (for example, don't copy two big files at once, in two simultaneous copy processes; don't copy a big file while watching an HD video or installing an OS in a virtual machine). This is obviously unsatisfactory and the real solution is to find the problem and report it. Unless you're running a mainline kernel from kernel.org, kernel bugs should be reported against the package linux in Ubuntu (since Ubuntu gives special kernel builds that integrate distro-specific patches, and bug reports not confirmed against a mainline kernel will be rejected at kernel.org). You should do this by running ubuntu-bug linux (or apport-cli linux) on the affected machine. See the Ubuntu bug reporting documentation first; it explains how to do this properly. Graphics Card Problems Some GUI lockups can be caused by graphics card problems. There are a few things you can try, to alleviate this: Search the web to see if other people have experienced similar problems with the same video card (and/or make and model of machine) on Ubuntu or other GNU/Linux distributions. There may be solutions more specific than what I can offer in this answer, without more specific information than is currently in your question. See if different video drivers are available for you to try. You can do this by checking in Additional Drivers; you can also search the web to see what Linux drivers are available for your video card. Most proprietary video cards are Intel, AMD/ATi, or Nvidia (click those links to see the community documentation on installing and using proprietary drivers for these cards in Ubuntu). For Intel, you're best off sticking with the FOSS drivers that are present in Ubuntu, but there's still helpful information you can use. Regardless of what card you have, this general information may help. If you're currently using proprietary drivers, you can try using different proprietary drivers (for example, directly from NVidia or AMD/ATi), or you can try using the free open source drivers instead. Try selecting a graphical login session type that doesn't require/use graphics acceleration. To do this, log out, and on the graphical login screen click the Ubuntu logo or gear icon near your login name. A drop-down menu is shown. Change the selection from Ubuntu to Ubuntu 2D. This makes you use Unity 2D instead of Unity. (If you're using GNOME Shell, you can select GNOME Fallback / GNOME Classic instead.) If in doubt and there's a selection that says "no effects," pick that, as that's probably the safest. This question has some more information about different graphical interfaces you can choose between in Ubuntu. In newer versions of Ubuntu, you can choose between X.org and Wayland on the login screen. Whichever you've been using, try the other. Sometimes a problem with Wayland can be fixed by using X.org, or vice versa. Report a bug. Hopefully the information above has conveyed some general information about what could be causing this kind of problem. It should also serve to illuminate what kind of information might be useful for you to add to your question (depending on the specific details of the problem), to make it possible to get an even better answer. (Or to improve this answer with additional information specific to your situation.)
How to fix non-responsive Ubuntu system?
1,303,906,768,000
I'm using Linux 4.15, and this happens to me many times when the RAM usage reaches its top - The whole OS becomes unresponsive, frozen and useless. The only thing I see it to be working is the disk (main system partition), which is massively in use. I don't know whether this issue is OS-specific, hardware-specific, or configuration-specific. Any ideas?
What can make Linux so unresponsive? Overcommitting available RAM, which causes a large amount of swapping, can definitely do this. Remember that random access I/O on your mechanical HDD requires moving a read/write head, which can only do around 100 seeks per second. It's usual for Linux to go totally out to lunch, if you overcommit RAM "too much". I also have a spinny disk and 8GB RAM. I have had problems with a couple of pieces of software with memory leaks. I.e. their memory usage keeps growing over time and never shrinks, so the only way to control it would have been to stop the software and then restart it. Based on the experiences I had during this, I am not very surprised to hear delays over ten minutes, if you are generating 3GB+ of swap. You won't necessarily see this in all cases where you have more than 3GB of swap. Theory says the key concept is thrashing. On the other hand, if you are trying to switch between two different working sets, and it requires swapping 3GB in and out, at 100MB/s it will take at least 60 seconds even if the I/O pattern can be perfectly optimized. In practice, the I/O pattern will be far from optimal. After the difficulty I had with this, I reformatted my swap space to 2GB (several times smaller than before), so the system would not be able to swap as deeply. You can do this even without messing around resizing the partition, because mkswap takes an optional size parameter. The rough balance is between running out of memory and having processes get killed, and having the system hang for so long that you give up and reboot anyway. I don't know if a 4GB swap partition is too large; it might depend what you're doing. The important thing is to watch out for when the disk starts churning, check your memory usage, and respond accordingly. Checking memory usage of multi-process applications is difficult. To see memory usage per-process without double-counting shared memory, you can use sudo atop -R, press M and m, and look in the PSIZE column. You can also use smem. smem -t -P firefox will show PSS of all your firefox processes, followed by a line with total PSS. This is the correct approach to measure total memory usage of Firefox or Chrome based browsers. (Though there are also browser-specific features for showing memory usage, which will show individual tabs).
What can make Linux unresponsive for minutes when browsing certain websites?
1,303,906,768,000
To prevent fork bomb I followed this http://www.linuxhowtos.org/Tips%20and%20Tricks/ulimit.htm ulimit -a reflects the new settings but when I run (as root in bash) :(){ :|:&};: the VM still goes on max CPU+RAM and system will freeze. How to ensure users will not be bring down the system by using fork bombs or running a buggy application? OS: RHEL 6.4
The superuser or any process with the CAP_SYS_ADMIN or CAP_SYS_RESOURCE capabilities are not affected by that limitation, that's not something that can be changed. root can always fork processes. If some software is not trusted, it should not run as root anyway.
How to prevent fork bomb?
1,303,906,768,000
I am unable to enter anything at the login screen; it just freezes directly after the page shows. The cursor inside the login form blinks about 10 times, then it stops. I can't move the mouse or use the keyboard. I already entered the secure mode and triggered update, upgrade and dist-upgrade via the root shell it made no difference.
We were able to solve it by starting the shell in secure mode and executing the following commands. apt-get update apt-get install xserver-xorg-input-all apt-get install ubuntu-desktop apt-get install ubuntu-minimal apt-get install xorg xserver-xorg apt-get install xserver-xorg-input-evdev //I think this packet was the problem apt-get install xserver-xorg-video-vmware reboot
Ubuntu 16.04 - GUI freezes on login start page
1,303,906,768,000
My laptop (no VM, just plain Ubuntu with encrypted home) freezes for 3 minutes a few times per day. During these 3 minutes, the disk LED indicates intense disk activity, and I can't even move the mouse or press CTRL-ALT-F1. I want to use iotop to find out which process is causing this. The problem with iotop is that it shows disk usage for all processes (huge table). How do I limit iotop's output to only the first row? The idea is to make iotop more efficient so that it manages to compute and write to the log file even when the system is super-slow, so letting iotop display the whole table and then grepping is not a solution.
Not exactly what I was looking for but close: iotop -o So I will use: sudo nice -20 sudo iotop -tbod10 > ~/iotop.log
Make iotop show only the most disk-intensive item
1,303,906,768,000
Sometimes VirtualBox causes random freeze of my Mint 16 Cinnamon Desktop 64bit. I am not able to pinpoint what is actually wrong and even where to fill the bug report. But the life goes on and I need some means of re-initializing the windowing subsystem without losing the work I've done with existing applications. When I run sudo service mdm restart all the already running applications got killed brutally. The cinnamon --replace -d :0 spell doesn't do anything; it just hangs. I guess it is because it need some form of co-operation with the already running cinnamon, which I guess doesn't respond to that. Commands entered with Alt+F2 are ignored, as well as the "r" command used to restart the Cinnamon. The screen is not updated, and it seems that the very keystrokes are ignored. What are my other options? Symptoms of the freeze: The bug manifests by just freezing the screen update of the graphic terminal; the mouse moves alright, it even changes the icon when hovering over different parts of the screen. The problem is that I can't do anything with it; besides the screen doesn't update, and the keyboard don't do anything as well. But I can switch to the text console and I can see, that the windows' processes run well. I can event interact with the applications, that supply some form of cli interactions (like VBoxManage). To reproduce: Install the Linux Mint 16 with Cinnamon 2.0 64 bit Install a program that changes wallpaper (tested on variety, and wallch) and set it to start changing wallpaper as the background task. Wait for background to change several times. The bug doesn't kick in on the first background change, you need to wait a moment. On the .xsession.errors you will see something like that. Edit: I've updated the symptoms. The time went by and I was able to triage the problem a lot better. It is NOT related to VirtualBox activity in any way.
I don't know what the Cinnamon guys renamed gnome-shell when they forked, so you'll have to find this out. It's probably either cinnamon-shell or cinnamon or something. I'll assume it's called cinnamon. Now, the GNOME Shell - and by extension, Cinnamon - will respond to SIGHUP by completely reinitializing. It's basically the same as typing r into the AltF2 dialog. So, the solution is easy: Switch to a virtual console by pressing CtrlAltF21. Log in. Type killall -HUP cinnamon. Switch back to whatever virtual console was running Xorg. It may take a couple seconds for Cinnamon to reinitialize. 1: This is a good choice as some distributions run display managers on tty1, some on tty7/tty8 (depending on the DM). No one uses tty2.
How to recover from desktop freeze without losing running windows?
1,303,906,768,000
last three days I am experiencing random freezes. If i am looking on youtube when this happens Audio keeps playing but screen is froze and keyboard or cursor do not do anything. I trying to look in sudo journalctl and this is what I found: led 04 10:44:02 arch-thinkpad kernel: i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe C (start=113031 end=113032) time 340 us, min 1073, max 1079, scanline start 1062, end 1085 led 04 11:09:15 arch-thinkpad kernel: i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe C (start=203838 end=203839) time 273 us, min 1073, max 1079, scanline start 1072, end 1090 led 04 11:15:47 arch-thinkpad kernel: i915 0000:00:02.0: [drm] *ERROR* Atomic update failure on pipe C (start=227329 end=227330) time 278 us, min 1073, max 1079, scanline start 1066, end 1085 uname -a returns: Linux arch-thinkpad 5.10.4-arch2-1 #1 SMP PREEMPT Fri, 01 Jan 2021 05:29:53 +0000 x86\_64 GNU/Linux I use: i3wm, picom, pulseaudio. I have lenovo x390 yoga with intel processor. How can I diagnose and solve this problem? EDIT: Upgrading linux kernel to 5.10.16 solved my problem. Still I will accept answer of @Sylvain POULAIN for its complex view on the problemand offering alternative solution.
5.10.15 doesn't solve this problem. I still have same error. Intel bugs are really annoying since kernel > 4.19.85 (November 2019 !) As a workaround, i915 guc need to be enable as mentionned in Archlinux Wiki : https://wiki.archlinux.org/index.php/Intel_graphics#Enable_GuC_/_HuC_firmware_loading and loaded before others modules To resume : Add guc paramters to kernel parameters by editing /etc/default/grub GRUB_CMDLINE_LINUX="i915.enable_guc=2" Add guc option to i915 module by adding /etc/modprobe.d/i915.conf file with : options i915 enable_guc=2 Add i915 to /etc/mkinitcpio.conf : MODULES=(i915) Rebuild kernel initramfs (needs reboot after successfull build) : # mkinitcpio -P Remove xf86-video-intel (driver is already in kernel) : # pacman -Rscn xf86-video-intel
Arch linux randomly freezes after updating to kernel 5.10
1,303,906,768,000
I have 15 identical Linux RH 4.7 64-bit severs. They run cluster database (cluster is application level). On occasion (every month or so) a random box (never the same though) freezes. I can ping the box and ping works. If I try to ssh in the box I get: ssh_exchange_identification: Connection closed by remote host SSH is set up properly. When I go to the server room, and try to login directly to console, I can switch consoles with Alt+Fn, I can enter a username, and characters do show, but after pressing Enter, nothing happens. I waited 8 hours once and it didn't change. I set up syslog to log everything to a remote host, and there is nothing in those logs. When I reboot the machine, it works without a problem. I have run HW tests - everything is ok, and nothing is in the logs. The machines are also monitored with NAGIOS, and there is no unusual load or activity prior to freeze. I have run out of ideas; what else can I do or check?
It sounds like your kernel panicked in some way such that sshd couldn't send the server keys. Possibly, the kernel was wedged in such a way that the network stack was still up, but the vfs layer was unavailable. When I experienced similar problems on a RHEL4 system, I set up the netdump and netconsole services, and a dedicated netdump and syslog server to catch the crash dumps and kernel panic information. I also set the kernel.panic sysctl to 10. That way, when a system panics, you get both the kernel trace and a copy of the memory on that system, to which you could analyse with the 'crash' utility. You would certainly also benefit from setting up a serial console for the hosts, so you could see the console out put and potentially hit the magic sysrq keys. Also, if you're willing to set up the networking and you have hardware that supports it, you can use IPMI to remotely poweroff,poweron,restart, and query the hardware. (for what it's worth, RHEL5 has a similar functionality with kexec/kdump, only the crash dump is stored locally)
Debugging Linux machine freezes
1,303,906,768,000
I am on Linux Mint 17. I experienced an unexpected software failure. The desktop stopped responding to anything. As I am inexperienced, I only managed to switch to the console using Ctrl+Alt+F1 and then rebooted the machine using reboot. Is there a more appropriate procedure?
Update As of Linux Mint 18, there has been a move to LightDM display manager, which you can restart as follows: sudo service lightdm restart Original answer Running reboot is a perfectly safe way of doing it. If you just wanted to log out (restart your GUI session), you could have run: sudo service mdm restart That would have restarted the Mint Display Manager, the default display manager under Mint.
What to do when the desktop freezes?
1,303,906,768,000
I have a newly installed Manjaro system and it works fine most of the time but it has frozen a couple of times randomly. What logs should look in (and what should I look for) to try to diagose the problem? I know its quite a broad question, but there must be somewhere that would be a good starting point.
The two most common causes of crashes are video driver bugs and bad RAM. You can look for clues in logs in /var/log. Video problems are logged in /var/log/Xorg.0.log. Problems detected by the kernel are logged in /var/log/kern.log or /var/log/messages or some other file depending on the distribution, I don't know which file Manjaro uses. However, if your system crashes, it often doesn't get a chance to write to the logs. Do run a memory test. Install Memtest86+ (Arch Linux has it as a package, so you should have it on Manjaro as well). Reboot and select “memory test” at the Grub prompt and let it run for at least one full pass. If you suspect a video driver problem, try using the free driver if you were using the proprietary driver, or vice versa.
My Linux desktop freezes randomly. What to look for in logs
1,303,906,768,000
I was forced to shutdown (using the power button) and reboot after my laptop froze with just a black screen. After such an incident, where should I look for error messages etc. that might indicate what caused the freeze? I am running Xubuntu (Lucid) with Fluxbox as my window manager. Any suggestions are welcome but I generally prefer to use the CLI.
If the screen and input devices (keyboard and mouse or trackpad) froze, the first place to start by looking would be in /var/log/Xorg.0.log (assuming that Xorg is running on the first display server). If that doesn't yield any immediate clues, the next logs to check would be /var/log/messages.log and /var/log/dmesg.log. If you are unable to find anything in the logs, and the freeze is happening with any frequency, you might be advised to check your memory with a utility like memtest86+.
Where should I look for error messages after a freeze-up and reboot in Linux?
1,303,906,768,000
The system often just freezes up without any warning, it doesn't gradually start getting slower or something like that, and every time I look the avarage system load is below 20% (usually not even 10%). When looking at dmesg, there's one thing that always seems to come back though. The message composite sync not supported. These freezes are getiing indredibly annoying as I always lose all my work I haven't saved yet, and the last time it froze up happened while I was saving something (I don't think I need to tell you that that file was gone). Can annyone give me any pointers (and hopefully solutions as well), to where this problem lies? If you've found something that might be the cause, but you don't know how to fix it, just put it in the comments, please. That way I can do a bit of research myself maybe. Dmesg: http://pastebin.com/ZeiULvSK ... And I thought there was a kernel.log file in /var/log, but apparently I was wrong. More recent dmesg: http://pastebin.com/CXETguti This is the output taken right after closing VVVVVV (a game). I found out 2 things today that both point to the same thing... The dmesg is full of Nouveau errors, and games lag like hell, and some don't start at all. The conclusion is that it refuses to use the NVidia drivers. Help on getting them to work would be nice as well. More info on that: https://askubuntu.com/a/83995/18953 When adding nomodeset to my kernel line in GRUB I'm stuck with a small screen resolution, limited amount of colours (gradients look like crap), the screen becomes laggy, but the errors don't crop up anymore in dmesg. I've experienced no freezes with this parameter added, but I haven't worked longer than 10 minutes with nomodeset because making mindmaps on a small resolution is annoying. My graphic card is an NVidia Quadro NVS 110M. robin@robin-Latitude-D620:~$ lspci | grep -i vga 01:00.0 VGA compatible controller: nVidia Corporation G72M [Quadro NVS 110M/GeForce Go 7300] (rev a1) robin@robin-Latitude-D620:~$ sudo lshw -class display [sudo] password for robin: *-display description: VGA compatible controller product: G72M [Quadro NVS 110M/GeForce Go 7300] vendor: nVidia Corporation physical id: 0 bus info: pci@0000:01:00.0 version: a1 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress vga_controller bus_master cap_list rom configuration: driver=nouveau latency=0 resources: irq:16 memory:ed000000-edffffff memory:d0000000-dfffffff memory:ee000000-eeffffff memory:ef000000-ef01ffff What I did to install the NVidia drivers Installed nvidia-current with Jockey, removed it again (had to try 2 times, first time failed), added a PPA for a newer version, installed nvidia-current again (this time with the terminal), rebooted.
Well, I upgraded to Xubuntu 11.10 and installed the nvidia-173 drivers. My laptop gets slightly hotter than usual (only slightly because I keep my CPU at 1Ghz with cpufrequtils), but at least I haven't experienced any freezes yet. Also, there seem to be no issues with the NVidia drivers for a change (appart from the fact that Plymouth only shows up in the last 2 seconds of the boot process, but at least it does show up this time).
System often freezes without warning
1,303,906,768,000
My laptop is an Acer predator helios 300 with intel i7-7700hq and an NVIDIA GTX 1050ti. It had a 128GB NVME SSD and 1TB hard disk. I had dual boot on it with fedora 29 installed on the SSD and Mint Tessa installed on the Hard Disk. I deleted all the fedora partitions including the EFI partition from within mint using GParted. After that even Mint did not boot up. I tried to install Deepin OS 15.10 on the SSD and freed all the space on the HDD in the process. While the installation completed without an issue, it just freezes completely whenever I hit shutdown or restart. The exact same thing happens with Manjaro Deepin 18.0.2 as well as Elementary OS 5.0 Juno. I tried setting nouveau.modeset=0, acpi=off, acpi=noirq in /etc/default/grub and similar solutions people suggesting online. None of them worked. I then replaced the HDD with a Samsung 860 Evo 250 GB SATA SSD and tried to install Ubuntu 18.04 on it. Exact same thing as the previous three. Clean installation but freezes on reboot/shutdown. 1) I saw people claiming this to be a display driver issue. I am not sure but this seems unlikely as I had faced issues with the nouveau drivers earlier and those mostly led to blank screens on startup. I may be wrong here though. 2) This may be an issue with the UEFI bootloader as on rare occasions when the system does not freeze on pressing shut down immediately, it stops at Problem loading UEFI:db X.509 certificate (-65) 3) I tried some of the UEFI related options like enabling and disabling secure boot. To no avail. Any help is very very welcome. I am not able to do any work as I don't want to hard shut down my laptop again and again.
I was fighting this issue for 3 days, tried all of the above options but none of them helped me. But I solved it! So, in my case the issue was because of UEFI boot (probably because laptop is very old: lenovo ideapad z570 and UEFI implementation is buggy). SOLUTION: I just added noefi into the kernel options and my laptop started shutting down in a normal way. sudo vim /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="splash quiet noefi" Update grub (for ubuntu: sudo update-grub) PS: It works on any kernel (4.19 or 5.2). Tested it on nvidia-390xx
System freeze on reboot/shutdown
1,303,906,768,000
I encountered several crashes of my machine. Meanwhile, I can reproduce it when I start a program that fills up all memory. Once the system starts writing to the swap file, the system freezes and I have to reboot. In the journal, I see no useful log information before the crash, for instance: Mar 23 19:12:01 classen systemd[1]: Starting Cleanup of Temporary Directories... Mar 23 19:12:01 classen systemd[1]: Started Cleanup of Temporary Directories. Mar 23 19:12:08 classen wpa_supplicant[757]: wlp3s0: WPA: Group rekeying completed with ... -- Reboot -- Mar 23 19:17:03 classen systemd-journald[380]: Runtime journal (/run/log/journal/) is 8.0M, max 796.6M, 788.6M free. Actually, I don't know to troubleshoot the problem. I hope that someone has seen something similar, and can point me in the right direction. The strange thing is that after working for a while, my system is able to swap to some degree (at least, top showed that some of the swap space was occupied). The freezes happen only under heavy load to the swap file. Here is my setup: $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 238.5G 0 disk ├─sda1 8:1 0 512M 0 part /boot └─sda2 8:2 0 238G 0 part └─MyStorage 254:0 0 238G 0 crypt ├─MyStorage-swapvol 254:1 0 16G 0 lvm [SWAP] └─MyStorage-rootvol 254:2 0 222G 0 lvm / sdb 8:16 0 931.5G 0 disk └─sdb1 8:17 0 931.5G 0 part sr0 11:0 1 1024M 0 rom Relevant part of /etc/fstab: /dev/mapper/MyStorage-rootvol / btrfs rw,noatime,ssd,autodefrag,compress=lzo,space_cache 0 0 /dev/mapper/MyStorage-swapvol none swap defaults 0 0 UUID=63A7-3F81 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2 $ swapon --summary Filename Type Size Used Priority /dev/dm-1 partition 16777212 0 -1 I am running Arch Linux with a 4.4.5 kernel: $ uname -a Linux classen 4.4.5-1-ARCH #1 SMP PREEMPT Thu Mar 10 07:38:19 CET 2016 x86_64 GNU/Linux hooks in /etc/mkinitcpio.conf: HOOKS="base udev autodetect modconf block encrypt lvm2 resume filesystems keyboard fsck"
After some experiment, I can confirm that it was actually thrashing in combination with a huge swap partition (16 GB). Thanks for the comments, Otheus and cas, you had the right intuition. I underestimated the effect. Maybe because previous machines that I used had smaller swap spaces (in comparison to the memory), so eventually the memory hungry process was killed. As some safety measures, I will reduce the maximum swap space on my system. I also defined a per-process limit to guard against a single process blowing up the memory: # limit memory usage to 10G per process ulimit -Sv 10000000 Tools like vmstat 1 can help to analyze the problem.
Machine freezes once it hits swap space under heavy load
1,303,906,768,000
My Linux Mint system (17 Cinnamon, lenovo g565) hangs up frequently during work (say, 2-4 times a day). It may look different - white screen, black screen, screen freeze. Checking syslog after hangs brought me the same lines just before system hanged: pastebin, last are: 08:26:34 wpa_supplicant[1069]: nl80211: send_and_recv->nl_recvmsgs failed: -33 08:28:32 wpa_supplicant[1069]: wlan0: CTRL-EVENT-SCAN-STARTED I'm not 100% sure, that it it's the reason, but the pattern seems to be same with several hangs. Also I have some CPU temperature issues (noticed 75-82 C), but system hanged even after cpufreq powersave mode. What should I do to make more specific diagnosis and eliminate the problem?
This is a known bug, check this launchpad bug report. There is only one suggestion offered to fix it, message n.24: Oops this has been going on since 2009 and a developer did respond that it is simply for roaming in corporate environments with multiple access points to connect to. If you only have one AP at home go into network manager, select "Edit Connection", highlight your AP / wlan0 and click "Edit". Then click the down arrow next to BSSID which is blank. Then select the mac address that was hidden before.
wpa_supplicant nl80211 hangs linux mint frequently
1,303,906,768,000
In my attempt to get unique entries (read lines) out of a simple text file, I accidentally executed nano SomeTextFile | uniq. This "instruction" renders the shell (bash) completely (?) unresponsive/non-usable -- tested within from Yakuake and Konsole. I had to retrieve the process id (PID) (by executing ps aux | grep nano) and manually sudo kill -9 the PID in question. Anyhow, couldn't (or shouldn't?) the above return some error message? Why doesn't Ctrl+C kill this pipeline? Is there an easier or cleaner way to stop it than kill -9?
As other answers have already explained, Ctrl+C doesn't kill Nano because the input of nano is still coming from the terminal, and the terminal is still nano's controlling terminal, so Nano is putting the terminal in raw mode where control characters such as Ctrl+C are transmitted to the program and not intercepted by the terminal to generate signals. When intercepted by the terminal, Ctrl+C generates a SIGINT signal. If you know the process ID of nano (you can find out with ps u -C nano (Linux ps syntax) or pgrep nano or other process listing utility), you can send this signal with kill -INT 12345 where 12345 is the PID. However, SIGINT conventionally means “return to main loop”, and Nano doesn't exit when it receives SIGINT. Instead, send SIGTERM, which means “terminate gracefully”; this is the default signal, so you can just run kill 12345. Another possibility is kill -HUP 12345; SIGHUP means “you no longer have a terminal, quit gracefully unless you can live without”. If all else fails, send SIGKILL (kill -KILL 12345, or famously kill -9 12345), which kills the program whether it wants to die or not. Many programs, including Nano, recognize Ctrl+Z to suspend. This is the same sequence that sends the SIGTSTP signal. If the program recognizes this control key, you get back a shell prompt, and since the program becomes a background job, you can easily kill it with kill %% (which sends a signal to the job that has last been put into the background). With Nano, there is an alternate way: send it its exit key sequence, i.e. Ctrl+X followed if necessary by N for “don't save”. But as a general matter, remember this: Try Ctrl+Z followed by kill %%, and if this doesn't kill the program kill -9 %%. If Ctrl+Z didn't work, switch to another terminal, find out the process ID (you can use ps -t pts/42 to list the processes running on the terminal /dev/pts/42) and kill it.
Accidental `nano SomeFile | uniq` renders the shell unresponsive
1,303,906,768,000
I'm a non-root user on a shared compile server that mounts /home via NFS from some other host. I have a directory ~/a/b with lots of subdirectories c1,c2,.... I wanted to delete ~/a/b completely, and succeeded for most of the cN directories. But a few (say c1) are completely inaccessible: I can execute them (i.e. cd into them) but neither list (ls) let alone remove them. If I say rm -rf ~/a/b/c1, the process hangs in a D state. What can I do as a non-root user to get rid of ~/a/b? Update: I just ssh'd to the file-server (to rule out NFS) and I cannot perform the operation there either, so this doesn't seem to be an NFS problem after all. However, why does the kernel refuse to remove a directory?
Removing a file or directory is an atomic operation requiring one system call, so if the rm command hangs, it's because the kernel is stuck. On an NFS filesystem, this can be (and usually is) due to the server not responding. On a local filesystem, this can be (and usually is) due to a hardware failure. Your disk is probably failing; the kernel logs would confirm that.
Removing a directory hangs
1,303,906,768,000
Many times I find GNOME file copy GUI tool (Nautilus) irritating when it stops working. It happens when: I cancel the copy or move I try to copy to blue tooth exchange folder to my friends laptop(when he forgets to permit the operation or if the file is big) some other times, it just hangs while copying So I obviously get irritated with this and I want to quit the operation immediately. Unfortunately whenever I try to cancel it, it never works. This happened to me several times so I tried to find the process ps aux| grep copy or cp or something like that but I m never successful. Maybe it has become a zombie process I guess.
As far as I know, there is no way to rescue Nautilus (file manager for GNOME) when it hangs. You are left only with the option of killing it, so go to the command line and run: killall nautilus After that, it should automatically restart, and then you can try again. This is just a bug in it. Try avoid parallel copying at once, though I'm not sure if that's what triggers the behavior, but it tends to be a slower operation anyways, compared to serial copying. Note that Nautilus doesn't invoke the shell's copy commands, that's why your ps attempts didn't help. It uses different technology (GIO and/or GVFS).
How to quit GNOME file copy GUI after it hangs
1,303,906,768,000
I'm currently running Debian 6.0.5 on my white Macbook 2008 (4,1) and have recently noticed that when I download, move, or decompress a file, Gnome freezes up completely for at least 20 seconds. These freezes happen off and on until the file is done downloading. Oddly enough I can still use Compiz to switch between workspaces and move windows, but the windows aren't being redrawn. I did a lot of googling to see if I could find a solution to the problem, but not much turned up for my specific problem. I thought the problem might be related to me using a Seagate Momentus XT, as there seemed to be a lot of problems with that drive and linux in the past. It turns out that I'm using the updated firmware that was supposed to fix the linux problems the drive was having. If anyone has any ideas as to why this is happening and a potential fix to this problem, please let me know. I get this error in the syslog: Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330686] ata3.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330695] ata3.00: BMDMA stat 0x6 Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330703] ata3.00: failed command: READ DMA EXT Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330717] ata3.00: cmd 25/00:00:80:64:b4/00:01:2c:00:00/e0 tag 0 dma 131072 in Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330721] res 51/84:60:20:65:b4/84:00:2c:00:00/e0 Emask 0x30 (host bus error) Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330728] ata3.00: status: { DRDY ERR } Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330734] ata3.00: error: { ICRC ABRT } Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.330757] ata3: soft resetting link Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.510690] ata3.00: configured for UDMA/33 Sep 13 16:54:23 Thunder-Pussy kernel: [ 5713.510835] ata3: EH complete
Test the partitions with a livecd of some distro more updated. Mount the partition, write a lot of files and check the dmesg. The kernel of Debian Stable is old and if your problem is a kernel bug, probably is solved. You also can try with other schedulers. Add "elevator=noop" or "elevator=deadline" to your grub. Sometimes, other schedulers can help with this type of issues. If the two tests fail, your disk or controller is broken. Also you can check the healthy of your disk with the SMART tests.
Hard drive writes freezing up Gnome
1,303,906,768,000
My linux desktop system freezes (aptosid/debian sid) sometimes and after a reboot I can't find any infos about the reason for the freeze in messages/dmesg/syslog/Xorg.*.log. When it "freezes" I can still move the mouse in X and sometimes even move the windows for a short time before the system stops responding. Last time I could even switch to the text-terminal and enter my login name, but every text-console stopped after that and displayed no password prompt. SSH login also does not work after the freeze. I think the problem started some weeks (maybe 1-1.5 months) ago. I have a windows partition (win7 64bit) on the same machine which I use mainly for gaming (in the last time mostly StarCraft2). I can't rember any crashes there in hours of playing. I haven't found a way to force the freeze yet which makes debugging not easier.
Sounds like a potential hard drive problem. The behavior you describe is exactly what you would see if the hard drive suddenly stopped responding to requests, or started returning errors. Try running smartctl -a /dev/sda, where sda is the device of your hard drive, to see if the hard drive has logged any errors. You would see an explanation of the error in the kernel's dmesg output. Of course, if you can't login, you can't run dmesg. However, if you log in first and run the command on the text console, it may still be in memory so that you could run it again after the system has crashed. The other option would be to use the netconsole feature of Linux to send the debugging information directly to another machine instead of writing it to disk. This is a little tricky to set up and requires two machines, but is a good thing to try if everything else fails.
System freezes. Can't find anything in the logs
1,303,906,768,000
I am using Arch Linux and the Cinnamon desktop environment. In the last few weeks I have been getting apparently random, brief freezes (a few seconds, 5-10 or so) in Chromium, Brave, Franz and Slack. The freezes are independent, I can have a frozen Chromium, for example, while Brave is working fine and vice versa. I think all of these tools are related in that they all somehow use Chromium code, either directly as in the case of Chromium itself and Brave, or via Electron as is the case for Slack and Franz, so I am guessing the issue is related to that. When the freezes occur, the frozen application is unresponsive, and even resizing the window doesn't work (it appears broken): Everything else works fine, however, I can open new terminals, interact with other applications normally, the desktop is responsive, there is no spike in CPU or RAM usage. It's just those tools. There are some GPU-related messages shown in the terminal when launching all four tools: Chromium $ chromium [58330:58330:0822/140928.777356:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [58383:58383:0822/140928.908932:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [58438:58438:0822/140928.917645:ERROR:angle_platform_impl.cc(43)] Display.cpp:992 (initialize): ANGLE Display::initialize error 0: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1317. [58438:58438:0822/140928.917713:ERROR:gl_surface_egl.cc(831)] EGL Driver message (Critical) eglInitialize: Internal Vulkan error (-3): Initialization of an object could not be completed for implementation-specific reasons, in ../../third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp, initialize:1317. [58438:58438:0822/140928.917732:ERROR:gl_surface_egl.cc(1353)] eglInitialize SwANGLE failed with error EGL_NOT_INITIALIZED [58438:58438:0822/140928.917751:ERROR:gl_ozone_egl.cc(23)] GLSurfaceEGL::InitializeOneOff failed. [58438:58438:0822/140928.919686:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [58470:58470:0822/140928.943148:ERROR:gpu_init.cc(486)] Passthrough is not supported, GL is disabled, ANGLE is Brave $ brave [42382:42382:0822/135725.937415:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [42441:42441:0822/135726.073407:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [42530:42530:0822/135726.271483:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [42643:42643:0822/135726.363020:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [42763:42763:0822/135726.440747:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [42789:42789:0822/135726.566024:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [42493:7:0822/135726.634474:ERROR:command_buffer_proxy_impl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer. Franz $ franz [56942:0822/140812.860154:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization [56982:0822/140812.959086:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization [57029:0822/140812.990586:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process. Slack. This one is exceedingly verbose, but it does also output the same GPU process error as all of the above: $ slack Initializing local storage instance (electron) Sending uncompressed crash reports is deprecated and will be removed in a future version of Electron. Set { compress: true } to opt-in to the new behavior. Crash reports will be uploaded gzipped, which most crash reporting servers support. [56298:0822/140741.539635:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization [08/22/22, 14:07:41:619] info: [ many, many more lines of normal looking output here This GPU message seems particularly relevant: [56298:0822/140741.539635:ERROR:viz_main_impl.cc(186)] Exiting GPU process due to errors during initialization However, none of these messages trigger the freeze. They are shown when I launch the programs, but the programs are still behaving normally and are responsive. Both Chromium and Brave have hardware acceleration enabled in their settings, but Brave's chromium://gpu page suggests it fails for it (see below). Interestingly, the two browsers differ in the Graphics Feature Status section of chrome://gpu (using screenshots because the color helps legibility; you can find full chrome://gpu output here (chromium) and here (brave): Brave Chromium I am using Xorg, not Wayland, on a brand new Lenovo ThinkPad P14s, and this is my system: $ inxi CPU: quad core 11th Gen Intel Core i7-1165G7 (-MT MCP-) speed/min/max: 2385/400/4700 MHz Kernel: 5.19.2-arch1-1 x86_64 Up: 35m Mem: 6423.7/31799.3 MiB (20.2%) Storage: 953.87 GiB (27.8% used) Procs: 336 Shell: Bash inxi: 3.3.20 Graphics: $ inxi -G Graphics: Device-1: Intel TigerLake-LP GT2 [Iris Xe Graphics] driver: i915 v: kernel Device-2: NVIDIA TU117GLM [Quadro T500 Mobile] driver: nvidia v: 515.65.01 Device-3: Chicony Integrated Camera type: USB driver: uvcvideo Display: x11 server: X.Org v: 21.1.4 with: Xwayland v: 22.1.3 driver: X: loaded: intel unloaded: modesetting gpu: i915 resolution: 1920x1080~60Hz OpenGL: renderer: llvmpipe (LLVM 14.0.6 256 bits) v: 4.5 Mesa 22.1.6 I regularly update all packages with sudo pacman -Suy and trizen -Suy, everything is up to date. How can I fix this?
I would suggest you to switch from x11 to wayland to avoid the freezing. While this problem seems to be specific to the apps you mentioned, I have had similar issues in the past, albeit affecting the entire desktop, and switching to Wayland fixed them for me. Unfortunately, Cinnamon isn't compatible with Wayland yet, so you will need to use a different desktop environment. One good choice, which is easily installable on Arch, is KDE. See https://wiki.archlinux.org/title/KDE#Installation.
Random freezes for chromium and electron-based apps
1,303,906,768,000
After closing the lid of my laptop I suffer a periodic freezing system (~0.5 seconds). The symptoms are: mouse pointer stops keyboard input stops (=delayed) video freezes ms teams meetings stuck (rarely sometimes the "internet" is not working) My System: Linux Mint Dell 13 9315 with Linux Mint 21.1 Cinnamon usb-c-hub with 3 HDMI, USB-C, USB3.x, Card- and Ethernet slots 2 external displays connected via an usb-c hub I can see in the log file of XOrg, that every 30 seconds new entries are produced. from /var/log/Xorg.0.log [ 22306.736] (II) modeset(0): Modeline "1024x768"x0.0 65.00 1024 1048 1184 1344 768 771 777 806 -hsync -vsync (48.4 kHz e) [ 22306.737] (II) modeset(0): Modeline "800x600"x0.0 49.50 800 816 896 1056 600 601 604 625 +hsync +vsync (46.9 kHz e) [ 22306.737] (II) modeset(0): Modeline "1152x864"x0.0 108.00 1152 1216 1344 1600 864 865 868 900 +hsync +vsync (67.5 kHz e) [ 22306.737] (II) modeset(0): Modeline "1280x1024"x0.0 108.00 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync (64.0 kHz e) [ 22306.737] (II) modeset(0): Modeline "1600x1200"x0.0 162.00 1600 1664 1856 2160 1200 1201 1204 1250 +hsync +vsync (75.0 kHz e) [ 22337.678] (II) modeset(0): EDID vendor "DEL", prod id 41146 [ 22337.678] (II) modeset(0): Using hsync ranges from config file [ 22337.678] (II) modeset(0): Using vrefresh ranges from config file [ 22337.678] (II) modeset(0): Printing DDC gathered Modelines: [ 22337.678] (II) modeset(0): Modeline "1920x1200"x0.0 154.00 1920 1968 2000 2080 1200 1203 1209 1235 +hsync +vsync (74.0 kHz eP) [ 22337.678] (II) modeset(0): Modeline "1920x1080"x0.0 148.50 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync (67.5 kHz e) [ 22337.678] (II) modeset(0): Modeline "1920x1080i"x0.0 74.25 1920 2008 2052 2200 1080 1084 1094 1125 interlace +hsync +vsync (33.8 kHz e) [ 22337.678] (II) modeset(0): Modeline "1280x720"x0.0 74.25 1280 1390 1430 1650 720 725 730 750 +hsync +vsync (45.0 kHz e) [ 22337.678] (II) modeset(0): Modeline "720x480"x0.0 27.00 720 736 798 858 480 489 495 525 -hsync -vsync (31.5 kHz e) I can trigger the same outputs if i call xrandr --listproviders. There are no conf files in /etc/X11/xorg.conf.d/ I am not quite sure where the problem is located but i seems that closing the lid triggers a periodic scan for displays. inxi -G: Graphics: Device-1: Intel driver: i915 v: kernel Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: modesetting unloaded: fbdev,vesa gpu: i915 resolution: 1: 1920x1200~60Hz 2: 1920x1200~60Hz 3: 1920x1080~60Hz OpenGL: renderer: Mesa Intel Graphics (ADL GT2) v: 4.6 Mesa 22.2.5 free -h total used free shared buff/cache available Mem: 15Gi 8,1Gi 1,8Gi 2,1Gi 5,4Gi 4,6Gi Swap: 2,0Gi 92Mi 1,9Gi i also add ppa from oem-solutions to add camera support: sudo add-apt-repository ppa:oem-solutions-group/intel-ipu6 sudo apt update sudo apt install libcamhal-ipu6ep0
My problem started immediately after i closed the lid. You can solve this temporarily with killall csd-power for further investigation details run the following command and close the lid again: /usr/lib/x86_64-linux-gnu/cinnamon-settings-daemon/csd-power --verbose as the name suggest the problem belongs to the power setting. At the very end the problem was solved by simply activating: Perfom lid-closed action with external monitors attached in the Power Management setting
linux mint periodically freezing after closing lid
1,419,587,150,000
When my system freezes randomly it starts to slow down heavily and in the end it does not react anymore. I can provoke it pretty consistently, if I start Firefox alone (with many tabs open) and start playing a YouTube video. Switching workspaces may contribute. On the other hand, it also happened while I was only running VSCode. The higher the hardware usage, the higher the chance that it freezes. Sometimes I can get into a terminal with ctrl+alt+f1 just before that point. I would then run htop and look at the system utilization. Nothing special except for the M_SIZE (VIRT) which is always very high for both programs (higher than my ram capacity) but my ram usage is still not even at 60-70 %. I even increased my swap file, so it is less likely that ram is the cause of the issue. Using Mint's protocol viewer, I found out that every time it freezes, the following messages are saved: nouveau 0000:01:00.0: msvld: init failed, -19 nouveau 0000:01:00.0: msvld: unable to load firmware data nouveau 0000:01:00.0: Direct firmware load for nouveau/nva8_fuc084d failed with error -2 nouveau 0000:01:00.0: Direct firmware load for nouveau/nva8_fuc084 failed with error -2 So, I tried to install the proprietary nvidia-340 driver that was recommended by Mint's driver manager. It failed with a dpkg error, and the same happened after trying it with apt. I found this thread about Nvidia ending their support for this driver. Further down in the post, you can see that the current kernel version is 5.15.0-43, but I also tried installing the driver (using the driver manager from Mint) on version 5.4.0-122. After that, I tried to fix the nouveau driver. From this answer, I went to nouveau/VideoAcceleration documentation page and tried the commands under the firmware section. It froze again, so I reverted the changes. What can I do to stop it from freezing? In case you think it is an overheating issue, then I wonder why it would not unfreeze later on because the load reduces, and the CPU cooler gets quieter. System info and more: https://pastebin.com/HMTLfrD3 Edit: I verified that the freezing is not related to RAM/swap usage.
A/ Since you report an error related to firmware, the nvidia proprietary driver would surely not have that problem. However, the 340 version is the latest being compatible with your device and because 340 does not support kernel modsetting, it is not longer compatible with linux > 5.4 kernels. Moreover, because that driver version is not libglvnd compatible, it won't be compatible with xorg-server > 1.20.8, mesa > 20.0.8 and all related stuff not to say latest versions of many DEs. Therefore, either you get a backup from these days running <=5.4 linux kernel and xorg-server <= 1.20.8, restore it and stop upgrading from there, either you are ready to downgrade many things… in a totally unsupported way. (since corresponding software might no longer be available in your repository). B/ Either… you stick with nouveau, fighting the problem : From what you report, I understand that msvld init is failing because the kernel cannot find the firmware... while watching some youtube video. This is probably because : AND you required video acceleration AND your system cannot find the appropriate video codec. I then suggest that you retry after disabling video acceleration in Firefox. You might also well try if downloading the appropriate firmware (not redistributable for copyrights reasons) fixes the trouble. In order to proceed first check if your distribution gets the right package to install. If not then read the chapter about video acceleration in the freedesktop wiki. and apply the fallback, mainly : $ mkdir /tmp/nouveau $ cd /tmp/nouveau $ wget https://raw.github.com/envytools/firmware/master/extract_firmware.py $ wget http://us.download.nvidia.com/XFree86/Linux-x86/325.15/NVIDIA-Linux-x86-325.15.run $ sh NVIDIA-Linux-x86-325.15.run --extract-only $ python2 extract_firmware.py # this script is for python 2 only # mkdir /lib/firmware/nouveau # cp -d nv* vuc-* /lib/firmware/nouveau/ You might need to adapt taking into account your nouveau driver version.
Linux Mint 20.3 laptop freezes randomly because of nouveau driver
1,419,587,150,000
I used OpenSuse for several years now. One of the things I utmost liked with this distribution was the way Plasma/KDE issues where handled: from time to time it may happens that the panel briefly disappear and a messagebox opens-up telling me that Plasma desktop has crashed and has been restarted, also proposing to send debugging data to development teams if I like to. Now for a few months I've switched to a Fedora-based distribution (Qubes OS, based on Fedora 20). It seems that this distribution does not offer this behavior by default, since: I never saw this messagebox anymore, But I got my desktop completely freezed several times (screen and keyboard frozen, sound and mouse pointer OK), having to brutally shut-down my computer, crossing my finger that loosing all ongoing work will be the only side-effect of such a brutal shutdown. A dozen of years ago, when I was student, my University was also using Fedora for our hands-on exercices. At that time, facing similar freeze I found the solution to connect remotely through SSH and kill the desktop manager so it gets automatically restarted, unlocking the graphical environment. Sadly, due to the specific design of Qubes OS¹, this quick-and-dirty SSH solution will not work here. However, I guess that OpenSuse's messagebox tool may do a similar thing in a proper way: implement some kind of watch dog detecting when Plasma/KDE does not respond, then kill and restart it. So what I'm wondering is: is this tool a specific feature of OpenSUSE², or is there some package I should install or some configuration I should change to enable this behavior on my current installation? Desktop freezes are particularly frustrating, even-more when I know that the application themselves are most probably still working fine and that a simple restart of the Plasma process would just get everything back to normal... ¹: In Qubes OS the network connectivity is isolated in a Xen domain and KDE is in a networkless Dom0. For security reasons, Qubes OS is precisely designed to avoid reaching the user interface from the network... ²: By the past (if it's not still the case) OpenSUSE used to have an internally heavily modified KDE, allowing them to be the first distribution to propose a stable KDE4, so I fear that this tool is just a part of these sweets...
TL;DR: Here the problem was apparently caused by an issue (most probably some obscure race condition) between OpenGL and KWin. To workaround it, one must disable OpenGL and use XRender instead (in System configuration > Desktop effects > Advanced > Compositing type, select "XRender" instead of the default OpenGL). A few desktop effects will not be available anymore, but at least the system will be stable and not freeze anymore. Long story: The issue occurred every few weeks randomly, some times several times a day, some times two or three weeks with no issue, and was therefore quite difficult to analyze (BTW at some point I switched to another video card, switching from radeon to Intel i915 without any impact on the issue, therefore it is related neither to the graphic card nor its driver). I left a script running in the background and doing automatic checks every three minutes in an infinite loops so they could hopefully catch something when the desktop freeze. Indeed, the freeze can be programmatically detected through qdbus, and in particular this call fails if and only if the desktop is frozen: qdbus org.kde.Kwin /App org.freedesktop.DBus.Peer.Ping While normally it has no output and a return code of 0, when the desktop is frozen this command fails with a return code 2 and a "NoReply" error message. For information, I've also checked the status of org.kde.plasma-desktop, org.kde.kuiserver and org.kde.kded which all seem sane when a freeze occurs, therefore KWin seems the real culprit. I tried several ways to restore the desktop environment integrity with no luck. Trying to restart KWin cleanly using kquitapp kwin or kwin --replace didn't seem to have any noticeable effect. I tried to kill and rebuild the complete desktop environment as follow: kbuildsycoca4 kquitapp plasma-desktop kquitapp kwin kquitapp kuiserver sleep 2 killall plasma-desktop kwin kuiserver; sleep 2 killall -9 plasma-desktop kwin kuiserver; sleep 2 kstart kuiserver kstart kwin kstart plasma-desktop The desktop unfreezed itself! ... but only for one frame: the screen (as can be seen when looking at the clock in the taskbar) is updated and freezes immediately again. Nevertheless, having found the culprit, I've found an old "high, critical but won't fix because too obscure" issue here. Same symptoms, same diagnostic steps, and finally this suggested workaround: use XRender instead of OpenGL. It has been several months now since I applied this change and I encountered no freeze since then, so I think this workaround to be correct for this issue.
How to enable Plasma/KDE automatic restart upon freeze?
1,419,587,150,000
Vim and especially Gvim stops responding and utilizes 100% of CPU upon opening big .js files (1000+ lines). Pressing Ctrlc stops the process. Whatever Vim does trying to open the file, it displays the file contents—all folded into a single fold—and each character input in insert mode takes minutes to display on the screen. Then I have to restart Vim, to be able to edit the files. This does not occur everytime, even for the same files, but occurs 3-5 times a day. Using strace -p PID I see the following messages repeating continuously poll([{fd=7, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout) read(7, 0x7fffc4477280, 16) = -1 EAGAIN (Resource temporarily unavailable) recvfrom(6, 0x21848f4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=7, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout) read(7, 0x7fffc4477280, 16) = -1 EAGAIN (Resource temporarily unavailable) recvfrom(6, 0x21848f4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) poll([{fd=7, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout) read(7, 0x7fffc4477280, 16) = -1 EAGAIN (Resource temporarily unavailable) recvfrom(6, 0x21848f4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable) ... I've tried with vim --noplugin, yet the same problem occurs. I'm on a Ubuntu 12.04.1 x64 running self compiled Vim. vim :version gives the following info: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 15 2012 17:16:57) Included patches: 1-631 Huge version with GTK2 GUI. Features included (+) or not (-): +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg +path_extra -perl +persistent_undo +postscript +printer +profile +python -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/usr/local/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I /usr/include/libpng12 -I/usr/local/include -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -L. -rdynamic -Wl,-export-dynamic -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -ldl -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm -L/usr/lib Is there anything wrong with my setup? What may be the problem?
Try removing any extra plugins or syntax files you have for editing JS files. A poorly written vimscript or syntax file (basically a bunch of regexes) can make Vim eat all CPU cycles in a blink.
Vim high CPU usage upon opening JS files
1,419,587,150,000
So my parents offered my a Laptop, a quite good one judging by my other computers (for example my Desktop is still stuck on CDQ), and it is always sort of rude to return a gift in any situation, but it has serious trouble with drivers. The laptop is an Asus GL552V, which has fairly standard components: Intel 6700HQ APU Nvidia 960M Intel 7265 Wireless Atheros (or Realtek, not sure now) ethernet A Samsung SSD An HGST HDD Basically nothing fancy or from a brand known to have serious driver issues (such as Broadcom). The problem is that Skylake only has proper kernel support from 4.3 on (4.2 is experimental and had to be toggled), besides one or other little details like the touchpad not working (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1520519), and the fan being always at full speed. Im an Arch user, and simply thought "I'll have to use dev versions for a while, but it will work". Note that out-of-curiosity I booted several distributions, such as a daily Ubuntu 16.04 snapshot, but none booted, not even after disabling modeset on the nouveau driver and enabling skylake support. So I installed Arch with the default 4.2.5 kernel, bumblebee, mesa 11.1, and Nvidia blob (guess I had no choice). With i915.preliminary_hw_support=1 it works, not ideal but at least manages to boot. Tried to install both Gnome, KDE and XFCE. From GDM only Gnome on Wayland works, Gnome on Xorg or XFCE and the computer just frezes after logging in (cant even get past the GDM backgroud). SDDM already worked (it works no longer for some reason), and when it did, so did Plasma. LightDM doesn't work at all (just freezes the computer). Also any of the previous combinations eventually hangs even Wayland Gnome or Plasma. The logs say nothing, when the computer freezes it isn't some SW error, its probably with the HW. Kernel 4.3 from the testing repo just halts on boot, and the same goes for mainline 4.4rc6 (can't get past Triggering uevents) and have no idea on how to debug it. Yet there are more people with trouble booting newer kernels on this APU (https://bugzilla.kernel.org/show_bug.cgi?id=109081) I've read somewhere that most of my problems (GPU, Touchpad, maybe fan speed control) is fixed on 4.4, but being unable to boot it I can't even test. I'm undecided, I'll not leave such an expensive laptop on a corner till some day (maybe never) it has a solid support, but would prefer to avoid refunding it. What options do I have? What can I try? Where can I look for useful debug info? Right now I'm not really tied into any particular distro, anything that gives some hope is good.
The drivers start to appear in newer kernels. Here is the problem: https://bugzilla.kernel.org/show_bug.cgi?id=109081 In case anyone wants to buy this laptop to use with Linux, wait for that bug to be fixed before doing so. Answering to the question: It would be a good idea to return the laptop if you had the same situation. I'll keep it for at least a week or two to provide any information the developers need, after it if the problem gets solved (which I hope it will get) I'll keep the laptop.
Got a brand new laptop with hardware still unsupported. Should I wait or return it?
1,419,587,150,000
Since upgrading to 12.04, I've randomly experienced this strange phenomenon where my mouse mostly doesn't work and keyboard mostly does. I have not been able to identify a cause for this. Sometimes it will happen minutes after I start-up, other times after the computer has been idle for a while, and other times in the middle of working on something. It lasts until I reboot the computer or restart Gnome. The mouse won't be able to interact with any open windows, but if I do ALT+Tab, I can't keyboard nav through those, I can only click to change windows that way. Same if I press the Windows key; the keyboard remains focused in whatever window was just active but I can click things with my mouse to open new programs. Anyone else experienced this? What might be causing it? Is there a fix?
I have seen such behaviour with wireless mice with low battery... try another mouse? Failing USB mice can also behave erratically, in my experience.
Ubuntu 12.04 Gnome 3 "freezes" randomly - not a normal freeze though
1,419,587,150,000
I have a Dell Latitude 5500 and a Dell Latitude 7550. The 5500 has Debian 10 and KDE, and the 7550 has Ubuntu 20.04 with KDE. In both laptops, if I close the lid, when I open it later the built-in laptop keyboard is completely locked-up and I can't type anything. The trackpad still works though and I am able to click on "switch user". When I do this and get prompted to login again, the laptop keyboard starts working again on both laptops. I'm not sure if this is an issue, but I have an external 10-port USB hub plugged into the laptops. I have an external keyboard and mouse plugged into them. The external keyboard also locks up, but the external mouse also works. Why would closing the laptop lid cause the keyboard to lock up? Is there anything I can do to fix it? dmesg output: [Sat Jun 26 10:46:51 2021] usb 2-1.4: Disable of device-initiated U1 failed. [Sat Jun 26 10:46:51 2021] usb 2-1.4: Disable of device-initiated U2 failed. [Sat Jun 26 10:46:51 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd [Sat Jun 26 10:46:52 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd [Sat Jun 26 23:15:15 2021] usb 2-1.4: Disable of device-initiated U1 failed. [Sat Jun 26 23:15:15 2021] usb 2-1.4: Disable of device-initiated U2 failed. [Sat Jun 26 23:15:15 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd [Sat Jun 26 23:15:16 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd [Mon Jun 28 01:54:59 2021] usb 2-1.4: Disable of device-initiated U1 failed. [Mon Jun 28 01:54:59 2021] usb 2-1.4: Disable of device-initiated U2 failed. [Mon Jun 28 01:54:59 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd [Mon Jun 28 01:54:59 2021] usb 2-1.4: reset SuperSpeed Gen 1 USB device number 5 using xhci_hcd [Mon Jun 28 07:34:57 2021] usb 2-1: USB disconnect, device number 2 [Mon Jun 28 07:34:57 2021] usb 2-1.3: USB disconnect, device number 4 [Mon Jun 28 07:34:57 2021] usb 2-1.4: USB disconnect, device number 5 [Mon Jun 28 07:34:57 2021] usb 1-1: USB disconnect, device number 2 [Mon Jun 28 07:34:57 2021] usb 1-1.2: USB disconnect, device number 4 [Mon Jun 28 07:34:57 2021] usb 1-1.3: USB disconnect, device number 6 [Mon Jun 28 07:34:57 2021] usb 1-1.3.2: USB disconnect, device number 8 [Mon Jun 28 07:34:57 2021] usb 1-1.3.4: USB disconnect, device number 9 [Mon Jun 28 07:34:57 2021] usb 1-1.4: USB disconnect, device number 7 [Mon Jun 28 07:35:06 2021] usb 1-1: new high-speed USB device number 10 using xhci_hcd [Mon Jun 28 07:35:06 2021] usb 1-1: New USB device found, idVendor=2109, idProduct=2812, bcdDevice=85.80 [Mon Jun 28 07:35:06 2021] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [Mon Jun 28 07:35:06 2021] usb 1-1: Product: USB2.0 Hub [Mon Jun 28 07:35:06 2021] hub 1-1:1.0: USB hub found [Mon Jun 28 07:35:06 2021] hub 1-1:1.0: 4 ports detected [Mon Jun 28 07:35:06 2021] usb 2-1: new SuperSpeed Gen 1 USB device number 11 using xhci_hcd [Mon Jun 28 07:35:06 2021] usb 2-1: New USB device found, idVendor=2109, idProduct=0812, bcdDevice=85.81 [Mon Jun 28 07:35:06 2021] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [Mon Jun 28 07:35:06 2021] usb 2-1: Product: USB3.0 Hub [Mon Jun 28 07:35:06 2021] usb 2-1: Manufacturer: VIA Labs, Inc. [Mon Jun 28 07:35:06 2021] hub 2-1:1.0: USB hub found [Mon Jun 28 07:35:06 2021] hub 2-1:1.0: 4 ports detected [Mon Jun 28 07:35:06 2021] usb 1-1.2: new full-speed USB device number 11 using xhci_hcd [Mon Jun 28 07:35:07 2021] usb 2-1.3: new SuperSpeed Gen 1 USB device number 12 using xhci_hcd [Mon Jun 28 07:35:07 2021] usb 2-1.3: New USB device found, idVendor=2109, idProduct=0812, bcdDevice=85.81 [Mon Jun 28 07:35:07 2021] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [Mon Jun 28 07:35:07 2021] usb 2-1.3: Product: USB3.0 Hub [Mon Jun 28 07:35:07 2021] usb 2-1.3: Manufacturer: VIA Labs, Inc. [Mon Jun 28 07:35:07 2021] hub 2-1.3:1.0: USB hub found [Mon Jun 28 07:35:07 2021] hub 2-1.3:1.0: 4 ports detected [Mon Jun 28 07:35:07 2021] usb 1-1.2: New USB device found, idVendor=046d, idProduct=0a8f, bcdDevice= 0.12 [Mon Jun 28 07:35:07 2021] usb 1-1.2: New USB device strings: Mfr=3, Product=1, SerialNumber=0 [Mon Jun 28 07:35:07 2021] usb 1-1.2: Product: Logitech USB Headset [Mon Jun 28 07:35:07 2021] usb 1-1.2: Manufacturer: Logitech USB Headset [Mon Jun 28 07:35:07 2021] usb 2-1.4: new SuperSpeed Gen 1 USB device number 13 using xhci_hcd [Mon Jun 28 07:35:07 2021] usb 2-1.4: New USB device found, idVendor=2109, idProduct=0812, bcdDevice=85.81 [Mon Jun 28 07:35:07 2021] usb 2-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [Mon Jun 28 07:35:07 2021] usb 2-1.4: Product: USB3.0 Hub [Mon Jun 28 07:35:07 2021] usb 2-1.4: Manufacturer: VIA Labs, Inc. [Mon Jun 28 07:35:07 2021] hub 2-1.4:1.0: USB hub found [Mon Jun 28 07:35:07 2021] hub 2-1.4:1.0: 4 ports detected [Mon Jun 28 07:35:08 2021] input: Logitech USB Headset Logitech USB Headset as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.2/1-1.2:1.3/0003:046D:0A8F.0007/input/input34 [Mon Jun 28 07:35:08 2021] hid-generic 0003:046D:0A8F.0007: input,hidraw1: USB HID v1.11 Device [Logitech USB Headset Logitech USB Headset] on usb-0000:00:14.0-1.2/input3 [Mon Jun 28 07:35:08 2021] usb 1-1.3: new high-speed USB device number 12 using xhci_hcd [Mon Jun 28 07:35:08 2021] usb 1-1.3: New USB device found, idVendor=2109, idProduct=2812, bcdDevice=85.80 [Mon Jun 28 07:35:08 2021] usb 1-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [Mon Jun 28 07:35:08 2021] usb 1-1.3: Product: USB2.0 Hub [Mon Jun 28 07:35:08 2021] hub 1-1.3:1.0: USB hub found [Mon Jun 28 07:35:08 2021] hub 1-1.3:1.0: 4 ports detected [Mon Jun 28 07:35:08 2021] usb 1-1.4: new high-speed USB device number 13 using xhci_hcd [Mon Jun 28 07:35:08 2021] usb 1-1.4: New USB device found, idVendor=2109, idProduct=2812, bcdDevice=85.80 [Mon Jun 28 07:35:08 2021] usb 1-1.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [Mon Jun 28 07:35:08 2021] usb 1-1.4: Product: USB2.0 Hub [Mon Jun 28 07:35:08 2021] hub 1-1.4:1.0: USB hub found [Mon Jun 28 07:35:08 2021] hub 1-1.4:1.0: 4 ports detected [Mon Jun 28 07:35:08 2021] usb 1-1.3.2: new low-speed USB device number 14 using xhci_hcd [Mon Jun 28 07:35:09 2021] usb 1-1.3.2: New USB device found, idVendor=046d, idProduct=c00e, bcdDevice=11.10 [Mon Jun 28 07:35:09 2021] usb 1-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [Mon Jun 28 07:35:09 2021] usb 1-1.3.2: Product: USB-PS/2 Optical Mouse [Mon Jun 28 07:35:09 2021] usb 1-1.3.2: Manufacturer: Logitech [Mon Jun 28 07:35:09 2021] input: Logitech USB-PS/2 Optical Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.2/1-1.3.2:1.0/0003:046D:C00E.0008/input/input35 [Mon Jun 28 07:35:09 2021] hid-generic 0003:046D:C00E.0008: input,hidraw2: USB HID v1.10 Mouse [Logitech USB-PS/2 Optical Mouse] on usb-0000:00:14.0-1.3.2/input0 [Mon Jun 28 07:35:09 2021] usb 1-1.3.4: new low-speed USB device number 15 using xhci_hcd [Mon Jun 28 07:35:09 2021] usb 1-1.3.4: New USB device found, idVendor=046d, idProduct=c31c, bcdDevice=64.02 [Mon Jun 28 07:35:09 2021] usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [Mon Jun 28 07:35:09 2021] usb 1-1.3.4: Product: USB Keyboard [Mon Jun 28 07:35:09 2021] usb 1-1.3.4: Manufacturer: Logitech [Mon Jun 28 07:35:09 2021] input: Logitech USB Keyboard as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.0/0003:046D:C31C.0009/input/input36 [Mon Jun 28 07:35:09 2021] hid-generic 0003:046D:C31C.0009: input,hidraw3: USB HID v1.10 Keyboard [Logitech USB Keyboard] on usb-0000:00:14.0-1.3.4/input0 [Mon Jun 28 07:35:09 2021] input: Logitech USB Keyboard Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.1/0003:046D:C31C.000A/input/input37 [Mon Jun 28 07:35:09 2021] input: Logitech USB Keyboard System Control as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.3/1-1.3.4/1-1.3.4:1.1/0003:046D:C31C.000A/input/input38 [Mon Jun 28 07:35:09 2021] hid-generic 0003:046D:C31C.000A: input,hiddev0,hidraw4: USB HID v1.10 Device [Logitech USB Keyboard] on usb-0000:00:14.0-1.3.4/input1 [Mon Jun 28 07:35:25 2021] kscreen_backend[162047]: segfault at 10 ip 00007fdb6825df6b sp 00007ffd034223b0 error 4 in KSC_XRandR.so[7fdb68246000+1b000] [Mon Jun 28 07:35:25 2021] Code: 73 1c e8 58 97 fe ff 49 8b 3c 24 48 8d 73 14 e8 eb 96 fe ff 49 8b 3c 24 48 8d 73 24 e8 2e 93 fe ff e8 e9 b9 fe ff 49 8b 3c 24 <0f> b7 70 10 48 89 c5 e8 d9 92 fe ff 48 89 ef e8 e1 8f fe ff 4c 89 Output of grep "GRUB_CMDLINE_LINUX_DEFAULT=" /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Alright, so. In a terminal, open /etc/default/grub. Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT=. Replace it with GRUB_CMDLINE_LINUX_DEFAULT="atkbd.reset i8042.reset i8042.nomux quiet splash". Save and exit the file. Run sudo update-grub. If this doesn't work, follow the same process but try GRUB_CMDLINE_LINUX_DEFAULT="i8042.direct i8042.dumbkbd" instead.
laptop keyboard locks up after closing lid
1,419,587,150,000
My new laptop is randomly freezing. This freezing occurs rarely - every dozen days. However once happened just after previous. The problem is that I cannot find what causes this freeze. I use this laptop for work so stability is very important. During freeze there is noise sound from speakers (duration about one second) and malformed screen: What I have checked: system logs (/var/log/) - nothing found memory test - OK different desktop environment test - Cinnamon and KDE - both freeze different graphic drivers - nvidia-367 and nvidia-375 - both freeze added processor.max_cstate=1 intel_idle.max_cstate=0 in grub - it seemed to fix problem but after dosen days the freeze occured again (befor this modyfication freezing was occuring every few days or more often) I have suspicion that problem is somehow related to using firefox, but still the program should not hang whole system. inxi -F: System: Kernel: 4.4.0-21-generic x86_64 (64 bit) Desktop: KDE Plasma 5.8.5 Distro: Linux Mint 18 Sarah Machine: System: LENOVO (portable) product: 80RU v: Lenovo ideapad 700-15ISK Mobo: LENOVO model: Lenovo ideapad 700-15ISK v: NO DPK Bios: LENOVO v: E5CN52WW date: 04/28/2016 CPU: Quad core Intel Core i7-6700HQ (-HT-MCP-) cache: 6144 KB clock speeds: max: 3500 MHz 1: 805 MHz 2: 805 MHz 3: 811 MHz 4: 841 MHz 5: 850 MHz 6: 2369 MHz 7: 822 MHz 8: 820 MHz Graphics: Card-1: Intel Skylake Integrated Graphics Card-2: NVIDIA GM107M [GeForce GTX 950M] Display Server: X.Org 1.18.3 driver: nvidia Resolution: [email protected] GLX Renderer: GeForce GTX 950M/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 375.26 Audio: Card Intel Sunrise Point-H HD Audio driver: snd_hda_intel Sound: ALSA v: k4.4.0-21-generic Network: Card-1: Intel Intel Dual Band Wireless-AC 3165 Plus Bluetooth driver: iwlwifi IF: wlp2s0 state: up mac: ---------------- Card-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169 IF: enp3s0 state: down mac: ---------------- Drives: HDD Total Size: 2240.5GB (41.1% used) ID-1: /dev/sda model: ADATA_SP550NS38 size: 240.1GB ID-2: /dev/sdb model: ST2000LM003_HN size: 2000.4GB Partition: ID-1: / size: 202G used: 136G (71%) fs: ext4 dev: /dev/sda1 ID-2: swap-1 size: 20.06GB used: 0.00GB (0%) fs: swap dev: /dev/sda5 RAID: No RAID devices: /proc/mdstat, md_mod kernel module present Sensors: System Temperatures: cpu: 39.0C mobo: 37.0C gpu: 37C Fan Speeds (in rpm): cpu: N/A Info: Processes: 268 Uptime: 1 day Memory: 2898.7/15842.4MB Client: Shell (bash) inxi: 2.2.35 What more should I check? Where is the problem? Is it related to Linux Mint distribution? Is it hardware problem? EDIT: The freezing occurs also on Windows 10 - during installation (if I leave laptop for a few minutes without touching mouse or keyboard) and after installation (without system updates). After freezing screen is malformed as on Linux. I have updated bios to E5CN56WW version - still problem occurs. After installation 4.9 Kernel there is no network on my Mint and other problems occur so I could not test this Kernel.
It came out that there was problem with ram memory and ssd drive. Both exchanged to new one under warranty and problem is solved. No freeze for three weeks with no processor flags set. BTW there is another issue with graphic but I am going to describe it in another thread.
Lenovo Ideapad running Mint random freeze [closed]
1,419,587,150,000
My system was working fine but after the changes in past two days I started getting this problem. ​ The Changes I made: I added a 2GB 800mgz RAM stick and replaced my old HDD with a new SSD two days ago and installed Linux on it. And yesterday there was a kernel update in the update manager. ​ How problem started occurring: After the update and 3 or 4 reboots, when I was installing wine through terminal system freezed and I had to do hard reboot, then again when wine was installed I was installing Docky from Ubuntu 18.04's repository it again freezed. ​ The third and fourth time it freezed right after booting up when I launched firefox. ​ Fifth time it happened again while editing a post on linuxmint forum. ​ After some googled suggestions I did a smartctl. So can you tell me weather it's a system error or the SSD's broken. ​ Here are smartctl's results in the given : link ​ I also did a check for bad sectors in the SSD on which the system is installed. ​ So are the problems due to SSD or the kernel or something else is wrong? Here are it's results: ​ $ sudo fdisk -l [sudo] password for mihir: Disk /dev/sda: 223.58 GiB, 240057409536 bytes, 468862128 sectors Disk model: WDC WDS240G2G0A- Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x662c6f2a Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 1050623 1048576 512M b W95 FAT32 /dev/sda2 1052670 468860927 467808258 223.1G 5 Extended /dev/sda5 1052672 468860927 467808256 223.1G 83 Linux Disk /dev/sdb: 465.78 GiB, 500107862016 bytes, 976773168 sectors Disk model: ST500LT012-9WS14 Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb540dc3c Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 976771071 976769024 465.8G 83 Linux ​ $ sudo badblocks -v /dev/sda1 > badsectors.txt Checking blocks 0 to 524287 Checking for bad blocks (read-only test): done Pass completed, 0 bad blocks found. (0/0/0 errors) ​ $ sudo badblocks -v /dev/sda2 > badsectors.txt Checking blocks 0 to 0 Checking for bad blocks (read-only test): done Pass completed, 0 bad blocks found. (0/0/0 errors) ​ sudo badblocks -v /dev/sda5 > badsectors.txt Checking blocks 0 to 233904127 Checking for bad blocks (read-only test): done Pass completed, 0 bad blocks found. (0/0/0 errors)
I got the solution, I was missing some important details, while booting into Mint a small error message flashed some times for 1-2 seconds saying mce: hardware error cpu 0 machine check 0 bank 0. This can happen due to some reasons: CPU Overheating or a permanent CPU damage. VRAM/RAM Error. In my case it was because I placed RAMs of different frequencies, I wanted to upgrade my RAM and didn't knew of what frequency of RAM was pre-installed. I placed the new RAM of 800mgz in the second slot ad after some days I started getting this problem. Other reason could be that the old RAM stick was damaged. So try replacing one or more RAM sticks. I removed the old RAM stick and replaced it with another 800mgz one, now the system runs fine. Hoped this answer helped, because there is very less info present about thsi topic on the internet.
mce: hardware error cpu 0 machine check 0 bank 0. System just freezes, everything just stops including mouse on Linux Mint XFCE 20
1,419,587,150,000
I bought a brand new laptop and tried installing Ubuntu 20.04 on it (via bootable usb), however I experience frequent issues which render the system unusable, ie: everything freezes (including mouse cursor, ctrl+alt+f1 combination doesn't work), followed by reboot after about 10s laptop suddenly reboots various things keep crashing (gnome-terminal-server, gnome-session, etc.) The issues happen at random times, first two even during the OS installation. Sometimes immediately after the system starts, sometimes after a few minutes. I spent a few days trying to approach the problem from different angles without any success, and would really appreciate some advice on what avenues are worth further exploration and how. If it is likely a hardware issue it would be great to have a way to somehow prove it. The facts: Some occurrences seem to correlate with "Hardware Error" entry in syslog (although I found some very similar entries which didn't seem to trigger the issue). Oct 9 14:38:36 test-Lenovo-Legion-5-15IMH05H kernel: [ 629.400829] mce: [Hardware Error]: Machine check events logged Oct 9 14:38:36 test-Lenovo-Legion-5-15IMH05H rasdaemon[726]: rasdaemon: register inserted at db Oct 9 14:38:36 test-Lenovo-Legion-5-15IMH05H rasdaemon[726]: <...>-2740 [004] 0.000063: mce_record: 2020-10-09 14:38:37 +0200 bank=2, status= c000014000010019, Generic TLB Level-1 Error, mci=Error_overflow Corrected_error, mca=Generic TLB Level-1 Error, cpu_type= Intel generic architectural MCA, cpu= 4, socketid= 0, mcgstatus=0, mcgcap= c0c, apicid= 8 In order to have some indication whether it can be a hardware issue I installed a Windows 10 Home on the laptop. Installation succeeded, OS spent a few hours downloading and installing updates, and generally seemed fine. In order to ensure that it works under stress I used Windows for a few hours, including playing Witcher 3 for about half an hour without any problems. Some of my attemps to diagnose/fix the issue: Disclaimer: my understanding of Linux is limited, in my attempts I followed some tutorials/guides, but I might have as well made some silly mistakes which render my conclusions wrong I tried to install the other kernels (5.8.14 and 5.9-rc8) by downloading the deb files, running dpkg -i linux*.deb and choosing the other kernel in boot menu; installation succeeded but didn't help I tried to install Manjaro Gnome (kernel 5.6) without success (it froze during installation, then it just didn't boot so I gave up) I did some experiments when I tried to install Ubuntu without propertiary GPU drivers, and then manually install Nvidia "Long Lived" drivers (v450) or "Short Lived" drivers (v455); in both cases installation completed, but it didn't seem helpful I tried Ubuntu 20.10 which had exactly same issues I tried various combinations of Linux kernels and NVidia drivers, including the latests ones on arch-linux Some resources suggested power related problem. The only thing that came to my mind was to try using laptop without DC adapter attached, but I still experienced freezes/reboots. The logs Here's the output of inxi -F && dmesg | grep -i error on minimal 20.04 with "Install propertiary drivers" enabled during installation. System: Host: test-Lenovo-Legion-5-15IMH05H Kernel: 5.4.0-48-generic x86_64 bits: 64 Desktop: Gnome 3.36.4 Distro: Ubuntu 20.04.1 LTS (Focal Fossa) Machine: Type: Laptop System: LENOVO product: 81Y6 v: Lenovo Legion 5 15IMH05H serial: <superuser/root required> Mobo: LENOVO model: LNVNB161216 v: NO DPK serial: <superuser/root required> UEFI: LENOVO v: EFCN32WW date: 05/11/2020 Battery: ID-1: BAT0 charge: 61.4 Wh condition: 63.3/60.0 Wh (105%) CPU: Topology: 6-Core model: Intel Core i7-10750H bits: 64 type: MT MCP L2 cache: 12.0 MiB Speed: 800 MHz min/max: 800/5000 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800 Graphics: Device-1: Intel UHD Graphics driver: i915 v: kernel Device-2: NVIDIA TU106 [GeForce RTX 2060] driver: nvidia v: 450.66 Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia unloaded: fbdev,nouveau,vesa resolution: 1920x1080~144Hz OpenGL: renderer: GeForce RTX 2060/PCIe/SSE2 v: 4.6.0 NVIDIA 450.66 Audio: Device-1: Intel Comet Lake PCH cAVS driver: snd_hda_intel Device-2: NVIDIA TU106 High Definition Audio driver: snd_hda_intel Sound Server: ALSA v: k5.4.0-48-generic Network: Device-1: Intel Wi-Fi 6 AX201 driver: iwlwifi IF: wlp0s20f3 state: up mac: <REDACTED> Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 IF: enp8s0 state: down mac: <REDACTED> Drives: Local Storage: total: 476.94 GiB used: 8.08 GiB (1.7%) ID-1: /dev/nvme0n1 vendor: Western Digital model: PC SN730 SDBQNTY-512G-1001 size: 476.94 GiB ID-2: /dev/nvme1n1 vendor: SK Hynix model: HFM512GDHTNI-87A0B size: 476.94 GiB Partition: ID-1: / size: 468.00 GiB used: 8.01 GiB (1.7%) fs: ext4 dev: /dev/nvme0n1p2 Sensors: System Temperatures: cpu: 41.0 C mobo: N/A gpu: nvidia temp: 39 C Fan Speeds (RPM): N/A Info: Processes: 322 Uptime: 2m Memory: 31.23 GiB used: 1.32 GiB (4.2%) Shell: bash inxi: 3.0.38 [ 0.012647] [Firmware Bug]: TSC ADJUST differs within socket(s), fixing all errors [ 0.362528] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.I2C2.TPD0], AE_NOT_FOUND (20190816/dswload2-162) [ 0.362528] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20190816/psobject-220) [ 0.362528] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.I2C3.TPL1], AE_NOT_FOUND (20190816/dswload2-162) [ 0.362528] ACPI Error: AE_NOT_FOUND, During name lookup/catalog (20190816/psobject-220) [ 0.925916] RAS: Correctable Errors collector initialized. [ 6.754956] usb 1-6: device descriptor read/64, error -71 [ 8.093725] EXT4-fs (nvme0n1p2): re-mounted. Opts: errors=remount-ro [ 8.399155] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-50.ucode failed with error -2 [ 8.399445] iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-49.ucode failed with error -2 [ 9.295155] nvidia-gpu 0000:01:00.3: i2c timeout error e0000000 [ 9.295162] ucsi_ccg: probe of 0-0008 failed with error -110 Thank you in advance
TL;DR I came to the conclusion that it's likely a hardware issue and decided to return the laptop. Full story: After some investigation I got an impression that the problem was related to the Nvidia GPU, as when I was using Intel it wasn't happening for a day or two. A friend advised me to update BIOS; after doing that and updating NVidia drivers, everything worked fine for a few days, with only one odd restart and a few Gnome crashes at some point I allowed the system to install system updates, and the issue started happening more often again, on both NVidia and Intel GPUs; for the record on that update Nvidia driver was bumped from 450.66.XX to 450.80.02, but I wasn't sure anymore if it's related to the issue I noticed that the MCE error most of the time correlated with the reboots, happened very often and always on CPU 4; I assumed that it was most likely what makes the laptop unusable and started the return process.
Frequent freezes and reboots on Lenovo Legion 5i RTX2060
1,419,587,150,000
I'm not so new to Linux in general, but I am new to Arch. I've installed it twice (the first time on an HDD, just to try while waiting for the SSD to be delivered to me, the second time, a few days after, on the SSD), with i3 and other programs in order to have a usable desktop environment. By the way, my choices were based on the match between my taste (Vim-addicted) and pure readings of the official Arch wiki pages. At the moment there's one thing that is annoying me tremendously: when I open Spotify (installed from AUR, trough aurman -S) or Qutebrowser (official, through sudo pacman -S) and, possibly, other applications, either from the terminal urxvt or through rofi, I experience a complete "freeze" of the keyboard which lasts for as long as fifty seconds (!), while the mouse still interacts perfectly with the environment. For instance, I can do this funny thing: Open Spotify, then Keep doing anything on the keyboard with the left hand, e.g. keep pressing 1 and 2 alternatively and frenetically with a finger while holding down $mod, which is Alt in my case, with the thumb, or randomly press letter keys while in a text box in the browser or in the innocent terminal or, just to be clear about what I've tried, pressing my angry cat on the whole keyboard In the meanwhile, use the right hand to successfully move from one workspace to another with the mouse (using the numbered icons in the bottom-left part of the screen), and interact with any mouse-interactive stuff (next song, raise volume, change audio output in pavucontrol, ...). Obviously, should I move to a workspace with a full-screened program, I would be stuck in that workspace until those long fifty (more or less) seconds pass by. The keyboard starts working again and it is as I never pressed those keys (e.g. if I was pressing letters while in the terminal, those "past" letters do not appear). The keyboard is a wireless Logitech K270 (with the wireless M185 mouse from the same box) with a USB receiver, but I honestly don't know what other details I could provide, so please ask me. (I don't really think that the filesystem could play any role in the matter but, should I be wrong, it's btrfs.) My motherboard is a X399 Aorus Gaming 7, and has 1 x white USB 3.1 Gen 1 Port (from the user's manual, while it's labeled as USB 3.0 BIOS on the I/O shield, since it's the Q-Flash port aimed at flashing the BIOS) 5 x blue USB 3.1 Gen 1 Ports (from the user's manual, while they're labeled as USB 3.0 on the I/O shield) 2 x yellow USB 3.1 Gen 1 Ports (from the user's manual, while it's labeled as USB 3.0 DAC-UP on the I/O shield) 1 x red USB 3.1 Gen 2 Type-A Port (from the user's manual, while it's labeled as USB 3.1 on the I/O shield) The 9 ports are disposed in couples as in (letters = colors) YY WB BB BB R
I'm posting this self-answer since it represented a solution for me, so far, and could help someone else who is looking for answers without paying enough attention to the question, but I'll wait for some guru to give an explanation to this strange problem. After having connected a wired PS/2 port keyboard and verified it's not affected by this problem, I tried moving the receiver from lower-left-most blue USB port to the red one. This worked. Then I checked the keyboard package for some info about USB, but not even a dotten number like 2.0, 3.0, or whatever was on there, so I just kept trying. The white port, then the yellow ones, and other blue ports. The keyboard works perfectly with every single USB port except that one, the first I tried.
keyboard freezes after opening program, mouse keeps working
1,419,587,150,000
Situation: I am using Linux Mint 18.2 Cinammon 64bit with Virtualbox installed. Within Virtualbox, I have a single virtual machine (VM) - Windows 7 64bit - with four snapshots (each a uniquely configured environment for a specific purpose, eg.photoshop, software testing). For a half of year everything was running perfectly. Yesterday, I booted the PC after two days of down time, and every time I start any VM snapshot, both Virtualbox and the host system (Linux Mint) absolutely freeze (ie. the mouse and keyboard are unresponsive). I've since reinstalled Virtualbox, and have checked that my Linux system has all updates installed. Question: in your opinion, what steps should be taken (basic or more advanced), to investigate such a fault and to determine the cause(-s)? Which logs to check first, what tool to use for diagnosis? Update For those, who have same problem. I was installing Virtualbox using Linux Mint Software Manager. Software Manager installs VirtualBox v5.0, which is outdated. After downloading directly from virtualbox website and installing latest Virtualbox (v5.2), described problem dissapeared.
I had a similar problem once, the graphics card was too weak and therefore the screen froze. If I pressed CTRL-ALT-F3 I could still access my terminal very slowly. Here are my thoughts: Check if ram maxes and swap is used extensively when VM starts e.g. using top or htop and checking the ram and swap bars Check iotop if the process maxes out and stops user inputs from being processed Check the GPU usage and it's memory usage e.g. radeontop or the appropriate one for your gpu Try restricting CPU usage to 80 % for a start -> in VM settings you can set this in processor settings Check your RAM (especially) and whole system (memtest and mprime/prime95 are my choices for this) Edit: inserted commands
How to diagnose, why Linux Mint host freezes after starting Virtualbox VM
1,419,587,150,000
I have just installed Debian Stable with gnome 3 on my msi laptop MSI GS 60 2PC-247XFR, when I shut down or quit session the system just freezes, here is a quote from my syslog file: Sep 26 17:44:21 debian gnome-session[1175]: nm-applet-Message: PID 1 (we are 1361) sent signal 15, shutting down... Sep 26 17:44:21 debian org.gnome.evolution.dataserver.Sources3[1216]: (evolution-source-registry:1348): GLib-GIO-CRITICAL **: g_dbus_interface_skeleton_unexport: assertion 'interface_->priv->connections != NULL' failed Sep 26 17:44:21 debian org.gnome.evolution.dataserver.Sources3[1216]: g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting. Sep 26 17:44:21 debian gnome-session[1175]: Received signal:15->'Complété' Sep 26 17:44:21 debian gnome-session[1175]: Received signal:15->'Complété' Sep 26 17:44:21 debian org.gnome.evolution.dataserver.Calendar4[1216]: g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting. Sep 26 17:44:21 debian gnome-session[1175]: Received signal:15->'Complété' Sep 26 17:44:21 debian org.freedesktop.Tracker1[1216]: Received signal:15->'Complété' Sep 26 17:44:21 debian org.gnome.zeitgeist.Engine[1216]: g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting. Sep 26 17:44:21 debian org.gnome.zeitgeist.Engine[1216]: #033[31m[15:44:21.080633 WARNING]#033[0m zeitgeist-daemon.vala:449: The connection is closed Sep 26 17:44:21 debian org.gnome.zeitgeist.SimpleIndexer[1216]: g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting. Sep 26 17:44:21 debian org.gnome.zeitgeist.SimpleIndexer[1216]: ** (zeitgeist-fts:1418): WARNING **: zeitgeist-fts.vala:252: The connection is closed Sep 26 17:44:21 debian bluetoothd[579]: Terminating Sep 26 17:44:21 debian ModemManager[581]: <info> Caught signal, shutting down... Sep 26 17:44:21 debian NetworkManager[584]: <info> caught signal 15, shutting down normally. Sep 26 17:44:21 debian kernel: [ 938.756284] wlan0: deauthenticating from 2a:a4:3c:bb:bc:36 by local choice (Reason: 3=DEAUTH_LEAVING) Sep 26 17:44:21 debian wpa_supplicant[686]: wlan0: CTRL-EVENT-DISCONNECTED bssid=2a:a4:3c:bb:bc:36 reason=3 locally_generated=1 Sep 26 17:44:21 debian rsyslogd: [origin software="rsyslogd" swVersion="8.4.2" x-pid="622" x-info="http://www.rsyslog.com"] exiting on signal 15. I don't understand very much from this message, would someone have an idea what the problem is ? EDIT: I have waited I while after the freeze instead of forcing to shut down, this message appeared: Then it shutted down.. I could'nt find any trace of this message on my logs neither in kern.log or syslog
I have fixed the problem by changing "Primary Display" from nvidia to intel in my BIOS, no more freeze I also noticed that "lspci -nn | grep VGA" does not detect my gtx860m neither "nvidia-detect", I'll open a new question later for that... it may be related.. EDIT: Now I fixed all my problems with nvidia, freeze etc.. --> It appears that the problem was coming from Nvidia Optimus, so I installed bumblebee (https://wiki.debian.org/Bumblebee), switch back "Primary Display" to nvidia. The only bad thing is every time I need to use my graphic card for a runnable, I need to run it by typing "optirun" or "primusrun" ... And FYI, if your system won't boot after nvidia driver installation (because you have nvidia optimus or something else went wrong...), go to recovery mode type apt-get purge nvidia-* then rename xorg.conf file. (no need to reinstall debian like I did) If you still want to use graphic card install bumblebee by following instructions from the wiki link above
newly installed debian gnome 3 hangs at shut down
1,419,587,150,000
I have two accounts, daniel and dn. When I log in with daniel first, everything is okay. But I can't login with dn, it freezes. It's irrelevant if I log out daniel or try a parallel login. It's the same way round with the account daniel if I log in dn first. The desktop is shown, without any folders and I can't move the mouse. Some information about the system: 64 bit dual boot Mint 16 MATE / windows 8 Both Systems on the same SSD / Secondary HDD Error message from syslog Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO rtkit-daemon[1843]: Successfully made thread 2507 of process 2507 (n/a) owned by '1001' high priority at nice level -11. Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO rtkit-daemon[1843]: Supervising 7 threads of 3 processes of 2 users. Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.630773] BUG: unable to handle kernel NULL pointer dereference at (null) Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.630827] IP: [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.630891] PGD 0 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.630905] Oops: 0000 [#1] SMP Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.630927] Modules linked in: pci_stub vboxpci(OF) vboxnetadp(OF) vboxnetflt(OF) vboxdrv(OF) joydev(F) x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel(F) parport_pc(F) ppdev(F) kvm(F) crct10dif_pclmul(F) crc32_pclmul(F) ghash_clmulni_intel(F) cryptd(F) bnep rfcomm dm_multipath(F) scsi_dh(F) uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core videodev btusb arc4(F) bluetooth iwldvm mac80211 microcode(F) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep(F) snd_pcm(F) psmouse(F) serio_raw(F) snd_page_alloc(F) snd_seq_midi(F) snd_seq_midi_event(F) iwlwifi snd_rawmidi(F) snd_seq(F) snd_seq_device(F) snd_timer(F) cfg80211 lpc_ich snd(F) mei_me mei soundcore(F) fujitsu_laptop mac_hid lp(F) parport(F) dm_mirror(F) dm_region_hash(F) dm_log(F) hid_generic usbhid hid nouveau i915 mxm_wmi wmi i2c_algo_bit ttm drm_kms_helper drm r8169 ahci(F) libahci(F) mii(F) video(F) Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631442] CPU: 3 PID: 2281 Comm: Xorg Tainted: GF O 3.11.0-12-generic #19-Ubuntu Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631489] Hardware name: FUJITSU LIFEBOOK AH531/GFO/FJNBB10, BIOS 1.16 06/21/2011 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631534] task: ffff8801fcacddc0 ti: ffff880230c4e000 task.ti: ffff880230c4e000 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631578] RIP: 0010:[<ffffffffa01e0eb6>] [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631649] RSP: 0018:ffff880230c4f5f0 EFLAGS: 00010206 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631679] RAX: 0000000000000000 RBX: 0000000000000005 RCX: 0000000500000000 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631718] RDX: 000000000000041f RSI: 0000000000000003 RDI: ffff88022dc84e80 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631758] RBP: ffff880230c4f640 R08: 0000000000000420 R09: 0000000000000000 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631799] R10: 0000000000000000 R11: 0000000000008000 R12: 0000000000001db0 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631833] R13: ffff88022ec75240 R14: ffff88022dc84e80 R15: 0000000000000000 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631870] FS: 00007f065be1d980(0000) GS:ffff88023fac0000(0000) knlGS:0000000000000000 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631917] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631951] CR2: 0000000000000000 CR3: 000000022f4d7000 CR4: 00000000000407e0 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.631990] Stack: Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632002] ffff88020e237940 00001db40e237940 0000000000002100 0000000000000000 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632048] 0000000500000000 0000000000000420 ffff88022e913d00 ffff88022ec75240 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632091] ffff88020e237940 ffff88020e237900 ffff880230c4f698 ffffffffa01dedcc Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632136] Call Trace: Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632173] [<ffffffffa01dedcc>] nouveau_vm_map_sg+0xdc/0x150 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632235] [<ffffffffa021ab81>] nouveau_vma_getmap.isra.14+0x61/0x90 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632295] [<ffffffffa021ac2a>] nouveau_bo_move_m2mf.isra.15+0x7a/0x130 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632351] [<ffffffffa021b530>] nouveau_bo_move+0xa0/0x430 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632391] [<ffffffffa008ee9d>] ttm_bo_handle_move_mem+0x24d/0x5c0 [ttm] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632432] [<ffffffffa008f8d9>] ? ttm_bo_mem_space+0x179/0x360 [ttm] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632475] [<ffffffffa008fecf>] ttm_bo_move_buffer+0x11f/0x140 [ttm] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632517] [<ffffffff810bf944>] ? tick_program_event+0x24/0x30 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632558] [<ffffffffa008ff7a>] ttm_bo_validate+0x8a/0x100 [ttm] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632612] [<ffffffffa021bf3a>] nouveau_bo_pin+0xda/0x170 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632667] [<ffffffffa023e42c>] nv50_crtc_swap_fbs.isra.12+0x2c/0xd0 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632725] [<ffffffffa021c27c>] ? nouveau_bo_rd32+0x2c/0x30 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632782] [<ffffffffa0240481>] nv50_crtc_mode_set+0x121/0x3f0 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632826] [<ffffffffa010f02c>] drm_crtc_helper_set_mode+0x27c/0x450 [drm_kms_helper] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632877] [<ffffffffa011067e>] drm_crtc_helper_set_config+0x99e/0xaf0 [drm_kms_helper] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.632936] [<ffffffffa0052f8d>] drm_mode_set_config_internal+0x5d/0xe0 [drm] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.634614] [<ffffffffa00559c7>] drm_mode_setcrtc+0xf7/0x650 [drm] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.636343] [<ffffffffa0226db0>] ? nouveau_user_framebuffer_create+0x60/0xb0 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.638033] [<ffffffff816e8902>] ? mutex_lock+0x12/0x2f Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.639735] [<ffffffffa0046212>] drm_ioctl+0x532/0x660 [drm] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.641378] [<ffffffff811b8ba5>] do_vfs_ioctl+0x2e5/0x4d0 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.643044] [<ffffffff811a91f1>] ? __sb_end_write+0x31/0x60 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.644726] [<ffffffff811a6d82>] ? vfs_write+0x172/0x1e0 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.646494] [<ffffffff811b8e11>] SyS_ioctl+0x81/0xa0 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.648122] [<ffffffff816f521d>] system_call_fastpath+0x1a/0x1f Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.649646] Code: 45 d0 48 8d 04 d5 08 00 00 00 48 89 45 c0 41 8d 44 24 04 89 45 bc eb 0c 0f 1f 44 00 00 48 8b 45 b0 8b 70 30 48 8b 45 c8 4c 89 f7 <4a> 8b 14 38 48 c1 ea 08 49 89 d5 48 83 ca 03 49 83 cd 01 83 e6 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.652856] RIP [<ffffffffa01e0eb6>] nvc0_vm_map_sg+0x96/0x100 [nouveau] Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.654394] RSP <ffff880230c4f5f0> Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.655842] CR2: 0000000000000000 Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO pulseaudio[2507]: [pulseaudio] pid.c: Daemon already running. Feb 9 23:55:15 daniel-LIFEBOOK-AH531-GFO kernel: [ 74.666275] ---[ end trace fae09bf583a1a106 ]--- xorg.20.log (what does resizing framebuffer to 2390x768 mean? It's not my screen resolution): [ 74.441] reporting 5 6 34 244 [ 74.461] reporting 5 6 34 244 [ 74.467] reporting 5 6 34 244 [ 74.517] (II) XKB: reuse xkmfile /var/lib/xkb/server-1BCDDEFD4E35562D3483623A3498B96EFC960598.xkm [ 74.532] reporting 5 6 34 244 [ 74.546] reporting 5 6 34 244 [ 74.575] reporting 5 6 34 244 [ 74.577] reporting 5 6 34 244 [ 74.592] reporting 5 6 34 244 [ 74.595] (II) intel(0): EDID vendor "LGD", prod id 732 [ 74.595] (II) intel(0): Printing DDC gathered Modelines: [ 74.595] (II) intel(0): Modeline "1366x768"x0.0 70.00 1366 1402 1450 1492 768 771 776 782 -hsync -vsync (46.9 kHz eP) [ 74.596] (II) intel(0): EDID vendor "LGD", prod id 732 [ 74.596] (II) intel(0): Printing DDC gathered Modelines: [ 74.596] (II) intel(0): Modeline "1366x768"x0.0 70.00 1366 1402 1450 1492 768 771 776 782 -hsync -vsync (46.9 kHz eP) [ 74.612] reporting 5 6 34 244 [ 74.623] (II) intel(0): resizing framebuffer to 2390x768 [ 74.623] (II) intel(0): switch to mode [email protected] on pipe 0 using LVDS1, position (0, 0), rotation normal [ 74.640] have a master to look out for [ 74.640] adjust shatters 0 2390 [ 74.640] need to create shared pixmap 1 output of df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 148860244 34569704 106705824 25% / none 4 0 4 0% /sys/fs/cgroup udev 4028988 4 4028984 1% /dev tmpfs 808724 1232 807492 1% /run none 5120 0 5120 0% /run/lock none 4043620 416 4043204 1% /run/shm none 102400 36 102364 1% /run/user /dev/sdb1 527771640 143074604 384697036 28% /media/sw/Volume /dev/sdb2 201586656 4858500 186488108 3% /media/sw/LINPROG
Looks a lot like an issue with your graphics card driver (nouveau) crashing when loading the second desktop for some reason (I am no kernel expert so I can't explain why). I'd suggestion either: Try a more recent kernel (you may need to build it yourself if there's none already available for Mint). If you don't mind using proprietary software, try installing the latest driver from Nvidia. I also notice mentions to Intel in your Xorg.log, are you by chance using one of those hybrid graphics laptops? If so, you can also try blacklisting the nouveau module entirely and see if you have any issues using only the Intel driver for the integrated graphics and see if it helps.
Linux mint freezes on second account login - unable to handle kernel NULL pointer dereference at (null)
1,515,445,968,000
I am using cygwin on Windows 10, to ssh to my servers, and recently I noticed that whenever I pressed CTRL+o the entire session/cygwin window would freeze up. I tested it out on putty as well and same thing happens. I have also noticed that pressing CTRL+o again causes it to unfreeze. I am pretty sure this did not use to happen before, as I use nano text editor usually and CTRL-o for saving the file. This is causing a lot of frustration now as every time I try to save a file the whole session gets stuck. Also I have tried stty -ixon command but it did not help and it seems unrelated to CTRL+s and CTRL+q. Any ideas what might be causing this and if it can be disabled?
Do you have by any chance NZXT Cam software running? The default hotkey to activate it's overlay is Ctrl+O. Remove the assigned hotkey in NZXT Cam Settings > Overlay and you should be good.
CTRL-O causing terminal to freeze
1,515,445,968,000
TL;DR Question: How can I disallow installing of the package intel-microcode in the future? With my bad memory, I may try installing it someday, again. Long story Yesterday, I installed the intel-microcode package on Linux Mint 18.3 using driver-manager. Problem: in this laptop's case, it causes a complete system freeze. Reproducible: Yes, after each boot. When: Every time the system boots up. More specifically, sometimes at loading initramfs, more often very soon after login (up to some 5 minutes). Kernel: 4.13.0-38-generic. Hardware: not old but not new laptop Lenovo IdeaPad Z50-70, exact model 59-432384. BIOS: 9BCN31WW. Note for BIOS upgrade: Since Lenovo provides BIOS upgrades for Windows only, I can't upgrade. The latest BIOS is dated 24 Sep 2015, which is long time ago anyways, Lenovo BIOS download page. CPU: i7-4510U, Ark Intel. dmidecode, relevant CPU part: Processor Information Socket Designation: U3E1 Type: Central Processor Family: Core i7 Manufacturer: Intel(R) Corporation ID: 51 06 04 00 FF FB EB BF Signature: Type 0, Family 6, Model 69, Stepping 1 Flags: FPU (Floating-point unit on-chip) VME (Virtual mode extension) DE (Debugging extension) PSE (Page size extension) TSC (Time stamp counter) MSR (Model specific registers) PAE (Physical address extension) MCE (Machine check exception) CX8 (CMPXCHG8 instruction supported) APIC (On-chip APIC hardware supported) SEP (Fast system call) MTRR (Memory type range registers) PGE (Page global enable) MCA (Machine check architecture) CMOV (Conditional move instruction supported) PAT (Page attribute table) PSE-36 (36-bit page size extension) CLFSH (CLFLUSH instruction supported) DS (Debug store) ACPI (ACPI supported) MMX (MMX technology supported) FXSR (FXSAVE and FXSTOR instructions supported) SSE (Streaming SIMD extensions) SSE2 (Streaming SIMD extensions 2) SS (Self-snoop) HTT (Multi-threading) TM (Thermal monitor supported) PBE (Pending break enabled) Version: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz Voltage: 0.7 V External Clock: 100 MHz Max Speed: 2600 MHz Current Speed: 1900 MHz Status: Populated, Enabled Upgrade: Socket BGA1168 L1 Cache Handle: 0x000B L2 Cache Handle: 0x000C L3 Cache Handle: 0x000D Serial Number: To Be Filled By O.E.M. Asset Tag: To Be Filled By O.E.M. Part Number: To Be Filled By O.E.M. Core Count: 2 Core Enabled: 2 Thread Count: 4 Characteristics: 64-bit capable Multi-Core Hardware Thread Execute Protection Enhanced Virtualization Power/Performance Control Temporary solution: I was lucky, that one time the computer booted fine and I was fast enough to uninstall this package, again, through driver-manager.
You can give the package a negative pin; that will prevent apt from installing it. Add a file named, for example, no-intel-microcode in /etc/apt/preferences.d, containing Explanation: intel-microcode causes this laptop to crash Package: intel-microcode Pin: release n=xenial* Pin-Priority: -1 Attempting to install intel-microcode will then complain that no candidate version can be found, and nothing will be installed. The only way to allow installation via APT-based tools then is to alter the pin. apt policy intel-microcode will show something like intel-microcode: Installed: (none) Candidate: (none) Version table: 3.20180312.1 -1 -1 http://ftp.fr.debian.org/debian testing/non-free amd64 Packages -1 http://ftp.fr.debian.org/debian unstable/non-free amd64 Packages 3.20170707.1~deb9u1 -1 -1 http://ftp.fr.debian.org/debian stretch/non-free amd64 Packages
How can I prevent installation of a specific package on Linux Mint?
1,515,445,968,000
My Computer has been freezing a lot lately, and with no apparent reason.It freezes even if my usage is 3% CPU and 9% RAM. I was using Windows 8 until I installed Ubuntu 14.04. It was really slow, and after some researching, I adopted the idea that Ubuntu 14.04 wasn't really that stable, so I decided I'd download a less resource-heavy distro, so I installed Arch Linux (which is what I'm using to type this now) with GNOME. I'm not having any of the problems I used to have in Ubuntu, except for this mostly annoying freeze that happens to be absolutely random .. My Fan is working correctly, so it's not temperature, and my drivers are up-to-date (they're the same ones I used on Windows, which I had no problem at all with). Note that: The Whole OS just freezes, and when I was once able to Alt+F2 (to get to the run-a-command dialog) and managed to type in a command (I was struggling with the keyboard to type) and hit Enter, I got the message: No enough memory .. ? Which is pretty unexpected because I'm using a minimal system (arch linux) with only one application running .. Edit: Here's my /etc/fstab file # # /etc/fstab: static file system information # # <file system> <dir> <type> <options> <dump> <pass> # /dev/sda3 UUID=2268132b-7cfa-4c55-b773-467c4f691e83 / ext4 rw,relatime,data=ordered 0 1 /dev/disk/by-uuid/2236F90308C55145 /mnt/2236F90308C55145 auto nosuid,nodev,nofail,x-gvfs-show,user 0 0 /dev/disk/by-uuid/4FF142A03DACFA48 /mnt/4FF142A03DACFA48 auto nosuid,nodev,nofail,x-gvfs-show,user 0 0 lsblk outputs .. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 298.1G 0 disk ├─sda1 8:1 0 69.9G 0 part /mnt/2236F90308C55145 ├─sda2 8:2 0 59.2G 0 part /mnt/4FF142A03DACFA48 ├─sda3 8:3 0 90.3G 0 part / └─sda4 8:4 0 78.7G 0 part sr0 11:0 1 1024M 0 rom
Your problem is that you don't have any swap space. Operating systems require a swap space so that they are able to free up ram space and store it on the hard drive. What you are going to need to do is reformat your hard drive. Red Hat has a suggest swap size chart here. Load up the arch live cd and repartition and swapon /dev/sdaX. If you need a reference see the Arch Wiki Beginner's Guide. I'll suggest a partition like the following one. NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 298.1G 0 disk ├─sda1 8:1 0 100M 0 part /boot ├─sda2 8:2 0 20G 0 part / ├─sda3 8:3 0 4G 0 part [SWAP] └─sda4 8:4 0 rest 0 part /home This is just suggested, you can do everything in a single partition and not worry about much (but this is the basic format that most people use). If you are keeping your root partition separate then remember to keep it around 20-25G. This is a security thing, because users should be installing programs into their own folders. You won't run out of space, I promise. Pacman and yaourt will take care of this for you.
Linux freezing randomly
1,515,445,968,000
I've been trying to unarchive a cpio archive (in this case, my initial ramdisk). However, when I try to extract the files, cpio hangs forever. It happens if I pass the -V argument to print extra info, too. alex@alexs-arch-imac:/tmp/initramfs$ cpio -i initramfs-linux.img # wait for a while after this ^C alex@alexs-arch-imac:/tmp/initramfs$ How can I extract a cpio archive without the utility hanging?
For some weird reason, cpio doesn't like to take a file argument. Instead, you have to pipe the archive into cpio. An inexperienced user would do the following: cat initramfs-linux.img | cpio -i However, this would get you the Useless Use of cat Award. A better way would be: cpio -i < initramfs-linux.img This uses the shell's built-in redirection capabilities instead of spawning a new process.
When I execute a cpio command, it hangs forever
1,515,445,968,000
I need some help diagnosing and finding the root cause of my system stability issues. All signs point to some sort of hardware problem (disk or RAM) but my investigations so far don't turn up anything. This is a brand new system with new hardware running Ubuntu 20.04. It is a NUC (D54250WYK / NUC8I5BEH) with 2x16GB RAM and a 2TB Samsung SSD (Samsung 970 EVO Plus). It's also a fresh install of Ubuntu. The system has very little installed on it with just docker engine and around 8 containers. The symptoms are that every so often the system will completely come to a halt. I can barely login to the machine via SSH, one time I could and every command I ran gave: -bash: /usr/bin/ls: Input/output error Other times I could not login remotely at all but opening the terminal on the machine directly I could see many errors logged to the terminal, mostly around disk being full or unable to write to disk. A reboot fixes things and the system runs fine for between 1 and 6 days before the issue occurs again. Checking dmesg and syslog I don't see much before the system goes unresponsive. I'm guessing it is unable to write logs due to the disk being read-only. I do see other services complaining a bit, eg: [826122.177679] systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies. [826122.178711] systemd[1161852]: containerd.service: Failed to connect stdout to the journal socket, ignoring: Connection refused [826122.178970] systemd[1161852]: containerd.service: Failed to execute command: Input/output error [826122.179022] systemd[1161852]: containerd.service: Failed at step EXEC spawning /usr/bin/containerd: Input/output error [826122.179430] systemd[1]: containerd.service: Main process exited, code=exited, status=203/EXEC [826122.179439] systemd[1]: containerd.service: Failed with result 'exit-code'. [826122.179568] systemd[1]: Failed to start containerd container runtime. I also see a LOT of logging for UFW firewall, blocking various requests (some are for ports I allow, I'm not sure why that would be happening). Based on research this appears to be faulty hardware, likely disk or memory. So I have done as much diagnostics on both as I could: smartctl reports no errors and a healthy SSD badblocks runs fine through the system without issue, zero errors fsck does not pick up any issues except after I reboot due to bad shutdown (which are fixed immediately) memtest86 ran through several loops without problem and zero errors reported What else can I do to better diagnose this issue? Is there more logging I can turn on? Are there other diagnostic tools I can use to work out the cause?
After a lot of digging, I appear to have found the solution (no crashes so far 🤞) tl;dr: In /etc/default/grub in the GRUB_CMDLINE_LINUX_DEFAULT variable I added: nvme_core.default_ps_max_latency_us=0 and pcie_aspm=off, which ends up looking like: GRUB_CMDLINE_LINUX_DEFAULT="nvme_core.default_ps_max_latency_us=0 pcie_aspm=off" This disables APSM (advanced power management) for the Samsung Evo SSD which seems to be causing the disk to unmount or become inaccessible. There seems to be quite a history of issues with some types of newer SSDs and APSM on Linux. Most issues looked to have fixes in place but it seemed to still be affecting me. More reading here: https://bugzilla.kernel.org/show_bug.cgi?id=195039 https://wiki.archlinux.org/index.php/Solid_state_drive/NVMe https://wiki.archlinux.org/index.php/Talk:Solid_state_drive/NVMe
System stability issues - disk becoming read-only, system coming to a halt, Input/output errors in terminal
1,515,445,968,000
I'm using compton for compositing with this config in i3wm in Ubuntu 18.04: # _ # ___ ___ _ __ ___ _ __ | |_ ___ _ __ # / __/ _ \| '_ ` _ \| '_ \| __/ _ \| '_ \ # | (__ (_) | | | | | | |_) | |_ (_) | | | | # \___\___/|_| |_| |_| .__/ \__\___/|_| |_| # |_| ################################# # # Backend # ################################# # Backend to use: "xrender" or "glx". # GLX backend is typically much faster but depends on a sane driver. backend = "glx"; ################################# # # GLX backend # ################################# glx-no-stencil = true; # GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. # My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, # but a 20% increase when only 1/4 is. # My tests on nouveau show terrible slowdown. # Useful with --glx-swap-method, as well. glx-copy-from-front = false; # GLX backend: Use MESA_copy_sub_buffer to do partial screen update. # My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. # May break VSync and is not available on some drivers. # Overrides --glx-copy-from-front. # glx-use-copysubbuffermesa = true; # GLX backend: Avoid rebinding pixmap on window damage. # Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). # Recommended if it works. # glx-no-rebind-pixmap = true; # GLX backend: GLX buffer swap method we assume. # Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). # undefined is the slowest and the safest, and the default value. # copy is fastest, but may fail on some drivers, # 2-6 are gradually slower but safer (6 is still faster than 0). # Usually, double buffer means 2, triple buffer means 3. # buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. # Useless with --glx-use-copysubbuffermesa. # Partially breaks --resize-damage. # Defaults to undefined. glx-swap-method = "undefined"; ################################# # # Shadows # ################################# # Enabled client-side shadows on windows. shadow = true; # Don't draw shadows on DND windows. no-dnd-shadow = true; # Avoid drawing shadows on dock/panel windows. no-dock-shadow = true; # Zero the part of the shadow's mask behind the window. Fix some weirdness with ARGB windows. clear-shadow = true; # The blur radius for shadows. (default 12) shadow-radius = 5; # The left offset for shadows. (default -15) shadow-offset-x = -5; # The top offset for shadows. (default -15) shadow-offset-y = -5; # The translucency for shadows. (default .75) shadow-opacity = 0.5; # Set if you want different colour shadows # shadow-red = 0.0; # shadow-green = 0.0; # shadow-blue = 0.0; # The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches # (most applications are fine, only apps that do weird things with xshapes or argb are affected). # This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. shadow-exclude = [ "! name~=''", "name = 'Notification'", "name = 'Plank'", "name = 'Docky'", "name = 'Kupfer'", "name = 'xfce4-notifyd'", "name *= 'VLC'", "name *= 'compton'", "name *= 'Chromium'", "name *= 'Chrome'", "name *= 'Firefox'", "class_g = 'Conky'", "class_g = 'Kupfer'", "class_g = 'Synapse'", "class_g ?= 'Notify-osd'", "class_g ?= 'Cairo-dock'", "class_g ?= 'Xfce4-notifyd'", "class_g ?= 'Xfce4-power-manager'" ]; # Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) shadow-ignore-shaped = false; ################################# # # Opacity # ################################# menu-opacity = 1; inactive-opacity = 1; active-opacity = 1; frame-opacity = 1; inactive-opacity-override = false; alpha-step = 0.06; # Dim inactive windows. (0.0 - 1.0) # inactive-dim = 0.2; # Do not let dimness adjust based on window opacity. # inactive-dim-fixed = true; # Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. # blur-background = true; # Blur background of opaque windows with transparent frames as well. # blur-background-frame = true; # Do not let blur radius adjust based on window opacity. blur-background-fixed = false; blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ]; ################################# # # Fading # ################################# # Fade windows during opacity changes. fading = true; # The time between steps in a fade in milliseconds. (default 10). fade-delta = 4; # Opacity change between steps while fading in. (default 0.028). fade-in-step = 0.03; # Opacity change between steps while fading out. (default 0.03). fade-out-step = 0.03; # Fade windows in/out when opening/closing # no-fading-openclose = true; # Specify a list of conditions of windows that should not be faded. fade-exclude = [ ]; ################################# # # Other # ################################# # Try to detect WM windows and mark them as active. mark-wmwin-focused = true; # Mark all non-WM but override-redirect windows active (e.g. menus). mark-ovredir-focused = true; # Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events. # Usually more reliable but depends on a EWMH-compliant WM. use-ewmh-active-win = true; # Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. detect-rounded-corners = true; # Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows. # This prevents opacity being ignored for some apps. # For example without this enabled my xfce4-notifyd is 100% opacity no matter what. detect-client-opacity = true; # Specify refresh rate of the screen. # If not specified or 0, compton will try detecting this with X RandR extension. refresh-rate = 0; # Set VSync method. VSync methods currently available: # none: No VSync # drm: VSync with DRM_IOCTL_WAIT_VBLANK. May only work on some drivers. # opengl: Try to VSync with SGI_video_sync OpenGL extension. Only work on some drivers. # opengl-oml: Try to VSync with OML_sync_control OpenGL extension. Only work on some drivers. # opengl-swc: Try to VSync with SGI_swap_control OpenGL extension. Only work on some drivers. Works only with GLX backend. Known to be most effective on many drivers. Does not actually control paint timing, only buffer swap is affected, so it doesn’t have the effect of --sw-opti unlike other methods. Experimental. # opengl-mswc: Try to VSync with MESA_swap_control OpenGL extension. Basically the same as opengl-swc above, except the extension we use. # (Note some VSync methods may not be enabled at compile time.) vsync = "opengl-swc"; # Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. # Reported to have no effect, though. dbe = false; # Painting on X Composite overlay window. Recommended. paint-on-overlay = true; # Limit compton to repaint at most once every 1 / refresh_rate second to boost performance. # This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already, # unless you wish to specify a lower refresh rate than the actual value. sw-opti = false; # Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games. # Known to cause flickering when redirecting/unredirecting windows. # paint-on-overlay may make the flickering less obvious. unredir-if-possible = true; # Specify a list of conditions of windows that should always be considered focused. focus-exclude = [ ]; # Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time. detect-transient = true; # Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time. # WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too. detect-client-leader = true; ################################# # # Window type settings # ################################# wintypes: { tooltip = { # fade: Fade the particular type of windows. fade = true; # shadow: Give those windows shadow shadow = false; # opacity: Default opacity for the type of windows. opacity = 0.85; # focus: Whether to always consider windows of this type focused. focus = true; }; }; My i3 config really doesn't have anything special, only some keybindings: # _ _____ __ _ # (_)___ / ___ ___ _ __ / _(_) __ _ # | | |_ \ / __/ _ \| '_ \| |_| |/ _` | # | |___) | (__ (_) | | | | _| | (_| | # |_|____/ \___\___/|_| |_|_| |_|\__, | # |___/ # set color variables set $indicator #a4a8ad set $bg-color #2f343f set $active-bg-color #545c6d set $urgent-bg-color #E53935 set $focused-ws-color #b8babc set $inactive-ws-color #2f343f set $text-color #b8babc # -- general settings ---------------------------------------------------------- set $mod Mod4 floating_modifier $mod font pango:Hack 9 focus_follows_mouse no #gaps outer 10 #gaps inner 8 # -- key bindings -------------------------------------------------------------- # frequently used bindsym $mod+Return exec --no-startup-id xfce4-terminal bindsym $mod+d exec --no-startup-id dmenu_run -b bindsym $mod+q kill bindsym $mod+p exec --no-startup-id sh ~/projects/dotFiles/lock.sh # system commands bindsym $mod+Shift+c reload bindsym $mod+Shift+r restart bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" # splitting bindsym $mod+v split h bindsym $mod+b split v # layouts bindsym $mod+s layout stacking bindsym $mod+w layout tabbed bindsym $mod+e layout toggle split bindsym $mod+f fullscreen toggle bindsym $mod+Shift+space floating toggle bindsym $mod+space focus mode_toggle # focus bindsym $mod+a focus parent bindsym $mod+h focus left bindsym $mod+j focus down bindsym $mod+k focus up bindsym $mod+l focus right # moving windows bindsym $mod+Shift+h move left bindsym $mod+Shift+j move down bindsym $mod+Shift+k move up bindsym $mod+Shift+l move right # set workspace variables set $workspace1 "1" set $workspace2 "2" set $workspace3 "3" set $workspace4 "4" set $workspace5 "5" set $workspace6 "6" set $workspace7 "7" set $workspace8 "8" set $workspace9 "9" set $workspace10 "" # switch to workspace bindsym $mod+1 workspace $workspace1 bindsym $mod+2 workspace $workspace2 bindsym $mod+3 workspace $workspace3 bindsym $mod+4 workspace $workspace4 bindsym $mod+5 workspace $workspace5 bindsym $mod+6 workspace $workspace6 bindsym $mod+7 workspace $workspace7 bindsym $mod+8 workspace $workspace8 bindsym $mod+9 workspace $workspace9 bindsym $mod+0 workspace $workspace10 # move focused container to workspace bindsym $mod+Shift+1 move container to workspace $workspace1 bindsym $mod+Shift+2 move container to workspace $workspace2 bindsym $mod+Shift+3 move container to workspace $workspace3 bindsym $mod+Shift+4 move container to workspace $workspace4 bindsym $mod+Shift+5 move container to workspace $workspace5 bindsym $mod+Shift+6 move container to workspace $workspace6 bindsym $mod+Shift+7 move container to workspace $workspace7 bindsym $mod+Shift+8 move container to workspace $workspace8 bindsym $mod+Shift+9 move container to workspace $workspace9 bindsym $mod+Shift+0 move container to workspace $workspace10 # resize window (you can also use the mouse for that) bindsym $mod+r mode "resize" mode "resize" { # These bindings trigger as soon as you enter the resize mode bindsym h resize shrink width 10 px or 10 ppt bindsym j resize grow height 10 px or 10 ppt bindsym k resize shrink height 10 px or 10 ppt bindsym l resize grow width 10 px or 10 ppt # back to normal: Enter or Escape bindsym Return mode "default" bindsym Escape mode "default" } # -- window colors ------------------------------------------------------------- # border background text indicator client.focused $active-bg-color $active-bg-color $text-color $indicator client.unfocused $bg-color $bg-color $text-color $indicator client.focused_inactive $bg-color $bg-color $text-color $indicator client.urgent $urgent-bg-color $urgent-bg-color $text-color $indicator bar { Position top font pango:Hack 9 status_command i3blocks -c $HOME/.config/i3/i3blocks.conf colors { background $bg-color separator #757575 # border background text focused_workspace $bg-color $focused-ws-color $bg-color inactive_workspace $bg-color $inactive-ws-color $text-color urgent_workspace $bg-color $urgent-bg-color $text-color } } # -- startup programs ---------------------------------------------------------- exec_always --no-startup-id feh --bg-scale $HOME/.local/share/backgrounds/batman_bat.png exec --no-startup-id compton --config $HOME/.config/compton.conf exec --no-startup-id nm-applet exec --no-startup-id xinput set-prop 'DELL0767:00 06CB:7E92 Touchpad' 'libinput Tapping Enabled' 1 exec --no-startup-id xinput set-prop 'DELL0767:00 06CB:7E92 Touchpad' 'libinput Natural Scrolling Enabled' 1 new_window pixel 1 #default_border pixel 1 #default_floating_border normal # Pulse Audio controls # For pulseaudio #bindsym XF86AudioRaiseVolume exec --no-startup-id pactl -- set-sink-volume 0 +5% #increase sound volume #bindsym XF86AudioLowerVolume exec --no-startup-id pactl -- set-sink-volume 0 -5% #decrease sound volume #bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound # For ALSA bindsym XF86AudioRaiseVolume exec --no-startup-id "amixer -q sset Master,0 1+ unmute" bindsym XF86AudioLowerVolume exec --no-startup-id "amixer -q sset Master,0 1- unmute" bindsym XF86AudioMute exec --no-startup-id "amixer -q sset Headphone,0 toggle" # Sreen brightness controls bindsym XF86MonBrightnessUp exec xbacklight -inc 5 # increase screen brightness bindsym XF86MonBrightnessDown exec xbacklight -dec 5 # decrease screen brightness # Media player controls bindsym XF86AudioPlay exec --no-startup-id playerctl play bindsym XF86AudioPause exec --no-startup-id playerctl pause bindsym XF86AudioNext exec --no-startup-id playerctl next bindsym XF86AudioPrev exec --no-startup-id playerctl previous For some reason, must be caused by something in the above config, when an window is made fullscreen, randomly the screen will freeze, but the computer works fine: sound still works, keybindings works, I can log out with my keybinding, etc. And this happens randomly, i.e. not everytime an window is made fullscreen, but it happens mostly for chromium-browser and mpv, mostly while playing videos(not youtube though). How can I get rid of the problem?
This seems to be a compton issue and there's no solution as far as I know. I recommend you to read and participate in this Github thread (it seems to be the most active). This bug is hard to reproduce and we need as much information as possible (config files, logs, setups, etc). Update: 2018-09-21 Well, it seems that yshui has fixed this issue, at least for most people. Note that yshui is not the original developer, chjj's compton seems to be abandoned, but he/she mantains a bug-fix-only fork. Branch is yshui/compton#damaged, please install it (it needs to be compiled) and report if it solved the problem for you and any possible drawbacks in the thread mentioned above.
i3wm [official ubuntu version] screen freezes randomly when window is fullscreen
1,515,445,968,000
Since yesterday, I am having regular total freeze of my OS, archlinux, with no clear reason why. The only thing I'm doing is browsing the internet with Firefox while it happens. The audio, bluetooth are still working during these freezes, but I have no way to interact with the system... I tried to find something helpful in the system log: $ sudo journalctl -b -1 -k -xe ... Jan 14 10:22:45 flexywhale kernel: INFO: task kworker/0:1H:213 blocked for more than 122 seconds. Jan 14 10:22:45 flexywhale kernel: Tainted: G W 5.10.6-arch1-1 #1 Jan 14 10:22:45 flexywhale kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. Jan 14 10:22:45 flexywhale kernel: task:kworker/0:1H state:D stack: 0 pid: 213 ppid: 2 flags:0x00004000 Jan 14 10:22:45 flexywhale kernel: Workqueue: events_highpri intel_atomic_cleanup_work [i915] Jan 14 10:22:45 flexywhale kernel: Call Trace: Jan 14 10:22:45 flexywhale kernel: __schedule+0x295/0x810 Jan 14 10:22:45 flexywhale kernel: schedule+0x5b/0xc0 Jan 14 10:22:45 flexywhale kernel: schedule_preempt_disabled+0x11/0x20 Jan 14 10:22:45 flexywhale kernel: __ww_mutex_lock.constprop.0+0x4bd/0x810 Jan 14 10:22:45 flexywhale kernel: ? dequeue_entity+0xc6/0x460 Jan 14 10:22:45 flexywhale kernel: intel_unpin_fb_vma+0x25/0xa0 [i915] Jan 14 10:22:45 flexywhale kernel: drm_atomic_helper_cleanup_planes+0x52/0x70 [drm_kms_helper] Jan 14 10:22:45 flexywhale kernel: intel_atomic_cleanup_work+0x67/0x110 [i915] Jan 14 10:22:45 flexywhale kernel: process_one_work+0x1d6/0x3a0 Jan 14 10:22:45 flexywhale kernel: worker_thread+0x4d/0x3d0 Jan 14 10:22:45 flexywhale kernel: ? rescuer_thread+0x410/0x410 Jan 14 10:22:45 flexywhale kernel: kthread+0x133/0x150 Jan 14 10:22:45 flexywhale kernel: ? __kthread_bind_mask+0x60/0x60 Jan 14 10:22:45 flexywhale kernel: ret_from_fork+0x1f/0x30 Jan 14 10:24:48 flexywhale kernel: INFO: task kworker/0:1H:213 blocked for more than 245 seconds. Jan 14 10:24:48 flexywhale kernel: Tainted: G W 5.10.6-arch1-1 #1 Jan 14 10:24:48 flexywhale kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. Jan 14 10:24:48 flexywhale kernel: task:kworker/0:1H state:D stack: 0 pid: 213 ppid: 2 flags:0x00004000 Jan 14 10:24:48 flexywhale kernel: Workqueue: events_highpri intel_atomic_cleanup_work [i915] Jan 14 10:24:48 flexywhale kernel: Call Trace: Jan 14 10:24:48 flexywhale kernel: __schedule+0x295/0x810 Jan 14 10:24:48 flexywhale kernel: schedule+0x5b/0xc0 Jan 14 10:24:48 flexywhale kernel: schedule_preempt_disabled+0x11/0x20 Jan 14 10:24:48 flexywhale kernel: __ww_mutex_lock.constprop.0+0x4bd/0x810 Jan 14 10:24:48 flexywhale kernel: ? dequeue_entity+0xc6/0x460 Jan 14 10:24:48 flexywhale kernel: intel_unpin_fb_vma+0x25/0xa0 [i915] Jan 14 10:24:48 flexywhale kernel: drm_atomic_helper_cleanup_planes+0x52/0x70 [drm_kms_helper] Jan 14 10:24:48 flexywhale kernel: intel_atomic_cleanup_work+0x67/0x110 [i915] Jan 14 10:24:48 flexywhale kernel: process_one_work+0x1d6/0x3a0 Jan 14 10:24:48 flexywhale kernel: worker_thread+0x4d/0x3d0 Jan 14 10:24:48 flexywhale kernel: ? rescuer_thread+0x410/0x410 Jan 14 10:24:48 flexywhale kernel: kthread+0x133/0x150 Jan 14 10:24:48 flexywhale kernel: ? __kthread_bind_mask+0x60/0x60 Jan 14 10:24:48 flexywhale kernel: ret_from_fork+0x1f/0x30 ... These freezes did not occur after a system update (it was last updated about a week ago) and I updated my system since to try to fix it but without success. What can I do to diagnose and try to resolve this ? Thanks !
This is probably the same issue that is discussed here and here. A short-term solution (that works for me too) is uninstalling xf86-video-intel.
OS freezes completely
1,515,445,968,000
When my laptop is at work (running OpenSUSE Tumbleweed), and when the network cable -> USB adapter is plugged in, eventually in a day the computer sort-of-freezes. I can still operate everything normally, but as soon as I attempt any sudo command, the process attempting it freezes; this includes sudo reboot. On the other hand, doing an su -s still seems to work. It's purely the sudo that is frozen, and it seems to be related to being plugged in to the network via the USB adapter. As a side note, this does NOT happen when I use KDE as my window manager; however, I usually use exwm (emacs). I can't even think of a possible explanation. Any ideas?
TLDR; In my case I fixed adding Defaults !fqdn to the /etc/sudoers file Details: Maybe is freezing due to a network problem. Fix the network, then sudo will work again, I hope. I was with similar problem (on Ubuntu Mate) and seems that we have kind of a cyclical dependency: By some reason sudo needs network (to validate a hostname based configuration, probably) The network is not working To fix the network I need to run $ sudo killall NetWorkManager; sudo NetWorkManager But any command that I run with sudo freezes the terminal So, to summarize: To fix network I need sudo To run sudo I need network For me, the initial workaround was define a password for root, then I can login and restart the NetworkManager. Then I realized that I can add "Defaults !fqdn" to sudoers file and fixed the problem.
Why is my sudo process freezing?
1,515,445,968,000
My computer (which has an NVIDIA card) has a rendering problem that is very annoying. Sometimes the X server 'locks up' after freezing (or whatever's going on in there because VLC music loops at the current packet then) for ~1 second, the pointer becomes invisible, the keyboard & mouse won't work and I get a screen that looks like this: except the colors are different each time. I enabled ctrl-alt-backspace and alt-sysrq-[rk] keys and not even those have an effect, to recover I must do a cold reboot. Sometimes instead of getting the above screen I get a console full of kernel errors like nouveau: failed to idle channel XXX. Then after a few seconds all programs get killed (while in the tty). This might be an X server because my xgamma settings (which are reset every logout) are even then still in effect. And then even the console itself disappears, no login screen, just black (and the only way out is also a cold reboot). The strangest part is that KTorrent (which was downloading a file when this happened) was still transmitting data during the lockup, according to my modem LED. All programs are killed, can reproduce with VLC playing music. In particular, I can't run any JavaFX 8 programs (not even the simplest one which creates an empty window) because when I run java -jar my.jar, the window appears but in a degenerated/rendering-out-of-sync form, and either a) the screen locks up after a few seconds of b) after a few (un)maximizing/resizing the above happens. Also happens sometimes while I use firefox or even when there are no windows open. wmctrl -l shows that the lockup screen is not a window. Also, as said above, windows/programs are still open so all GUI processes wouldn't be killed. This is very confusing and I'm out of ideas.
By the way: alt-sysrq-[rk] won't help here - it actually kills all the programs itself and putting you in that console scenario. However, that is not the problem. In a nutshell, it's nouveau. From what you're saying, the X server is still functioning but the graphics "connection" appear to be cut off from your display. Since a nouveau driver is for NVIDIA cards, java, firefox and your other programs are trying to utilize the card thinking it's available. This is called video (aka. hardware) acceleration. The screen "lockup" is not from the X server then, it's from the lack of hardware capabilities in nouveau for your card (3D rendering, video decoding, etc.), so when a program attempts to use one of them, it crashes nouveau. Consider the GPU code names and video engines for NVIDIA cards. Assuming you have a GeForce 6/7 series card, it ends up in the NV40 (Curie) family, which in turn use VPE1, VPE2 and VP1 video engines, none of which supports video (hardware) acceleration (except for XvMC from VPE2). That is what's making your X server "fail". (Be warned, the proprietary NVIDIA driver will not help in this case because of the missing capabilities.) The solution is to disable hardware acceleration entirely, and just stick to software rendering until you get a supported card. In java 8, you can do this: java -Dprism.order=sw -jar my.jar, works fine on my system. And firefox has an option in its advanced preferences to enable hardware acceleration (if it's available, which mistakenly is but I don't know why), make sure that's unchecked. Update: nouveau was never good at utilizing NVIDIA hardware in the first place, so if you're using one and your distro (e.g. RHEL 7) makes it difficult to get proprietary drivers I recommend you replace the card with a Radeon/Intel whose open-source drivers are better supported.
X server, keyboard & mouse lockup with corrupted display
1,515,445,968,000
I'm trying to use my new Wacom (CTL-490DW-S (Intuos DRAW)) drawing tablet with Linux Mint. I have an PC with a clean install (due to me messing up so many times already!) of Linux Mint: Linux Mint 17.3 Cinnamon 2.8.6 32-bit Kernel 3.19.0-32-generic The PC is a: Intel Core 2 Quad Q8200 @ 2.33GHz x4 3.8GiB Memory 111.2GB SSD I realise that I should really be running a 64bit OS, but that shouldn't effect things for now...should it? So far When I initially plug the tablet in it is recognised as a usb device , lsusb returns Bus 006 Device 003: ID 056a:033b Wacom Co., Ltd But it is not picked up as an xinput device. So I go over to the linuxwacom site and follow the steps to install the kernel drivers and Xdrivers. Now the device is picked up and the four main buttons on the tablet seems to do stuff. Good! But, bring the pen to the pad and my PC freezes completely. Bad! Some googling brought me to this chat about the usbhid and a deadlock situation relating to new tablets, which seems highly relevant to the problem at hand. By my crude understanding; the wacom drivers are asking too much too fast of the usbhid and it causes the lock-out. The solution seems to be to add the patch to the usbhid core and then recompile the kernel (and or module, I don't know?) before re-installing. I can locate the files and make the edit manually (its just two lines in one file, basically taking a line of code outside of the loop, as I understand) but the simple steps of "recompile and install" seem to flummox me every attempt I make. I have trouble with make oldconfig and then if that works make dep never works. Could someone guide me through/ send me on to a guide for how I should do this. Online articles seem to disagree on the steps, I'll happy do another clean install, if it simplifies the problem. As its Christmas (Newton-mas) I assume others will have similar issues with their new tablet toys that Santa brought them.
I was in the same boat. Was able to get the tablet recognized on Arch linux by installing linux-headers, and input-wacom-dkms from AUR which did the patching of the kernel. I'm not sure if it will work on Debian-based distros (Ubuntu/Mint) but there's a python script for input-wacom-dkms here. From what I've read the Intuos line should be supported in the Linux 4.4 kernel which should be out in a few weeks but probably won't come to Mint for a while as they tend to prioritize stability over bleeding edge.
Linux Kernel - Wacom Tablet (CTL-490DW-S) - Lockout
1,515,445,968,000
I'm running Linux Mint Maya 13.2 on a laptop from a USB stick, and SSHing onto that install from my own work computer. When i'm editing a file with Vim, i keep getting a pause of about a minute where it becomes completely unresponsive. The cursor is blinking but i can't do anything. After a minute or two it comes back to normal, spontaneously. This is not caused by me hitting Ctrl&S, eg like this question: https://stackoverflow.com/questions/3419820/sometimes-my-file-just-freezes-in-my-vi-vim-what-happened When it happens, i'm often using the cursors to navigate around the file. I never see this pause at any other time when i'm ssh'd onto the other computer in this way: it only happens when i'm editing a file with vim. The version of Vim i'm using is VIM - Vi IMproved version 7.3.429 Grateful for any suggestions! max
network conditions. To detect if your network conditions are good exit to shell on remote machine and hold any character key. If you see that character flow is unstable or 'hangs' you have network problems. vim does autosave and target disk if NFS or something like that. To detect Either use sar to get data from the past or run vmstat in other ssh session to same server. target server overload. exit shell and run uptime immediately after the 'hang'. If target machine has sysstat installed, sar is even better.
Vim pausing randomly for a minute or so at a time
1,515,445,968,000
Yesterday I installed Mint 15 MATE on my laptop. Everything worked perfectly, so I installed some packages (python-django, mysql-server, and some other python modules). I also ran apt-get update && apt-get upgrade. Finally I selected a NVIDIA proprietary driver recommended by Mint, and changed the desktop icons. I did nothing else, and everything worked until today. I powered on the laptop, and the first thing I saw was an "old-fashioned" way of asking for the encryption password at startup, that looks almost like a console, when yesterday was a little Mint logo and a window for the input. After that the login screen appears, and then it freezes. Sometimes it happens at the login screen (even when I'm typing the password, so it gets stuck when I have written only a few characters), and sometimes I'm fast enough to login and see the desktop, but then it freezes anyway. I guess it's just a matter of time before some module gets loaded. I can move the mouse, but nothing else works. What can I do to fix this? I am willing to give you more information if you explain me how. I tried to pause booting sequence to see if there is something wrong (I have been able to see 2 FAILS, one relative to the avahi daemon, but I don't know how to pause the sequence in order to read it).
I had also some trouble with my Nvidia Card at boot up and occasionnal freeze. What i've done was to add 'nomodeset' to the grub boot option. You should try it... if it solve the problem you can make the change permanent : Edit /etc/default/grub sudo nano /etc/default/grub Find this line : GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" Add the 'nomodeset' option : GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset" Update Grub : sudo update-grub
Mint 15 freezes at startup
1,515,445,968,000
I've seen a few different questions about ls hanging. It's usually because they use the -l switch, which causes a stat on the file, which in turn is a bad symlink or pointing to an NFS mount or some such. I have a local file (in an old copy of the Git source that somebody else unpacked, of all things) that causes stat to hang, but responds to CTRL-C. It also causes ls -l to hang, hard, such that it does not respond to kill (but does terminate on a kill -9). It's not a symlink. The other files in the directory appear to stat without issue. I've recently rebooted the machine with forced fsck, which came out clean, and dmesg shows no disk-related messages. How can this be?
It may be a problem in getting the user name or group name, if you use and LDAP or NIS or other sources for that. What are you passwd and group lines in /etc/nsswitch.conf? This may be the case if an ls -nl return immediately.
Local, regular file causes `stat` or `ls -l` to hang
1,515,445,968,000
After an update/ upgrade on Debian 12 (weekly update), there is NO WiFi, files are not opening, unable to shutdown or sleep, and freezes when using sudo. The bug is fixed with a new release of kernel. But, I am NOT able to install the new kernel. I downloaded the new kernel file to a flash drive using another laptop Copied it to the freezing laptop But on hitting the command: $ sudo apt install ./linux-image-6.1.0-16-amd64_6.1.67-1_amd64.deb terminal freezes without prompting for password. EDIT: Tried to edit $ nano /etc/default/grub # GRUB_DEFAULT=0 GRUB_DEFAULT="1>2" But it could not be saved since I did NOT use 'sudo'. But, when I use sudo $ sudo nano /etc/default/grub It freezes without prompting for password (may be because of Network Manager issue) Any help?
I got the trick from @Jaromanda X and details from u/Hendersen43 and u/Only_Space7088 at: https://www.reddit.com/r/debian/comments/18i60wx/networkmanager_service_freezes_the_whole_pc_after/ I am giving details to help newbees...: I solved it by: (1) Interrupting booting process, and changing the kernel back to the previous version: While booting, press F9 to interrupt the booting Then, use arrow keys on keyboard to highlight the previous kernel version and press ENTER (2) Download the patched kernel (linux-image) from the site (from the above reddit posting): https://ftp.debian.org/debian/pool/main/l/linux-signed-amd64/linux-image-6.1.0-16-amd64_6.1.67-1_amd64.deb (3) Change Directory to Downloads folder (where the image is downloaded) (4) Installing it using the command (from the above reddit posting): me@debian~/Downloads$ sudo apt install ./linux-image-6.1.0-16-amd64_6.1.67-1_amd64.deb (5) Updating and then upgrading to the matching headers (linux-headers) $ sudo apt update $ sudo apt upgrade EDIT: I was unable to make changes in any system file nor install/ remove kernel, because on hitting 'sudo' the system hangs without prompting for password. @GAD3R: Thank you for your detailed answer. But I was unable to make any change in any file or install anything since 'sudo' was disabled. @garethTheRed: thank you
After an update (a kernel bug it seems) Debian 12 hangs when hitting sudo: Unable to install the new kernel with bug fixed
1,515,445,968,000
I have set up a machine that I use as a server using Ubuntu 20.04 . The machine worked perfectly but lately, it started giving me a really strange behavior. One time while I was working remotely suddenly I could not use anything. All the binaries were unreachable and whenever I was trying to invoke them using their path as /usr/bin/echo "Test" for example I was prompted a cannot <command>: Input/Output error. After looking online I found out that this may be due to a hard-drive problem. But my question is, how can I resolve this? Obviously, the system's condition is not stable and it has to be resolved. Any suggestions? Here is a sample from the dmesg -T --level=warn,err log after the machine was rebooted from a colleague, although I cannot see it linking the issue to the hard disk somehow. smartmontools log (sudo smartctl -a /dev/sda) smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-47-generic] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Toshiba X300 Device Model: TOSHIBA HDWE140 Serial Number: 69F9K2YWFBBG LU WWN Device Id: 5 000039 95bb0145e Firmware Version: FP1R User Capacity: 4,000,787,030,016 bytes [4.00 TB] Sector Sizes: 512 bytes logical, 4096 bytes physical Rotation Rate: 7200 rpm Form Factor: 3.5 inches Device is: In smartctl database [for details use: -P show] ATA Version is: ATA8-ACS (minor revision not indicated) SATA Version is: SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s) Local Time is: Fri Sep 25 15:35:54 2020 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x82) Offline data collection activity was completed without error. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 120) seconds. Offline data collection capabilities: (0x5b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. No Conveyance Self-test supported. Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. General Purpose Logging supported. Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 479) minutes. SCT capabilities: (0x003d) SCT Status supported. SCT Error Recovery Control supported. SCT Feature Control supported. SCT Data Table supported. SMART Attributes Data Structure revision number: 16 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0 2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0 3 Spin_Up_Time 0x0027 100 100 001 Pre-fail Always - 4092 4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 12 5 Reallocated_Sector_Ct 0x0033 100 100 050 Pre-fail Always - 0 7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0 8 Seek_Time_Performance 0x0005 100 100 050 Pre-fail Offline - 0 9 Power_On_Hours 0x0032 096 096 000 Old_age Always - 1886 10 Spin_Retry_Count 0x0033 100 100 030 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 12 191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 6 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 8 193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 12 194 Temperature_Celsius 0x0022 100 100 000 Old_age Always - 48 (Min/Max 26/55) 196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0 197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x0032 200 253 000 Old_age Always - 0 220 Disk_Shift 0x0002 100 100 000 Old_age Always - 0 222 Loaded_Hours 0x0032 096 096 000 Old_age Always - 1886 223 Load_Retry_Count 0x0032 100 100 000 Old_age Always - 0 224 Load_Friction 0x0022 100 100 000 Old_age Always - 0 226 Load-in_Time 0x0026 100 100 000 Old_age Always - 573 240 Head_Flying_Hours 0x0001 100 100 001 Pre-fail Offline - 0 SMART Error Log Version: 1 No Errors Logged SMART Self-test log structure revision number 1 No self-tests have been logged. [To run self-tests, use: smartctl -t] SMART Selective self-test log data structure revision number 1 SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS 1 0 0 Not_testing 2 0 0 Not_testing 3 0 0 Not_testing 4 0 0 Not_testing 5 0 0 Not_testing Selective self-test flags (0x0): After scanning selected spans, do NOT read-scan remainder of disk. If Selective self-test is pending on power-up, resume after 0 minute delay.
So, finally, I had a chance to take look at the actual machine and perform some changes. The issue, (at least it seems like that) was solved by doing the following; The SATA port#0 on the Motherboard, had a dangling cable that was NOT connected to any HDD or SSD. Instead, my HDD was connected with another cable on SATA port#1. It is true that in many cases, the motherboard prioritizes the SATA slots according to their ID ( 0 > 1 > 2 > 3 > ... ). So, I removed the dangling cable (which honestly, I have no idea who put it up there on the first place), and then I booted up the machine. Ever since I did this stupid change, namely removing a dangling cable from the SATA hub on the motherboard, the problem did not appear again. Obviously it was not a matter of a faulty disk partition since all of the disks were new and in great shape.
System Frozen: Input/Output error
1,515,445,968,000
I've been having this problem for several months. I'm running Linux on my personal computer. At random times, upwards of 3 times per day, my system totally freezes and becomes unresponsive to any input except a hard power-off. No mouse cursor movement, no SysRq magic keys, even pressing Num Lock doesn't toggle the LED on my keyboard. I understand hardware problems are often to blame for things like this. However: PassMark MemTest86 succeeded with 0 errors or warnings. smartctl and badblocks succeeded with 0 errors or warnings. I have never observed any excessive temperatures or fan problems. My graphics card is AMD (i.e., this is not one of the issues associated with NVIDIA cards.) I ran Windows on this hardware for years without comparable problems. I have set up kdump in an attempt to diagnose the issue. The dump kernel executes when I induce a kernel panic using echo "c" > /proc/sysrq-trigger, but when a wild freeze occurs it just stays frozen indefinitely without executing kdump or rebooting. My sysctl configuration has these variables set: kernel.hardlockup_panic = 1 kernel.hung_task_check_count = 4194304 kernel.hung_task_check_interval_secs = 0 kernel.hung_task_panic = 1 kernel.hung_task_timeout_secs = 10 kernel.hung_task_warnings = 10 kernel.nmi_watchdog = 1 kernel.panic = 60 kernel.panic_on_io_nmi = 1 kernel.panic_on_oops = 1 kernel.panic_on_rcu_stall = 1 kernel.panic_on_unrecovered_nmi = 1 kernel.panic_on_warn = 1 kernel.softlockup_panic = 1 kernel.soft_watchdog = 1 kernel.unknown_nmi_panic = 1 kernel.watchdog = 1 kernel.watchdog_cpumask = 0-3 # my system has 4 cores kernel.watchdog_thresh = 10 I have observed these freezes on Ubuntu 18.04 running Linux kernels 4.19 and 5.0, and on Arch Linux running Linux kernels 4.19 and 5.3. I'm running the latest Intel microcode package. There is nothing corresponding to these freezes in any Xorg log or .xsession-errors I'm out of ideas. What should I try next?
This freezing closely matches an open bug in the Linux Kernel (https://bugzilla.kernel.org/show_bug.cgi?id=109051) related to power management and idle states of certain Intel processors. My system uses an i3-3220T CPU manufactured ca 2013, which appears to be approximately the same generation as the processors affected by the bug. The workaround suggested by the bug thread is to add intel_idle.max_cstate=1 to my boot cmdline. Having done this, my system has not frozen in a month.
Random freezes, kdump not triggered, system does not reboot
1,515,445,968,000
My Debian Sid (KDE) OS (on a PC with an Nvidia GTX 970, proprietary drivers, an i7-8700K CPU, and 16GB RAM) has begun freezing randomly. Once or twice a day, it's completely unresponsive; the mouse won't move, and SysRq does nothing. This began after upgrading a bunch of packages. I checked syslog but nothing sticks out at me. Does anyone have any ideas on what could be wrong, or advice on how I can debug the issue? /var/log/messsages May 16 10:33:20 hiiaka kernel: [17020.784351] perf: interrupt took too long (2503 > 2500), lowering kernel.perf_event_max_sample_rate to 79750 May 16 12:03:17 hiiaka kernel: [ 0.000000] microcode: microcode updated early to revision 0xaa, date = 2018-12-12 May 16 12:03:17 hiiaka kernel: [ 0.000000] Linux version 4.19.0-4-amd64 ([email protected]) (gcc version 8.3.0 (Debian 8.3.0-2)) #1 SMP Debian 4.19.28-2 (2019-03-15) May 16 12:03:17 hiiaka kernel: [ 0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.19.0-4-amd64 root=/dev/mapper/hiiaka--vg-root ro quiet List of recent package history is here: https://pastebin.com/eZH1qf2e
In case anyone is interested - I tried several things: bios update memtest came up clean switch to Cinnamon downgrading nvidia drivers to previous version setting intel_idle.max_cstate and some other less notable things. Eventually I compiled a newer version of the kernel and have had no freezes for a few days.
Debian sid freezing randomly
1,515,445,968,000
I use Linux Mint with Dell XPS 15 as work laptop and build a large Android application using gradle. With all optimizations it still uses almost all available RAM (16 GB) and starting to use SWAP from swapfile (maybe, I should use swap partition instead?). It causes a high I/O rate and Cinnamon (and all other applications) have freezes. Also, I tried to test, that I/O is a reason of these problems and found, that running dd command for creating load to my I/O system also cause the same problems. (I couldn't reproduce this behavior on Mac OS, for example) I found that I should change I/O scheduler type to deadline, but my /sys/block/nvme0n1/queue/scheduler file contains just none option. And as I understand right it means that https://www.thomas-krenn.com/en/wiki/Linux_Multi-Queue_Block_IO_Queueing_Mechanism_(blk-mq) framework is used and I shouldn't to change anything. Question: How I can solve these freezes during I/O load? Maybe, what metrics should I analyze for getting more information? Environment: OS: Linux Mint 18.3 Cinnamon 64-bit Cinnamon: 3.6.7 Linux Kernel: 4.13.0-38-generic
With all optimizations it still uses almost all available RAM (16 GB) it — who? Typically every general purpose OS designed since 1970s uses all available RAM or its huge part for slow storage content caching intensively. If it means VM cache what troubles are there? Run free -m and study its output, it used to have special indication of "+/- cache/buffers" hinting that it's not irrevocable used — cache would shrink if there's memory pressure. It's pretty typical misconception a novice would have… I found that I should change I/O scheduler type to deadline Schedulers are there for slow devices like HDDs. With SSDs/NVME it's just extra overhead — you don't need to have queue for requests because there's no gain in re-ordering them — contrary to HDDs where it plays significant role reducing seek times. How I can solve these freezes during I/O load? There're no mindreaders here (being an exception I prefer to keep my talent hidden so others saved from envy), dd can be run in different ways, why didn't you just add a snippet showing how exactly it was run? P. S. Generally I can advice updating kernel, because it could be specific driver quirks that got (or didn't) resolved.
Linux freezes during I/O load [closed]
1,515,445,968,000
I am trying to mount directories from my work machine on my laptop via sshfs. The command I'm running is sshfs -d -o allow_other -o reconnect -o ServerAliveInterval=15 server:~/Documents ~/Documents/home The corresponding entry in ~/.ssh/config is Host server User myname Port 22 ProxyCommand ssh -q -W machineName.serverAdress.com:%p WorkNetworkName Now everytime I run the command I just get FUSE library version: 2.9.4 nullpath_ok: 0 nopath: 0 utime_omit_ok: 0 and then nothing. I can't even kill the process or unmount since in all other terminals I can enter a command but it won't run. The only thing I can do then is put the laptop to sleep and wake it up again. When I then run ls in ~/Documents on my laptop I get: d????????? ? ? ? ? ? home And fish throws the following error message on every letter I type: fish: Error while searching for command “/home/username/Documents/home/bin/python_lib/ls” access: Transport endpoint is not connected where ~/bin/python_lib is a directory I keep my python scripts on my work machine, so this is part of my PYTHONPATH on my work machine. Can anyone see what I did wrong? Cheers
Okay the problem was that the actual name of mountPoint was home and somehow that was too much for sshfs. If anyone knows why it's not a good idea to call the mount point home I'd be happy to learn something here. Cheers
Using sshfs freezes all terminals
1,515,445,968,000
Since a recent update, when I quit a web page containing a Flash animation in Firefox, the plugin-container process becomes a zombie, and then the systemd-journald process (also maybe something like systemd-coredump sometimes) eats several hundreds megabytes of memory. I don't have much RAM, so it makes my system swap, and when my system swaps it freezes. How can I prevent that? Should I disable something related to logging or core dumps? I'm using an up-to-date Archlinux system, with Firefox 30.0, systemd 213-9 and Flash 11.2.202.378.
According to ArchWiki, you can run this to disable crash dump journaling: # ln -s /dev/null /etc/sysctl.d/50-coredump.conf # sysctl kernel.core_pattern=core
How can I prevent systemd from freezing my system when Flash dies?
1,515,445,968,000
I just had a weird system freeze that I resolved using alt-sysrq-e. Here's my dmesg: https://gist.github.com/1609263 I was wondering whether it might be some kind of deadlock in the reiserfs3 code since it's mentioned so many times (and in nearly all the call traces)? Or would it look the same with any other file system? I just want to know if ReiserFS v3 is getting so old that I should bother reformatting, just to get rid of this. If this call trace would be produced with other filesystems too, I guess it's not resolvable by changing FS. I've been running this system for years now daily, and I never had this problem before. Not running a bleeding edge kernel either, just the standard Ubuntu 10.10 (3.0.0-14).
I ran a Slackware system for 8 years using ReiserFS v3 as the main filesystem. I don't think I ever had a problem until the disk started having hardware problems. I looked at your messages, and although the problem appears to come from filesystem code, it also looks like ext3 messages are mixed in there. Personally, I'd suspect a disk going bad, especially when you say "I've been running this system for years". Disks are complicated mechanically and electronically. They do go bad, in strange and unpredictable ways.
Is this task freeze related to ReiserFS (v3)? (or: is ReiserFS getting so old that it should be actively replaced?)
1,515,445,968,000
I'm not sure how to debug this, but I've noticed if I am performing a task that requires a large amount of disk reads/write (such as updating a large postgres table) that periodically actual reads and write will fall to 0 while dm_crypt shows 99.9% IO usage in iotop. On top of this the whole DE will freeze every so often as multiple kworker threads are spawned. The mouse continues to work and can be moved, but no other window responds for around 30-60s. The CPU is at low utilization the entire time and the freezes coincide with multiple kworker threads showing up in iotop. Here's the syslog output for the period of the freeze Oct 22 11:09:47 pop-os /usr/lib/gdm3/gdm-x-session[3348]: (EE) client bug: timer event5 debounce: scheduled expiry is in the past (-6ms), your system is too slow Oct 22 11:09:47 pop-os /usr/lib/gdm3/gdm-x-session[3348]: (EE) client bug: timer event5 debounce short: scheduled expiry is in the past (-19ms), your system is too slow Oct 22 11:10:12 pop-os gjs[184224]: JS ERROR: Gio.IOErrorEnum: Timeout was reached _proxyInvoker@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:139:46 _makeProxyMethod/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:164:30 makeAreaScreenshot@/home/anthony/.local/share/gnome-shell/extensions/[email protected]/auxhelper.js:78:33 main/<@/home/anthony/.local/share/gnome-shell/extensions/[email protected]/auxhelper.js:190:21 main@/home/anthony/.local/share/gnome-shell/extensions/[email protected]/auxhelper.js:204:30 @/home/anthony/.local/share/gnome-shell/extensions/[email protected]/auxhelper.js:216:3 Oct 22 11:10:36 pop-os gnome-shell[3610]: JS ERROR: Error: cmd: gjs /home/anthony/.local/share/gnome-shell/extensions/[email protected]/auxhelper.js --filename /tmp/gnome-shell-screenshot-ZPGAT0.png --area 3640,809,948,419 exitCode=256 callHelper/<@/home/anthony/.local/share/gnome-shell/extensions/[email protected]/selection.js:87:16 Oct 22 11:10:50 pop-os gnome-shell[3610]: ../clutter/clutter/clutter-actor.c:10558: The clutter_actor_set_allocation() function can only be called from within the implementation of the ClutterActor::allocate() virtual function. The postgres database is stored on a seperate disk from the OS, so there shouldn't be any reason that my DE should freeze when writing to it? Does anybody have any suggestions on how I can further debug this and figure out what's causing the problem? pop-os 20.04 5.4.0-7634-generic
To fix this I had to edit vm.dirty_ratio and vm.dirty_background_ratio. The issue was I was writing to the disk faster than the disk could handle and the system froze whenever the cache was filled.
dm_crypt / kworker hogging IO and causing system freeze
1,509,752,415,000
I'm experiencing random desktop freezes (I have to hard shut down the system) after recent updates on my Archlinux box. Today it happened a few minutes after startup. The only programs running were: Google Chrome 43.0.2357.134 (recently installed) Gnome shell 3.16.3 Gnome Terminal 3.16.1 pacman 4.2.1 My kernel version is 4.1.2-2-ARCH The only two common things running across all freezes are kernel 4.1.2 and chrome 43. And I started having this issues after upgrading to linux 4.1.2 and installing chrome instead of chromium. Unfortunately I did both upgrades at the same time. Does anyone else is experiencing the same? EDIT: It seems that not even Chrome is to blame. As I had a system freeze without having run Chrome on that session. Sometimes happened with WMWare, but it also happened without having run WMWare too. So my guess is that this is a kernel / driver issue. Today I had an update of the x86-video-intel driver... let's see if things will get better.
Mine was a kernel bug in the Bluetooth module introduced in kernel 4.1 and fixed in release 4.1.7.
Linux desktop keep randomnly freezing after recent updates
1,509,752,415,000
I am using centOS, sometimes the system just does not respond at all. In windows box, I can ctrl-alt-delete. On a Linux machine, how should I handle this?
IMHO, There is no such ctrl+alt+del key-combination for Linux. But to check, why the machine get hangs, you can do either: Press alt+ctrl+f1, and observe the command "top", to see "who"/"which program" is eating up the cpu and causing the hang. You can place "system-monitor" in the taskbar, whose indicator will show the cpu-usage, for observation.
No response on a Linux machine
1,509,752,415,000
For the last few hours, my computer has been freezing at random every minute or so. I'll type some text, and it won't appear until ~15 seconds later, all in one block. It started happening all at once for no apparent reason. I didn't make any system changes (that I can think of). I'm using about 2% CPU and 10% RAM. The only thing out of the ordinary is that yesterday, my fan started making a bad sounding noise, and it kind of switches between on (making a grinding sound) for 30 seconds, and off for 30 seconds. But my processor is still fairly cool (the fan used to blow cold air consistently, and I don't think the issues are related. Crunchbang/Debian Linux, kernel 3.10-3-amd64
They are probably very related. STOP USING THAT COMPUTER UNTIL YOU FIX THE FAN It can only take milliseconds for the CPU to go from "OK" to "OMG I melted". They should never be used with out proper cooling. To do so, will cause damage, and could cause a fire, injury, and all manor of bad things. That warning aside Linux and most semi-modern computers have a kind of protection built in that "throttles" the CPU when temperatures get too high. That is what is likely causing your "stuttering".
Linux randomly freezing?
1,509,752,415,000
I have this rule which runs a script to send me an email whenever a drive drops out of the system: SUBSYSTEM=="block", ACTION=="remove", ENV{DEVTYPE}=="disk",\ RUN="/usr/sbin/disk-monitor.sh $env{DEVNAME}" This is the script: #!/bin/bash echo "Dropout detected $(date)" | mail -s "WARNING: Drive $1 has dropped out!" logger@gentooserver It causes certain cryptsetup commands to freeze like "cryptsetup close" and "integritysetup format". Why does this happen? cryptsetup --debug close offline1 # cryptsetup 2.4.3 processing "cryptsetup --debug close offline1" # Running command close. # Locking memory. # Installing SIGINT/SIGTERM handler. # Unblocking interruption on signal. # Allocating crypt device context by device offline1. # Initialising device-mapper backend library. # dm version [ opencount flush ] [16384] (*1) # dm versions [ opencount flush ] [16384] (*1) # Detected dm-ioctl version 4.47.0. # Detected dm-crypt version 1.24.0. # Detected dm-integrity version 1.10.0. # Device-mapper backend running with UDEV support enabled. # dm status offline1 [ opencount noflush ] [16384] (*1) # Releasing device-mapper backend. # Trying to open and read device /dev/sdk1 with direct-io. # Allocating context for crypt device /dev/sdk1. # Trying to open and read device /dev/sdk1 with direct-io. # Initialising device-mapper backend library. # dm versions [ opencount flush ] [16384] (*1) # dm table offline1 [ opencount flush securedata ] [16384] (*1) # Trying to open and read device /dev/sdk1 with direct-io. # dm versions [ opencount flush ] [16384] (*1) # dm deps offline1 [ opencount flush ] [16384] (*1) # Crypto backend (OpenSSL 1.1.1t 7 Feb 2023) initialized in cryptsetup library version 2.4.3. # Detected kernel Linux 6.1.12-gentoo-x86_64 x86_64. # Reloading LUKS2 header (repair disabled). # Acquiring read lock for device /dev/sdk1. # Opening lock resource file /run/cryptsetup/L_8:161 # Verifying lock handle for /dev/sdk1. # Device /dev/sdk1 READ lock taken. # Trying to read primary LUKS2 header at offset 0x0. # Opening locked device /dev/sdk1 # Verifying locked device handle (bdev) # LUKS2 header version 2 of size 16384 bytes, checksum sha256. # Checksum:a4bc53825c88a45b53709738107a718a9c4f896dfef90951cfd9d9cfe68dd259 (on-disk) # Checksum:a4bc53825c88a45b53709738107a718a9c4f896dfef90951cfd9d9cfe68dd259 (in-memory) # Trying to read secondary LUKS2 header at offset 0x4000. # Reusing open ro fd on device /dev/sdk1 # LUKS2 header version 2 of size 16384 bytes, checksum sha256. # Checksum:ca42f7c96748267f126f3ab48536dee1a05525aa1db10a1feb85a5a60e3338e8 (on-disk) # Checksum:ca42f7c96748267f126f3ab48536dee1a05525aa1db10a1feb85a5a60e3338e8 (in-memory) # Device size 4000785964544, offset 16777216. # Device /dev/sdk1 READ lock released. # PBKDF argon2id, time_ms 2000 (iterations 0), max_memory_kb 1048576, parallel_threads 4. # Deactivating volume offline1. # dm versions [ opencount flush ] [16384] (*1) # dm status offline1 [ opencount noflush ] [16384] (*1) # dm versions [ opencount flush ] [16384] (*1) # dm table offline1 [ opencount flush securedata ] [16384] (*1) # Trying to open and read device /dev/sdk1 with direct-io. # dm versions [ opencount flush ] [16384] (*1) # dm deps offline1 [ opencount flush ] [16384] (*1) # dm versions [ opencount flush ] [16384] (*1) # dm table offline1 [ opencount flush securedata ] [16384] (*1) # dm versions [ opencount flush ] [16384] (*1) # Udev cookie 0xd4d82bf (semid 5) created # Udev cookie 0xd4d82bf (semid 5) incremented to 1 # Udev cookie 0xd4d82bf (semid 5) incremented to 2 # Udev cookie 0xd4d82bf (semid 5) assigned to REMOVE task(2) with flags DISABLE_LIBRARY_FALLBACK (0x20) # dm remove offline1 [ opencount flush retryremove ] [16384] (*1) # Udev cookie 0xd4d82bf (semid 5) decremented to 1 # Udev cookie 0xd4d82bf (semid 5) waiting for zero //hangs here udev log: Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: dm-2: Device is queued (SEQNUM=4516, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: dm-2: Device ready for processing (SEQNUM=4516, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: Successfully forked off 'n/a' as PID 8410. Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: dm-2: Worker [8410] is forked for processing SEQNUM=4516. Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: 252:2: Device is queued (SEQNUM=4517, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: 252:2: Device ready for processing (SEQNUM=4517, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Processing device (SEQNUM=4516, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Removing watch handle 50. Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: Successfully forked off 'n/a' as PID 8411. Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: 252:2: Worker [8411] is forked for processing SEQNUM=4517. Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: dm-2: Device is queued (SEQNUM=4518, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: dm-2: SEQNUM=4518 blocked by SEQNUM=4516 Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: /usr/lib/udev/rules.d/95-dm-notify.rules:12 RUN '/sbin/dmsetup udevcomplete $env{DM_COOKIE}' Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: /usr/lib/udev/rules.d/disk-monitor.rules:4 RUN '/usr/sbin/disk-monitor.sh $env{DEVNAME}' Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: No reference left for '/dev/mapper/offline1', removing Feb 26 18:51:38 gentoodesktop systemd-udevd[8411]: 252:2: Processing device (SEQNUM=4517, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: No reference left for '/dev/disk/by-id/dm-name-offline1', removing Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: No reference left for '/dev/disk/by-id/dm-uuid-CRYPT-LUKS2-f2eafcc2880e4d34afa3132486d1d6ae-offline1', removing Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: No reference left for '/dev/disk/by-uuid/5d5633e2-2f7c-49de-babf-f3ed263a3c8b', removing Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Running command "/usr/sbin/disk-monitor.sh /dev/dm-2" Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Starting '/usr/sbin/disk-monitor.sh /dev/dm-2' Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: Successfully forked off '(spawn)' as PID 8412. Feb 26 18:51:38 gentoodesktop systemd-udevd[8411]: 252:2: Device processed (SEQNUM=4517, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[8411]: 252:2: sd-device-monitor(worker): Passed 167 byte to netlink monitor. Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Process '/usr/sbin/disk-monitor.sh /dev/dm-2' succeeded. Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Device processed (SEQNUM=4516, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: sd-device-monitor(worker): Passed 963 byte to netlink monitor. Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: dm-2: Device ready for processing (SEQNUM=4518, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: dm-2: sd-device-monitor(manager): Passed 230 byte to netlink monitor. Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Processing device (SEQNUM=4518, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Removing watch handle -1. Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: /usr/lib/udev/rules.d/disk-monitor.rules:4 RUN '/usr/sbin/disk-monitor.sh $env{DEVNAME}' Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Running command "/usr/sbin/disk-monitor.sh /dev/dm-2" Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Starting '/usr/sbin/disk-monitor.sh /dev/dm-2' Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: Successfully forked off '(spawn)' as PID 8419. Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Process '/usr/sbin/disk-monitor.sh /dev/dm-2' succeeded. Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: Device processed (SEQNUM=4518, ACTION=remove) Feb 26 18:51:38 gentoodesktop systemd-udevd[8410]: dm-2: sd-device-monitor(worker): Passed 230 byte to netlink monitor. Feb 26 18:51:38 gentoodesktop systemd-udevd[7823]: No events are queued, removing /run/udev/queue. Feb 26 18:51:42 gentoodesktop systemd-udevd[7823]: Cleanup idle workers Feb 26 18:51:42 gentoodesktop systemd-udevd[8411]: Unload kernel module index. Feb 26 18:51:42 gentoodesktop systemd-udevd[8410]: Unload kernel module index. Feb 26 18:51:42 gentoodesktop systemd-udevd[8410]: Unloaded link configuration context. Feb 26 18:51:42 gentoodesktop systemd-udevd[8411]: Unloaded link configuration context. Feb 26 18:51:42 gentoodesktop systemd-udevd[7823]: Worker [8411] exited. Feb 26 18:51:42 gentoodesktop systemd-udevd[7823]: Worker [8410] exited. Feb 26 18:51:46 gentoodesktop systemd-udevd[7823]: Cleanup idle workers
I think the problem here is that your RUN=script directive overrides an existing one, which was necessary for dmcrypt to work properly. Try whether using RUN+="/usr/sbin/disk-monitor.sh $env{DEVNAME}" works better (notice the +). Is it really DEVNAME, too? man udev tells me about $dev and $devpath and $devnode, but not about the DEVNAME property a block device might have.
Why does this udev rule cause cryptsetup to freeze?
1,509,752,415,000
My system failed to boot several times today. After completely disconnecting it from power, I managed to get it back on, luckily, but I'd like to comprehend what has happened. From a user's point of view, it was like this: I turn on the PC, the fans are noisier than usual and the boot process would get stuck sometimes at the boot screen, sometimes after GRUB and sometimes in the short timespan where the image of my graphics card is displayed. I checked the journal and discovered the following lines that didn't appear before. Here's the complete journal entry of one of the failed boots. The other entries look similar. -- Boot 4c3326651829453c89c08358e88b8071 -- Jan 22 01:42:53 hostname kernel: Linux version 5.10.9-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Tue, 19 Jan 2021 22:06:06 +0000 Jan 22 01:42:53 hostname kernel: Command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=d825234f-4397-494f-9c61-e719a008ecbd rw loglevel=3 quiet Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input15 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input16 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input17 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input18 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input19 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=11 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input20 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=12 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input21 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Front Mic as /devices/pci0000:00/0000:00:14.2/sound/card0/input22 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Rear Mic as /devices/pci0000:00/0000:00:14.2/sound/card0/input23 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Line as /devices/pci0000:00/0000:00:14.2/sound/card0/input24 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Line Out as /devices/pci0000:00/0000:00:14.2/sound/card0/input25 Jan 22 01:38:09 hostname audit[425]: NETFILTER_CFG table=filter family=10 entries=144 op=xt_replace pid=425 comm="ip6tables-resto" Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Front Headphone as /devices/pci0000:00/0000:00:14.2/sound/card0/input26 Jan 22 01:38:09 hostname kernel: EDAC amd64: F15h detected (node 0). Jan 22 01:38:09 hostname kernel: EDAC amd64: Error: F1 not found: device 0x1601 (broken BIOS?) Jan 22 01:38:09 hostname audit[426]: NETFILTER_CFG table=filter family=10 entries=160 op=xt_replace pid=426 comm="ip6tables-resto" Jan 22 01:38:09 hostname systemd-udevd[258]: controlC0: Process '/usr/bin/alsactl restore 0' failed with exit code 99. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in First Boot Wizard being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in File System Check on Root Device being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in Repartition Root Disk being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in Create System Users being skipped. Jan 22 01:38:09 hostname audit[435]: NETFILTER_CFG table=filter family=10 entries=168 op=xt_replace pid=435 comm="ip6tables-resto" Jan 22 01:38:09 hostname kernel: EDAC amd64: F15h detected (node 0). Jan 22 01:38:09 hostname kernel: EDAC amd64: Error: F1 not found: device 0x1601 (broken BIOS?) Jan 22 01:38:09 hostname systemd[1]: Finished CLI Netfilter Manager. Jan 22 01:38:09 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=ufw comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Jan 22 01:38:09 hostname kernel: EDAC amd64: F15h detected (node 0). Jan 22 01:38:09 hostname kernel: EDAC amd64: Error: F1 not found: device 0x1601 (broken BIOS?) Jan 22 01:38:10 hostname kernel: nvidia: module license 'NVIDIA' taints kernel. Jan 22 01:38:10 hostname kernel: Disabling lock debugging due to kernel taint Jan 22 01:38:10 hostname kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 237 Jan 22 01:38:10 hostname kernel: Jan 22 01:38:10 hostname kernel: nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem Jan 22 01:38:10 hostname kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 460.32.03 Sun Dec 27 19:00:34 UTC 2020 Jan 22 01:38:10 hostname systemd-udevd[267]: controlC1: Process '/usr/bin/alsactl restore 1' failed with exit code 99. Jan 22 01:38:10 hostname systemd[1]: Condition check resulted in First Boot Wizard being skipped. Jan 22 01:38:10 hostname systemd[1]: Condition check resulted in File System Check on Root Device being skipped. Jan 22 01:38:10 hostname systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped. Jan 22 01:38:10 hostname systemd[1]: Condition check resulted in Repartition Root Disk being skipped. Jan 22 01:38:10 hostname systemd[1]: Condition check resulted in Create System Users being skipped. Jan 22 01:38:10 hostname kernel: random: crng init done Jan 22 01:38:10 hostname kernel: random: 7 urandom warning(s) missed due to ratelimiting Jan 22 01:38:10 hostname systemd[1]: Finished Load/Save Random Seed. Jan 22 01:38:10 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-random-seed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Jan 22 01:38:10 hostname systemd[1]: Condition check resulted in First Boot Complete being skipped. Jan 22 01:38:10 hostname kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 460.32.03 Sun Dec 27 18:51:11 UTC 2020 Jan 22 01:38:10 hostname kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver Jan 22 01:38:10 hostname kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0 Jan 22 01:38:10 hostname systemd[1]: Created slice system-systemd\x2dbacklight.slice. Jan 22 01:38:10 hostname systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:acpi_video0... Jan 22 01:38:10 hostname systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:acpi_video0. Jan 22 01:38:10 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-backlight@backlight:acpi_video0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termi> Jan 22 01:38:18 hostname kernel: ata2: softreset failed (1st FIS failed) Jan 22 01:38:28 hostname kernel: ata2: softreset failed (1st FIS failed) Note the timestamps. These jumps back to the past happened several times. Is that normal behavior or already an indication for problems? I learned that they should always be in the correct time sequence. When I closed and reopened the journal, the journal entries were ordered correctly though, regarding their timestamps. The very first boot entry of this failing series is far longer (probably due to the soft reset). I noticed the following entries in addition to the above: Jan 22 01:38:08 hostname kernel: ACPI BIOS Warning (bug): Optional FADT field Pm2ControlBlock has valid Length but zero Address: 0x0000000000000000/0x1 (20200925/tbfadt-615) ... Jan 22 01:38:08 hostname kernel: ata2.00: exception Emask 0x0 SAct 0x30000 SErr 0x0 action 0x6 Jan 22 01:38:08 hostname kernel: ata2.00: irq_stat 0x40000008 Jan 22 01:38:08 hostname kernel: ata2.00: failed command: READ FPDMA QUEUED Jan 22 01:38:08 hostname kernel: ata2.00: cmd 60/78:80:88:00:00/00:00:00:00:00/40 tag 16 ncq dma 61440 in res 43/84:78:f0:00:00/00:00:00:00:00/00 Emask 0x410 (ATA bus error) <F> Jan 22 01:38:08 hostname kernel: ata2.00: status: { DRDY SENSE ERR } Jan 22 01:38:08 hostname kernel: ata2.00: error: { ICRC ABRT } Jan 22 01:38:08 hostname kernel: ata2: hard resetting link Jan 22 01:38:08 hostname kernel: ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Jan 22 01:38:08 hostname kernel: ata2.00: NCQ Send/Recv Log not supported Jan 22 01:38:08 hostname kernel: ata2.00: NCQ Send/Recv Log not supported Jan 22 01:38:08 hostname kernel: ata2.00: configured for UDMA/133 Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=1s Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 Sense Key : Aborted Command [current] Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 Add. Sense: Scsi parity error Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 CDB: Read(10) 28 00 00 00 00 88 00 00 78 00 Jan 22 01:38:08 hostname kernel: blk_update_request: I/O error, dev sdb, sector 136 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0 I suspect the power cord as the culprit as I remember having had boot problems before that I could fix with reconnecting the power cord. Is there anyone here that can help me understand these logs better. I am especially curious about the entries that refer to the BIOS. Without knowing the circumstances, what information can you extract from that?
You have a modern multi-core processor and your distribution uses systemd. As a result, at boot time, many things will happen in parallel, sometimes with no fixed ordering. Some of the log messages might be slightly out of order with each other, if they used different routes (native systemd journaling vs. the kernel's audit subsystem vs. the syslog system calls). I'll go through the messages in mostly-sequential order, but grouping some similar messages together. Jan 22 01:42:53 hostname kernel: Linux version 5.10.9-arch1-1 (linux@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Tue, 19 Jan 2021 22:06:06 +0000 Jan 22 01:42:53 hostname kernel: Command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=d825234f-4397-494f-9c61-e719a008ecbd rw loglevel=3 quiet These are normally the very first lines the Linux kernel outputs right after the it has begun executing. At this point, the system clock is just using the time value the system firmware initialized it to, which usually originates from the battery-backed clock chip. Note the loglevel=3 quiet kernel options: these will silence a lot of early boot messages, so quite a lot can happen after this and before the next messages. Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input15 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input16 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input17 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input18 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input19 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=11 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input20 Jan 22 01:38:09 hostname kernel: input: HDA NVidia HDMI/DP,pcm=12 as /devices/pci0000:00/0000:00:02.1/0000:01:00.1/sound/card1/input21 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Front Mic as /devices/pci0000:00/0000:00:14.2/sound/card0/input22 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Rear Mic as /devices/pci0000:00/0000:00:14.2/sound/card0/input23 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Line as /devices/pci0000:00/0000:00:14.2/sound/card0/input24 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Line Out as /devices/pci0000:00/0000:00:14.2/sound/card0/input25 Jan 22 01:38:09 hostname kernel: input: HD-Audio Generic Front Headphone as /devices/pci0000:00/0000:00:14.2/sound/card0/input26 These messages are from the input subsystem registering the plug detection circuits on various audio connectors as inputs. This means the actual sound drivers have already been loaded at this point. Sound chips are not usually considered "essential hardware", so their drivers are not typically built into the kernel and not always even included in the initramfs, so at this point we are probably quite a bit farther along the boot process. It is possible that the boot process may have already activated the network interface(s) and fetched more accurate time information from an NTP server, which might explain the apparent time jump backwards. Or the boot process might take the time of the last disk write operation as the best guess of the current time, if no battery-backed clock is available and NTP servers cannot be reached yet. Jan 22 01:38:09 hostname audit[425]: NETFILTER_CFG table=filter family=10 entries=144 op=xt_replace pid=425 comm="ip6tables-resto" Jan 22 01:38:09 hostname audit[426]: NETFILTER_CFG table=filter family=10 entries=160 op=xt_replace pid=426 comm="ip6tables-resto" Jan 22 01:38:09 hostname audit[435]: NETFILTER_CFG table=filter family=10 entries=168 op=xt_replace pid=435 comm="ip6tables-resto" Something (probably ip6tables-restore) is causing IPv6 netfilter rules to be added. Jan 22 01:38:09 hostname kernel: EDAC amd64: F15h detected (node 0). Jan 22 01:38:09 hostname kernel: EDAC amd64: Error: F1 not found: device 0x1601 (broken BIOS?) These messages are from the EDAC (Error Detection And Correction) subsystem. It's mostly useful on systems with ECC error-correcting memory only (i.e. servers and possibly high-grade workstations). Your processor seems to have the necessary features to work with ECC memory, but your system firmware apparently does not have the necessary information for the EDAC subsystem to map memory/bus errors to a physical component (e.g. a memory module slot). Perhaps your motherboard is not capable of using ECC memory? If that's true, then the EDAC subsystem might not be useful to you, and you could blacklist the EDAC modules to skip loading them at all. Jan 22 01:38:09 hostname systemd-udevd[258]: controlC0: Process '/usr/bin/alsactl restore 0' failed with exit code 99. Jan 22 01:38:10 hostname systemd-udevd[267]: controlC1: Process '/usr/bin/alsactl restore 1' failed with exit code 99. For some reason, the attempts to restore sound card volume settings failed for both the motherboard's integrated sound chip and the GPU's HDMI/DP connectors. Perhaps because alsactl store has never been used to persistently store the current settings? This might be important only if you use raw ALSA and/or text mode: most GUI desktop environments and/or Pulseaudio will usually override the ALSA volume settings by user-specific settings anyway. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in First Boot Wizard being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in File System Check on Root Device being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in Rebuild Hardware Database being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in Repartition Root Disk being skipped. Jan 22 01:38:09 hostname systemd[1]: Condition check resulted in Create System Users being skipped. systemd is skipping some conditional boot items, as the requisite conditions are not satisfied. Jan 22 01:38:10 hostname kernel: nvidia: module license 'NVIDIA' taints kernel. Jan 22 01:38:10 hostname kernel: Disabling lock debugging due to kernel taint Jan 22 01:38:10 hostname kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 237 Jan 22 01:38:10 hostname kernel: Jan 22 01:38:10 hostname kernel: nvidia 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem Jan 22 01:38:10 hostname kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module 460.32.03 Sun Dec 27 19:00:34 UTC 2020 The proprietary NVIDIA GPU driver is being loaded. Jan 22 01:38:10 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-random-seed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' This looks like the root filesystem is mounted and the "real" systemd start-up is confirmed by the audit subsystem. Before this point, the boot process was handled by a "mini-systemd" within the initramfs. This might explain why some messages seem to be repeated: the initramfs mini-systemd made those checks once, and now the real systemd does them again. Jan 22 01:38:10 hostname kernel: random: crng init done Jan 22 01:38:10 hostname kernel: random: 7 urandom warning(s) missed due to ratelimiting Jan 22 01:38:10 hostname systemd[1]: Finished Load/Save Random Seed. systemd has restored the random seed from the last startup or orderly shutdown. Jan 22 01:38:10 hostname kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms 460.32.03 Sun Dec 27 18:51:11 UTC 2020 Jan 22 01:38:10 hostname kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver Jan 22 01:38:10 hostname kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0 More components of the proprietary NVIDIA GPU driver are being started. Jan 22 01:38:10 hostname systemd[1]: Created slice system-systemd\x2dbacklight.slice. Jan 22 01:38:10 hostname systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:acpi_video0... Jan 22 01:38:10 hostname systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:acpi_video0. Jan 22 01:38:10 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-backlight@backlight:acpi_video0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? termi> The firmware ACPI tables include a backlight control interface, and systemd is starting up a service that remembers the current backlight setting from one boot to the next. Jan 22 01:38:18 hostname kernel: ata2: softreset failed (1st FIS failed) Jan 22 01:38:28 hostname kernel: ata2: softreset failed (1st FIS failed) This suggests problems with the second SATA device. Your second snippet seems to have more information about this. From the second snippet: Jan 22 01:38:08 hostname kernel: ACPI BIOS Warning (bug): Optional FADT field Pm2ControlBlock has valid Length but zero Address: 0x0000000000000000/0x1 (20200925/tbfadt-615) Your ACPI system firmware has incomplete power management information. A BIOS update might fix this, but since it's just a warning, the kernel can live with the problem. Jan 22 01:38:08 hostname kernel: ata2.00: exception Emask 0x0 SAct 0x30000 SErr 0x0 action 0x6 Jan 22 01:38:08 hostname kernel: ata2.00: irq_stat 0x40000008 Jan 22 01:38:08 hostname kernel: ata2.00: failed command: READ FPDMA QUEUED Jan 22 01:38:08 hostname kernel: ata2.00: cmd 60/78:80:88:00:00/00:00:00:00:00/40 tag 16 ncq dma 61440 in res 43/84:78:f0:00:00/00:00:00:00:00/00 Emask 0x410 (ATA bus error) <F> Jan 22 01:38:08 hostname kernel: ata2.00: status: { DRDY SENSE ERR } Jan 22 01:38:08 hostname kernel: ata2.00: error: { ICRC ABRT } Jan 22 01:38:08 hostname kernel: ata2: hard resetting link Jan 22 01:38:08 hostname kernel: ata2: SATA link up 6.0 Gbps (SStatus 133 SControl 300) Jan 22 01:38:08 hostname kernel: ata2.00: NCQ Send/Recv Log not supported Jan 22 01:38:08 hostname kernel: ata2.00: NCQ Send/Recv Log not supported Jan 22 01:38:08 hostname kernel: ata2.00: configured for UDMA/133 Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE cmd_age=1s Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 Sense Key : Aborted Command [current] Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 Add. Sense: Scsi parity error Jan 22 01:38:08 hostname kernel: sd 1:0:0:0: [sdb] tag#16 CDB: Read(10) 28 00 00 00 00 88 00 00 78 00 Jan 22 01:38:08 hostname kernel: blk_update_request: I/O error, dev sdb, sector 136 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0 This indicates a data transfer error from your /dev/sdb disk. This might be caused by a bad SATA cable or connector, so you might first try moving the disk to a different SATA port or replacing the cable first. If those things won't help, it might be necessary to replace the disk. If the fault seems to come and go, make an extra backup of that disk ASAP.
How to read these journal entries after failed boot?
1,509,752,415,000
I have Debian 10 Buster installed on my Acer Nitro AN515-51 laptop (dual boot with Windows 10). These are the system specs: Graphics: Nvidia GeForce GTX 1050 ( 4GB VRAM); Intel UHD Graphics 630. RAM: 8GB SDRAM (DDR4) lscpu | grep -i model reports this: Model: 158 Model name: Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz uname -a reports this: Linux rpl-pc 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux lspci -k | grep -EA3 'VGA|3D|Display' reports this: 00:02.0 VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04) Subsystem: Acer Incorporated [ALI] HD Graphics 630 Kernel driver in use: i915 Kernel modules: i915 -- 01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile] (rev a1) Subsystem: Acer Incorporated [ALI] GP107M [GeForce GTX 1050 Ti Mobile] Kernel modules: nouveau 02:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32) The Problem: When I type sudo apt-get upgrade I get the following output into my terminal (I only copy/pasted the last few lines where the error occurs): Preparing to unpack .../nvidia-legacy-check_418.113-1_amd64.deb ... Checking for legacy NVIDIA GPUs appears to hang, try rebooting with 'acpi=off' added to the kernel boot options in the GRUB configuration. Then the terminal appears to freeze and I can't Ctrl-C out of it. The same issue occurs when I try to install a program through the command line (e.g. sudo apt-get install vim) Why am I getting these errors? Is this related to the fact that I was never able to get my computer to reboot properly and it freezes every time I go to the Start Menu to Leave and either Reboot or Shutdown? I have to hold down the power button and manually shut down. I have no other issues with Debian 10 Buster so far. EDIT: I was able to execute sudo apt-get upgrade as well as install vim successfully by turning acpi off temporarily through the GRUB menu. It also reboots/shuts down properly through the GUI. However I still can't figure out how to get my computer to reboot the proper way via the GUI without acpi=off. I don't want to turn acpi off permanently because according to this post, it's not recommended to do that if you have a laptop. It does lead me to believe it's an ACPI issue though. I tried the following methods: Editing /etc/default/grub as follows: GRUB_CMDLINE_LINUX_DEFAULT="splash quiet noefi reboot=pci" then running: sudo update-grub /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="splash quiet acpi=force apm=power_off and /etc/modules: apm power_off=1 then sudo update-grub Deleting splash and quiet from the grub file Disabling nouveau kernel driver as described here: https://askubuntu.com/questions/841876/how-to-disable-nouveau-kernel-driver However, none of these methods worked. I am booting in UEFI mode. Does anyone have other suggestions I can try? EDIT 2 After doing a fresh install of Debian Buster, I ran into the same issue. I even updated the Linux kernel. In fact, on top of the rebooting issue, my computer froze whenever I opened Firefox. I ended up fixing these issues by disabling the nouveau kernel drivers. I also installed the proprietary NVIDIA GPU drivers, but as of this update, I have not gotten them to load yet, so disabling the nouveau kernel drivers was enough. Hopefully, this will help someone else out there who experienced the same issues as I did.
Unfortunately this is still too unspecific to give you a definitive answer but here are some things you can try: Check the system log files by running sudo less /var/log/syslog and sudo less /var/log/kern.log. Look for messages related to ACPI or your NVIDIA drivers. Maybe it contains some errors that point you into the right direction? Be sure to search the Web for these errors. The Linux kernel accepts a ton of parameters related to ACPI. Try disabling ACPI partially (e.g. acpi=noirq or pci=noacpi) to figure out which part of ACPI you are having problems with. Maybe power consumption is still acceptable? Many issues related to power management are caused by firmware bugs that are discovered and fixed after vendors started selling their devices. Check the vendor's website to see if BIOS updates are available for your machine. Using the proprietary NVIDIA driver can be quite a hassle. Many Linux users decide to stick to open-source drivers that often offer less performance but better compatibility with the rest of your Linux system. If that's not an option for you, you might want to tap into the experience of others running these drivers. The Debian Wiki provides some information on NVIDIA drivers. Note that it mentions a newer version that is available from the buster backports repository. Maybe that helps? Your laptop seems to be a pretty new model. Try a distribution like Ubuntu or Fedora that comes with a more recent kernel and drivers. Booting a live system from a thumb drive might be sufficient for testing.
Debian 10 Buster hangs when I try to reboot/shut down