date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,542,262,746,000 |
I have two files:
File1.txt:
510806153|1||||33245|65|6236067806|25001|7746250
510806153|1||||33245|65|6968349321|25001|8956584
File2.txt
510806153|||||
When I do join -t \| -j 1 file1.txt file2.txt,
I get this output:
|||||6153|1||||33245|65|6236067806|25001|7746250
|||||6153|1||||33245|65|6968349321|25001|8956584
... |
It looks like file1.txt has CRLF line endings.
| Bash Join command inserting delimiter characters into first element |
1,542,262,746,000 |
I have ansbile inv
# cat inv
[all]
vm1
vm2
I want to extract them in a comma delimited list using Jinja template
so I add jinja template
# cat comb_list.j2
{{ groups['all'] | map('extract', hostvars, ['item']) | join(',') }}"
but I guess item is not a hostvars, so throws error
I want end file to look like this
# ca... |
The template
shell> cat comb_list.j2
{{ groups.all|join(',') }}
and the playbook
shell> cat playbook.yml
- hosts: all
gather_facts: false
tasks:
- template:
src: comb_list.j2
dest: comb_list
delegate_to: localhost
run_once: true
gives
shell> ansible-playbook -i inv playbook.yml
..... | how to join inventory items in a comma delimited list? |
1,542,262,746,000 |
I would like to merge two files, which share some common data. File 1 includes more than file 2. I want to merge the files based on their shared column following the order of file 1 and I want to add 0 to column 5 (AN1) when the variable is not present in file 2.
My files look like this:
File 1
CHR BP SNP CM base
20... |
awk 'NR==FNR{ snp[$3]; next }
{ $6=($3 in snp)?(FNR==1?"AN1":"1"):"0" }1' file2 file1
| merging two files according to a common column and add 0 to those which are not present in file 2 |
1,542,262,746,000 |
var $abc contains:
abc jkl
def mno
ghi pqr
var $def contains:
stu
vwx
yz
Expected output:
abc jkl stu
def mno vwx
ghi pqr yz
heemayl's solution:
I tried paste <(echo "$abc") <(echo "$def") but it is giving output as below
ASFSFGFGGRRFDFFFFFH 33566
AHSHDFFBORDASHFYEHFYUCH 33568
FASFSSFHJUYRT 33371
FA... |
Using paste, with help from process substitution to get two file descriptors for paste to operate on:
paste <(echo "$abc") <(echo "$def")
Be careful with the quoting of the variables.
Example:
$ echo "$abc"
abc jkl
def mno
ghi pqr
$ echo "$def"
stu
vwx
yz
$ paste <(echo "$abc") <(echo "$def")
abc jkl stu
def mno vw... | Join multiple columns from multiple variables? [duplicate] |
1,542,262,746,000 |
With the following two simple files:
a.txt
1 a
2 b
5 c
b.txt
2 x
4 y
5 z
The following command does not behave like expected:
$ join -a 1 -a 2 -e 0 a.txt b.txt
1 a
2 b x
4 y
5 c z
I would expect the option -e 0 to fill up missing values with zeroes. However, the following does work:
$ join -a 1 -a 2 -e 0 -o auto a... |
Well, this has been filed as a formal report there. The answer is that there is a connection between -e and -o, which is explained in the info join page. A patch has been released to also clarify it in the man info page.
| Why do I need to specify `-o auto` for join's `-e` option to work? |
1,542,262,746,000 |
I have a tab-delimited file like shown below, and would like to merge the rows based on matches in any of the columns. The number of columns are usually 2, but could vary in some cases and be 3.
input:
AMAZON NILE
ALASKA NILE
HELLO MY
MANGROVE AMAZON
MY NAME
IS NAME
desired output:
AMAZON NILE ALASKA MANGROVE
HELLO ... |
Using GNU awk
gawk '
{
grp = 0
# see if any of these words already have a group
for (i=1; i<=NF; i++) {
if (group[$i]) {
grp = group[$i]
break
}
}
# no words have been seen before: new group
if (!grp) {
... | Merge rows using common values in any column |
1,542,262,746,000 |
I have multiple text files like below:
file1.txt:
# Program:featureCounts v1.6.0; Command:"featureCounts" "-a" "/documents/gencode_Release27_GRCh38.p10_PRI/gencode.v27.primary_assembly.annotation_nochr.gtf" "-F" "GTF" "-p" "-s" "2" "-T" "8" "-o" "/read_counts/S100A.txt" "/documents/S100A.sorted.bam"
Geneid Chr S... |
Awk solution:
awk 'BEGIN{ head = "Geneid" }
FNR == 2{
gsub(/^.+documents\/|\.sorted\.bam$/, "", $NF);
head = head "\t" $NF
}
FNR > 2{
genes[$1] = genes[$1] "\t" $NF;
order[FNR-2] = $1
}
END{
print head;
for (i = 1; i <= FNR-2; i++) pri... | How to join text files based on a column and removing the first line in linux? |
1,542,262,746,000 |
file1 :
HOUSAM1189870 3 0.00 0 -2450.00 11
HOUSAM1213135 3 0.00 0 -2620.00 2
HOCANM245675 3 0.00 0 0.00 0
HOUSAM1239242 3 0.00 0 -3113.00 8
file2 :
AY840F3001138842 20050301
AY840F3001140253 20060101
HOCANM245675 34409887 ... |
(note: this answer was written before the question was updated with the join command and the error messages)
the command is called join.
from the man page:
join - join lines of two files on a common field
since your input files are not sorted you need to sort them first
join <(sort file1) <(sort file2)
the <(...) t... | How to join 2 files based on common rows of first columns? |
1,542,262,746,000 |
I'm writing a bash script and part of the process requires to piece csv files together whilst preserving the integrity of the columns; for example I have two files in the following format:
F1
ID,MD,L1,L2,L3,GD,L4
12,OB,AA,PP,AA,TT,AA
15,OB,PP,PP,PP,TT,AA
F2
ID,MD,L7,L8,L9,L10,GD
13,OB,PP,AA,AA,AA,AA
15,OB,PP,PP,PP,AA... |
You could use a shell script to create the necessary -o options for you and to sort the data of your input files.
This assumes that the second field MD is present in both input files and only printed once in the output (skipped in the options for the second file).
#!/bin/bash
opts="0,"
# file1: get number of columms... | Merge CSV Files based on ID even when Unmatched IDS and Indefinite Number of Columns |
1,542,262,746,000 |
I have a text file like this
sp|QBWMM1-2|PDCI_Mouse(741-770) 8864=mil (25/2.20/2.50)
sp|Pm345|Hisf_Mouse(613-640) 776=mil (25/2.20/2.50)
sp|P0065-2|Hila_Mouse(344-393)6543=mil (25/2.20/2.50)
sp|Q90081|Rira_Mouse(47-72) 7365=mil (25/2.20/2.50)
sp|QQQQQ1|Ubs_Mouse(162-190) 22=mil (25/2.20/2.50)
I have another text fil... |
If file1 is your first text file, and file2 is your second text file, this should work in Bash:
join -a 1 <(sort -k1,1 file2) <(sed -E -e 's/([^\s])\(/\1 (/' file1 | sort -k1,1)
Join is called with two files as arguments, which two files (anonymous pipes or FIFOs actually) are the result of two process substitutions ... | how can I merge two text files together |
1,542,262,746,000 |
I have 70 directories that have files like below:
STAN002
|______ STAN002_sasions.tsv
PTAN044
|______ PTAN044_sasions.tsv
STAN005
|______ STAN005_sasions.tsv
STAN050
|______ STAN050_sasions.tsv
QRED034
|______ QRED034_sasions.tsv
.
.
.
PREC098
|______ PREC098_sasions.tsv
Each of the .tsv file which ... |
Your script is failing because you aren't specifying FS or OFS and you're using $NF instead of $2 to identify the 2nd field (and using "-" when you wanted "--" but that's nbd).
You were close though, try this:
$ awk 'BEGIN{FS=OFS="\t"} {print $0, $1 "--" $2}' STAN002_sasions.tsv
#gene1 gene2 #gene1--gene2
VAV1 T... | How to create a new column in tsv files by combining two other columns on linux? |
1,542,262,746,000 |
I would like to merge two tables like this
Table_1
Chr1 5
Chr1 10
Chr1 20
Chr2 10
Chr2 30
Table_2
Chr1 10 value value2
Chr1 20 value value2
Chr2 30 value value2
Desired output
Chr1 5
Chr1 10 value value2
Chr1 20 value value2
Chr2 10
Chr2 30 value value2
I have found scripts in awk to merge tables conserving only ro... |
$ awk '{ key = $1 FS $2 };
NR == FNR { t[key] = $0; next };
key in t { print t[key]; next };
1' table2.txt table1.txt
Chr1 5
Chr1 10 value value2
Chr1 20 value value2
Chr2 10
Chr2 30 value value2
On every input line read (for both files read), the variable key is set to the first two fields ($1 ... | Join two tables based on two columns in common and add NA or empty values if does not match |
1,542,262,746,000 |
I know there are some posts to join multiple files but it took so much time. I have multiple files in which the first columns are for the patients' IDs, then I want to join multiple files, based on the ID numbers in the first column.
The codes as below still work, but it took so much time. Thus, does anybody know more... |
OK. This is not an answer per se, but a post to perhaps clarify things.
Incorporate what you need into your question.
(And sorry, know it is not how things are normally done, but ...)
Does this resemble your files and needed result?
Here are two sample scripts. The first to generate dummy files:
chr1_A to chr6_A
chr... | join multiple files efficiently |
1,542,262,746,000 |
Is it possible to send the values as stored in variables instead of file2 file1. Kindly let me know how to pass the variables in the above-mentioned query. I tried to pass the variables into the query, but the variables store the value as a single row and I couldn't get the required output.
Thanks for the respon... |
You just need to change a[$1] = $2 to a[$2] = $1, so:
awk 'NR == FNR{ a[$2] = $1; next }; { print $1, $1 in a?a[$1]: "0" }' file2 file1
However that can be shortened to just:
awk 'NR == FNR{ a[$2] = $1; next } { print $1, a[$1]+0 }' file2 file1
Update: To reading the inputs from output of commands cmdX & cmdY.
awk ... | vlookup function in unix with columns changed |
1,542,262,746,000 |
For some reason my output of join is strange and scrambled; here is the command I use:
join -t, -j 1 -o1.1,2.2,1.2 f1 f2
Where f1:
1,87
and f2:
1,337
The output is:
,8737
and I am at loss as to why the output of join is not as expected. I have checked my locale already, with no luck.
Any ideas?
|
Your data file are DOS text files. Each line has a trailing carriage return character.
The output that you expect is
1,337,87
but since there is a carriage return after the 7 in 337 (from the DOS line-ending in the second file), the cursor moves back to the start of the line before printing ,87, overwriting 1,33 t... | join scrambles output |
1,542,262,746,000 |
I have two files:
File1
212 21 24.8 13.8354303 15.2841303
258 21 22.2 15.8507278 17.2994278
270 21 27.8 13.0482192 14.4969192
204 21 22.4 13.9465939 15.3952939
248 21 16.6 9.2714745 11.6494745
279 21 22.8 12.9151566 15.2931566
File2
212 21 24.8 1.03 2.8954
258 21 22.2 1.03 ... |
Assuming the data is sorted, for the type of situation I would use the join command
join -o 1.1 1.2 1.3 1.4 1.5 2.4 2.5 file1.txt file2.txt
212 21 24.8 13.8354303 15.2841303 1.03 2.8954
258 21 22.2 15.8507278 17.2994278 1.03 2.8954
270 21 27.8 13.0482192 14.4969192 1.05 2.9154
204 21 22.4 13.9465939 15.3952939 1.21 3... | Error in awk for merge files |
1,542,262,746,000 |
I have two files. file1 has 6 columns, file2 has 2 columns. I want to replace the values in the 6th column of file1 by the values in column 2 of file2, based on matching ID variables (column 1 in both files).
Note: file2 contains more subjects than file1. Therefore the command below did not work unfortunately:
awk 'NR... |
You almost make it.
awk 'NR==FNR{tmp[$1]=$2;next};{$6=tmp[$1] ; print }' file2.txt file1.txt
Where:
$6 = tmp[$1] will replace 6th field.
| Replace values on the basis of matching ID variable |
1,542,262,746,000 |
Have two files which need to compare the first two columns.
Sample input file1:
|CID|SID|order|orderdate|confirmdate
|151244127820|7177638911583| 2|2015-02-04 07:14:44|2015-02-04 07:15:32
|151244127820|7177638922976| 4|2015-02-04 07:16:19|2015-02-04 07:19:47
|151244127824|7177638920385| 2|2015-02-04 07:14:22|2015-02-... |
awk -F'|' 'FNR==NR{a[$2]=$2;b[$3]=$3;next};{if($2 in a){print $0 > "new_file_1"};if(($2 in a )&& !($3 in b)){print $0 > "new_file_2"}} file1 file2
details
...
{if($2 in a){print $0 > "new_file_1"} : if SID in file2 matches SID in file1 redirect to a file called new_file_1
..
if(($2 in a )&& !($3 in b)){print $0 > "... | Split the file comparing two fields in the files |
1,542,262,746,000 |
I have four csv files, and I want to update a set of three, based on the values in the fourth file.
file_1 contains names.
file_2 their numerical ids.
file_3 contains ids from file_1 and file_2, and values corresponding to each pair of id combinations.
file_4 contains values from some new name combinations.
Wh... |
Here's what you could do in plain bash, assuming the data is exactly as you posted. (Warning: modifies the files in-place. Be careful to take backups before testing.)
A couple of functions to manage the first two files:
next_id() {
file="$1"
# assumes file is sorted by id
echo $(( $(tail -n 1 $file|cut -d, -f1) ... | How to update three CSV files based on a fourth file |
1,542,262,746,000 |
Say the directory contained 3 csv files:
The first csv:
Name, John
Age, 18
The second csv:
Name, Jim
Age, 21
The third csv:
Name, Amy
Age, 22
I would want the result to be:
Name, John, Jim, Amy
Age, 18, 21, 22
It's important to know the directory could have n many csvs
I have both bash and posix shell available
Ed... |
Your attempt was very close. Here are some modifications to make it work as required:
awk -F, -v OFS="," '{
a[FNR] = (FNR==NR ? $0 : a[FNR] OFS $2)
}
END {
for(i=1;i<=FNR;i++) print a[i]
}' *.csv
for (x in a) does not guarantee the array access order, so in order to keep the order, we run... | Merge all csv files in directory column wise |
1,542,262,746,000 |
This post may be looked upon as a followup to a previous post.
This is input file:
module ABC
x(a,b,c)
module DEFG
y(d,e,f,
g,h,i)
module HIJKL
z(j,k,l)
And output file should be:
module ABC x(a,b,c)
module DEFG y(d,e,f,
g,h,i)
module HIJKL z(j,k,l)
I tried using asterisk as a wildcard character... |
Here is a solution using awk :
awk '{if ($0 ~ /^module/) {ORS=""} else {ORS="\r\n"} ; print}'
| How to selectively join lines starting with a pattern [duplicate] |
1,542,262,746,000 |
I have around 250 .gtf files. Here I'm showing 3 .gtf files. All the .gtf files have three columns that look like below:
TUSCC120A.gtf
TUSCC36.gtf
TUSCC89B.gtf
TUSCC120A.gtf looks like below:
transcript MSTRG.6968.1 0.000000
transcript MSTRG.6968.2 1.000000
transcript MSTRG.6975.2 0.000000
transcript ENST00000446 3.0... |
$ cat -f tst.awk
BEGIN {
header = "id" FS "target_id"
}
FNR == 1 {
f = FILENAME
sub(/\.gtf/,"",f)
header = header FS f
}
{
row[$2] = (FNR==NR ? $0 : row[$2] FS $3)
}
END {
print header
for (x in row) print row[x]
}
Usage:
$ awk -f tst.awk *.gtf
id target_id TUSCC120A TUSCC36 TUSCC89B
t... | How to merge multiple files which are not in order and assign the name of file to a specific column in linux? |
1,587,369,408,000 |
I have an issue joining the two files linked below using join -t $'\t' -a1 file_1 file_2. I'm aware that one has to use specific flags when sorting in order to make join work, as explained in this and this post. Specifically, I have sorted both file_1 and file_2 using the following syntax: cat file_1 | LANG=en_EN sort... |
You need to use matching options and locale settings for join and sort. If you tell join to use tab-separated fields, you also need to tell sort to use tab-separated fields (the default is whitespace-separated).
Setting the LANG environment variable may or may not set the LC_COLLATE locale setting: if the environment ... | specific case where sort and join are not working |
1,587,369,408,000 |
I have two host file list like this:
file1.hosts
0.0.0.0 site1.com
0.0.0.0 site2.com
file2.hosts
0.0.0.0 site1.com
0.0.0.0 site3.com
Now I want one list that looks like this:
hosts.hosts
0.0.0.0 site1.com
0.0.0.0 site2.com
0.0.0.0 site3.com
What is the best way to get this?
I tried it with join but I don't get it ... |
You could use sort instead. The -u-Option supressed duplicates in the output:
$ sort -u file*.hosts | tee hosts.hosts
0.0.0.0 site1.com
0.0.0.0 site2.com
0.0.0.0 site3.com
Note that I'm using tee so that we get to see the output while creating the file.
You could just as well just use redirection instead:
$ sort -u f... | Pair two file / Remove duplicate entries |
1,587,369,408,000 |
I have tried various solutions given in this site for this kind of problem and none of these are helping me out.
I have two files (space-separated, contains columns). Both the files contain the same number of records as given in my examples below.
Let me call the columns as A, B, C ... (These are the column headers.)... |
Does this come close to what you need (some formatting still to be done...)?
awk 'NR == FNR {T[$2,$3] = T[$3,$2] = $1; next} {print $0, T[$1,$2]}' file2 file1
A B C D E
-----------
a1 b1 c1 d1 1
a2 b2 c2 d2 2
a3 b3 c3 d3 1
a4 b4 c4 d4 2
a5 b5 c5 d5 1
| Joining two space-separated files based on matching values in two different columns |
1,587,369,408,000 |
I was trying to figure out how to see if there were any matches between column 2 of file1 and column 6 of file2. If so, I wanted that match printed along with the respective string in column 14 of file2, saved onto a different file, file3.
file1:
1 ENSCAFT00000037911
1 ENSCAFT00000046425
1 ENSC
1 ENSCAFT000000... |
Simple with join:
join -1 2 -2 6 -o 1.2,2.14 <(sort -k2 file1) <(sort -k6 file2 )
-1 2 defines that in file1 field 2 is the join field.
-2 6 defines that in file2 field 6 is the join field.
-o 1.2,2.14 is the output format file1 field 2 followed by file2 field 14.
<(sort ...) the two files must be sorted at the join... | Finding Matches between two columns of different files and printing it out a different column |
1,587,369,408,000 |
I would like to merge two files, which share some common data. File 1 includes more than file 2. I want to merge the files based on their shared column (3) following the order of file 1 and I want to add 0 to column 5 (AN1) when the variable is not present in file 2, and if present, add the original value of AN1 (eith... |
awk 'NR==FNR{ snp[$3]=$NF; next }
{ $6=($3 in snp)?(FNR==1?"AN1":snp[$3]):"0" }1' file2 file1
Things in awk:
NR: The total number of input records seen so far.
FNR: The input record number in the current input file and will reset to 1 for the next input file.
So condition NR==FNR will always true for the first input ... | Merging two files based on a common column; add 0 for variants not present in file 2, and keep the original value in those which are present |
1,587,369,408,000 |
I want to join two files on a Linux machine. I want to join the lines only included in the first file.
First file is unzipped file (no header, only one column).
1_4
3_4
4_63
6_2
Second file is gz file (with header, 16 columns).
CHR POS rsid SNPID Allele1 Allele2 AC_Allele2 AF_Allele2 imputationInfo N BETA SE Tstat p.... |
You have one error that means you will miss the first line from file2. You have both sed 1,1d which will delete the first line, the header, but also NR>1 in the awk which will again skip the first line. You probably wanted this instead:
join -11 -21 <(cat file1 | sort -k1,1) \
<(zcat file2.gz | awk 'NR>1{... | How to join two files in linux? |
1,587,369,408,000 |
I have a file named file1 with information like below:
TCONS_00000011 XLOC_000003 - u q1:MSTRG.39|MSTRG.39.9|4|0.000000|0.000000|0.000000|7468
TCONS_00000012 XLOC_000004 - u q1:MSTRG.41|MSTRG.41.1|2|0.000000|0.000000|0.000000|1270
TCONS_00000013 XLOC_000003 - u q1:MS... |
This is probably what you want:
awk 'NR==FNR{a[$1]; next} $2 in a' file2 file1
| How to get all the matches from a file based on names in another file? [duplicate] |
1,587,369,408,000 |
I have 2 csv files. The first file is big (>400 fields and many rows > 1 mil) and needs to have another field appended to it, via a matched join.
I want to join on a field $170
I have tried
gawk 'BEGIN {OFS=FS=","} NR==FNR{b[$1]=$2; next}
$170 in b {print $0,b[$170]}
' b a
This works ok but struggles when file siz... |
I carried out a full-scale gawk test. I made a CSV of 5 million lines by 500 columns (20 GB), and a side file of 5 million lines by 2 columns. The key fields are unique (I had five million prime numbers hanging around) and were in column 170 of the big file and column 1 of the side file. Both the files contained the k... | join csv with many fields without disturbing order |
1,587,369,408,000 |
I have two files and I want to merge them in a way when some specific columns are the same, export those lines with all fields except one column, which to be the subtraction of the two files in that specific column.
For example, I have two files as follows and I want to output the lines where columns 1 to 3 are the s... |
Using Awk:
$ awk '{k = $1 FS $2 FS $3} NR==FNR {a[k] = $4; next} k in a {print k, a[k]-$4}' File1 File2
100 200 300 10
150 250 350 20
| How to merge two files with common fields in specific columns |
1,587,369,408,000 |
I have 2 file:
file1
SC 65.696 618
SC 61.92 625
KN 82.546 1037
KN 82.946 1032
KN 82.849 1032
CN 70.55 618
and
file2
SC SC7 SCARE 588 2 75702
KN KN4 Kines 1033 2 1 3635
CN CNGC Prote 703 2 3880
need to join, according to column 1 and with repeated rows
f... |
This is the default behavior of join:
$ join <(sort file1) <(sort file2)
CN 70.55 618 CNGC Prote 703 2 3880
KN 82.546 1037 KN4 Kines 1033 2 1 3635
KN 82.849 1032 KN4 Kines 1033 2 1 3635
KN 82.946 1032 KN4 Kines 1033 2 1 3635
SC 61.92 625 SC7 SCARE 588 2 75702
SC 65.696 618 SC7 SCARE 588 2 75702
| How to merge/join two file based on common field with repeated rows [duplicate] |
1,587,369,408,000 |
I am trying to join two files with different rows but one element in common.
FILE1:
1/temperature
2/rainfall
3/snowfall
4/windspeed
5/winddirection
FILE2:
2008-10-01/1/68
2008-10-02/2/6
2008-10-03/3/4
2008-10-04/4/25
2008-10-05/5/120
2008-10-01/1/89
2008-10-01/4/35
2008-11-01/5/360
2008-10-01/1/45
2008-12-01/1/61
200... |
join expects its inputs to be sorted (on the fields that are to be joined). In this case (making use of the bash shell's process substitution):
$ join -t/ -1 1 -2 2 FILE1 <(sort -t/ -k2 FILE2)
1/temperature/2008-10-10/32
1/temperature/2008-10-01/45
1/temperature/2008-12-01/61
1/temperature/2008-10-01/68
1/temperature/... | Join command is not working as expected |
1,587,369,408,000 |
I have 2 files that contain numbers_ID, status, descrpation I want to join both files based on the numbers as
number_123, status1, status2
My file 1:
number_123,this car is under maintenance
number_345,this car checked is done
number_356,this car is under main
My file 2:
number_123,hold
number_345,done
I n... |
The comm utility is used to compare whole lines between files. What you want to do is to join on a particular field.
$ join -t, file2 file1
number_123,hold,this car is under maintenance
number_345,done,this car checked is done
This assumes that both files are sorted on the join field (the first comma-delimited colum... | Printing in one line the common text using comm cmd? |
1,587,369,408,000 |
I have 2 txt files, in one i have alias lists and the other is the servers name. So what im trying to do is to loop from the alias txt file line by line and where it will find the name that is on the other txt file ( servers name ) will be echo or writhe in other file. For example:
In this alias.txt file we have somet... |
Would this work for you?:
$ grep -F -f serverlist.txt alias.txt
alias server1='ssh [email protected]'
alias server2='ssh [email protected]'
alias server3='ssh [email protected]'
It uses the lines of the serverlist.txt as patterns to match for showing lines form alias.txt. Depending on the names of your servers, it m... | Compare strings |
1,587,369,408,000 |
I have two different files which some rows of the two data measures a same thing. I want to have a merged output such that the rows of File1 will be the output row where the rows measures same thing (second row of file1 and first line of file2 measures same thing. I want to have the file1 first line when column1 and c... |
Use awk:
awk -F',' '!seen[$1,$2]++' file1 file2
Explanation:
In the beginning, the array item with key being fields $1,$2 is unassigned, thus false.
If it's false, !seen is true, so we increment it (make it true) and do the default action which is print.
If it's true (second time we see the same fields) !seen is fal... | Merge two texts with comparison of the rows and select one text's rows if some columns are similar |
1,587,369,408,000 |
I have two files I would like to join based on the bakery store number.
[File 1] bakedGoods.txt
1:Chocolate Cookies:111
2:Banana Muffins:222
3:Apple Pie:333
4:Strawberry Cheesecake:444
5:Pineapple Turnover:555
Where column 1 is the number of the item, column 2 is the item name, and column 3 is the store number.
[File... |
Answer these two questions, and you will solve your problem.
What is the default field delimiter (for join)? How do you change it?
| Join two files based on shared key |
1,587,369,408,000 |
I am combining .jpg images which are correctly positioned in their jpg files.
So I think this position could be passed to an view format like pdf.
So I am doing now the following but it gives pictures in quite randomly positioned
pdfjoin *.jpg
|
The exif data did not help here, neither pdfjoin.
LaTeX is the right tool for the task in the thread How to rotate image 90 if height overful?
The case where both figure dimensions are greater than the page size is not solved.
I think you cannot solve the case by exiftool and pdfjoin directly because you have to re... | How to orientate many pictures well when pdfjoin *.jpg? [duplicate] |
1,587,369,408,000 |
I would like to run following command on 31 separated file name chr1.txt ... chr31.txt , and get 31 outputs only by one run.
this is command :
cat input.txt | sed 's/.\{5\}/& /g' > output.txt
any sugesstion please?
|
A simple loop will do the trick:
for((i=1;i<32;i++));do cat chr$i.txt | sed 's/.\{5\}/& /g' > output$i.txt; done
| how to run a command in many files by running the command only one time? |
1,587,369,408,000 |
join in coreutils reminds me of equijoin in SQL.
join writes to standard output a line for each pair of input lines that have identical join fields.
I am not very clear about what join does from the coreutile's manual. Could you explain what join does in terms of equijoin in SQL or operations in relational algebra?... |
The join utility, by default, does what's called an "inner join" in SQL, resulting in the combined records of those entries whose join field is identical in both files. Yes, this is an "equi-join" since it's using equality for the test between the fields.
The join utility can do inner joins (default), as well as left,... | What does `join` do in terms of equijoin in SQL or operations in relational algebra? |
1,587,369,408,000 |
I want to join two files, and I must use the command join.
This is first file
file1.txt
SUBJID SEX DTHHRDY
GTEX-1117F 2 4
GTEX-111CU 1 0
GTEX-111FC 1 1
GTEX-1122O 2 4
This is the second file
file2.txt
GTEX-1117F-003-a
GTEX-1117F-003-b
GTEX-111CU-0011-a
GTEX-111FC-0011
GTEX-1122O-0045-a
GTEX-1122O-0045-b
... |
head -n 1 file1.txt
join <(paste -d" " <(cut -d- -f1-2 file2.txt) file2.txt | sort) \
<(tail -n +2 file1.txt | sort) \
| cut -d" " -f2- \
| awk '$2 == 2 && $3 == 4' \
| column -t
SUBJID SEX DTHHRDY
GTEX-1117F-003-a 2 4
GTEX-1117F-003-b 2 4
GTEX-1122O-0045-a 2 4
GTEX-1122O-0045-b 2 4
| How to join two files |
1,587,369,408,000 |
I need to merge two files based on the 1st and 2nd columns. I need to add the difference between 3rd and 4th columns and add TOTAL rows per type of 2nd column. Here are the two input files:
File 1:
VALIDATION_DATA_DBF DELETE 226 6.4
TXT_DBF DELETE 80 0.15
DEFAULT_PROFILE ... |
Using GNU awk for arrays of arrays and ARGIND:
awk '
{
counts[$2][$1][ARGIND] = $3
times[$2][$1][ARGIND] = $4
}
END {
print "TABLE", "TYPE", \
"COUNT1", "COUNT2", "DIFF_COUNT", \
"TIME1", "TIME2", "DIFF_TIME"
for ( type in counts ) {
... | how to merge and amend columns of two files |
1,361,905,344,000 |
Is it possible to cause a kernel panic with a single command line?
What would be the most straightforward such command for a sudoing user and what would it be for a regular user, if any?
Scenarios that suggest downloading something as a part of the command do not count.
|
FreeBSD:
sysctl debug.kdb.panic=1
Linux (more info in the kernel documentation):
echo c > /proc/sysrq-trigger
| How to cause kernel panic with a single command? |
1,361,905,344,000 |
I know what a kernel panic is, but I've also seen the term "kernel oops". I'd always thought they were the same, but maybe not. So:
What is a kernel oops, and how is it different from a kernel panic?
|
An "oops" is a Linux kernel problem bad enough that it may affect system reliability.
Some "oops"es are bad enough that the kernel decides to stop running immediately, lest there be data loss or other damage. These are called kernel panics.
The latter term is primordial, going back to the very earliest versions of Lin... | What's the difference between a kernel oops and a kernel panic? |
1,361,905,344,000 |
I'm running an Ubuntu 12.04 derivative (amd64) and I've been having really strange issues recently. Out of the blue, seemingly, X will freeze completely for a while (1-3 minutes?) and then the system will reboot. This system is overclocked, but very stable as verified in Windows, which leads me to believe I'm having a... |
I have two suggestions to start.
The first you're not going to like. No matter how stable you think your overclocked system is, it would be my first suspect. And any developer you report the problem to will say the same thing. Your stable test workload isn't necessarily using the same instructions, stressing the memo... | Determining cause of Linux kernel panic |
1,361,905,344,000 |
What does it mean when your computer has a "kernel panic"?
Does it equate to the windows BsoD?
Also, what methods, tips, tricks are available to the user when a kernel panic strikes?
|
Kernel panic is the same as BSOD and is non-rescuable IIRC. However smaller failure is OOPS which denotes some error in kernel.
You can use kexec which switches to new kernel on panic (you can threat it as fast reboot) - possibly getting meaningful dump of system to debug the problem
You can use panic parameter which... | What is a "kernel panic"? |
1,361,905,344,000 |
My Arch machine sometimes hangs, suddenly not responding in any way to the mouse or the keyboard. The cursor is frozen. Ctrl-Alt-Backsp won't stop X11, and ctrl-alt-del does exactly nothing. The cpu, network, and disk activity plots in conky and icewm stop updating. In a few minutes the fan turns on. The only way... |
Frederik's answer involving magic SysRq and kernel dumps will work if the kernel is still running, and not truly hung. The kernel might just be busy-looping for some reason.
The fact that it doesn't respond to Ctrl-Alt-Del tells me that probably isn't the case, and that the machine is locking up hard. That means hardw... | How to investigate cause of total hang? |
1,361,905,344,000 |
You can put "panic=N" on the kernel command line to make the system reboot N seconds after a panic.
But is there a config option to specify this (other than the default kernel command line option) before even boot loader comes into a play? Some kernel option may be?
|
There does not seem to be such a config option. The default timeout is 0 which according to http://www.mjmwired.net/kernel/Documentation/kernel-parameters.txt#1898 is "wait forever".
The option is defined in kernel/panic.c, you can write a patch that sets the initial value to something different.
To hardcode a reboot ... | How to early configure Linux kernel to reboot on panic? |
1,361,905,344,000 |
While tinkering with a Linux VM I regularly get kernel panics, that push up all the helpful output with stuff I don't understand and that is probably not helpful to me.
The panics mostly occur during the initramfs phase. I'm using VirtualBox.
The normal Shift+Pg Up does not work (in my case).
Is there another way to s... |
Serial port
The serial port is an old and reliable communication protocol hardware that the Linux kernel supports and most emulators emulate.
You can stream the kernel messages to a host file or console through it:
VirtualBox: How does one Capture the Entire Kernel Panic on Boot | Stack Overflow
QEMU:
to console: Ho... | How to scroll up after a kernel panic? |
1,361,905,344,000 |
I'm trying to add Qemu to my continuous integration pipeline to test various initrd artifacts. I've already discovered that I can run Qemu like this:
qemu-system-x86_64 \
-machine q35 \
-drive if=pflash,format=raw,file=OVMF_CODE.fd,readonly \
-drive if=pflash,format=raw,file=OVMF_VARS.fd \
-kernel vmli... |
I've got something that's working:
Configure (and build) the kernel with CONFIG_PVPANIC=y; this produces a kernel with compiled-in support for the pvpanic device.
Invoke qemu-system-x86_64 with the -device pvpanic option; this instructs Qemu to catch (and exit on) a kernel panic.
A kernel panic causes qemu-system-x8... | Can I make Qemu exit with failure on kernel panic? |
1,361,905,344,000 |
It' hard to isolate the CPU, I know, but the errors I'm seeing suggest that's the issue.
This is definitely not a malfunctioning/broken hardware problem. I've been running Windows 10 all day for the past several days and this thing is flippin' fast! No crashing. More importantly, I ran Windows memory checker. Memory i... |
Turns out the issue was i2c_hid
This seems to be some kind of touchpad driver. For some reason, when I disable it, I can still use my touchpad. It could be that the touch screen on the laptop was using this driver, too, because that doesn't work.
I don't like to mung up my laptop screen with fingerprints, anyway... So... | Why can't linux kernel boot on my new Intel i7-6500U CPU? |
1,361,905,344,000 |
I was playing a game on Steam and all a sudden I got a kernel panic. I manually shut down the computer and booted back into Linux Mint 17.1 (Cinnamon) 64-bit, and went to go check through my log files in /var/log/, but I couldn't find any references or any kind of messages relating to the kernel panic that happened.
I... |
To be sure that your machine generates a "core" file when a kernel failure occurs, you should confirm the "sysctl" settings of your machine.
IMO, following should be the settings (minimal) in /etc/sysctl.conf:
kernel.core_pattern = /var/crash/core.%t.%p
kernel.panic=10
kernel.unknown_nmi_panic=1
Execute sysctl -p aft... | Kernel Panic dumps no log files |
1,361,905,344,000 |
one of my RAM sticks causes a Kernel Panic on my Ubuntu 10.10 (something like "not syncing" with a lot of memory adresses shown on screen). It's definitely this one RAM stick and not its socket because when I put one of the other sticks into the slot of the one RAM stick, everything is ok.
How does it come that memte... |
What is "several" passes? What memtest tests have you run? I know I have seen memtest86+ take up to 6 or 7 passes to find an error with RAM sticks. Also, make sure you run the full battery of tests.
It certainly does sound like the RAM is bad. I too have had not syncing panics because of bad RAM.
| Kernel Panic because of RAM stick? |
1,361,905,344,000 |
I always have /proc/sys/kernel/panic set up to 0. Looking at description of this option in kernel.org we can see:
panic:
The value in this file represents the number of seconds the kernel
waits before rebooting on a panic. When you use the software watchdog,
the recommended setting is 60.
From here one can concl... |
The authoritative source is the implementation in the kernel, so let’s look at that first.
The panic entry in sysctl corresponds to a kernel variable called panic_timeout. This is a signed integer, used to control behaviour on panic as follows:
if panic_timeout is strictly positive, the kernel waits after a panic, fo... | Linux Kernel.org misleading about kernel panic /proc/sys/kernel/panic |
1,361,905,344,000 |
My kernel keeps panicking when connected to a certain wireless network. I'd like to send a bug report but my kernel is apparently tainted. From /var/log/messages:
Apr 17 21:28:22 Eiger kernel: [13330.442453] Pid: 4095, comm: kworker/u:1 Tainted: G O 3.8.4-102.fc17.x86_64 #1
and
[root@Eiger ~]# cat /proc/... |
Well I don't believe a standard Fedora kernel package will include any modules which would trigger this taint so the question is, what other kernel modules have you installed?
Common candidates would be graphics drivers (though I think those will mostly set the "proprietary" bit) and wireless drivers.
If you can find ... | How to determine which module taints the kernel? |
1,361,905,344,000 |
My laptop restarts randomly about twice a day. It shows the following error log before the restart.
.
Unfortunately I don't have an idea how to decode the Machine Check Exception (MCE). mcelog --ascii outputs nothing. Is there a chance that this is a software problem?
The laptop is Samsung NP900X3C with the Intel Core... |
This issue has to do with a hardware failure, specifically it looks like the memory in bank 4, (DIMM 4 - I would assume), is faulty. The MCE facility (Machine Check Events) is not widely known about but I"ve answered several questions on the site related to it.
Does kernel: EDAC MC0: UE page 0x0 point to bad memory,... | Random restarts caused by a machine check exception |
1,361,905,344,000 |
Update 2019-05-21 19:37 EST: My motherboard is on the latest BIOS available, released 2019-03-06, but still has the install problems described below.
Update: I burned the Arch ISO to a CD then tried booting from it, both in UEFI and legacy. Same type of result:
Original question: I used dd to put this Arch ISO (Ve... |
Linux Kernel With MSI B450
The kernel fail in this case because of the support of the iommu feature; you can use some specific kernel adjustment (parameter) to fix your booting issue, this video demonstrate how to edit/apply the kernel parameters; here are some possibles solutions, try the different proposed paramete... | AMD-VI: completion wait loop after a failed install of Arch Linux on a blank SSD |
1,361,905,344,000 |
I am trying to install Ubuntu server but it always get stuck at the last stage while updating grub.I cancelled the process and rebooted my system, it took me to the grub command prompt grub> .
I tried a manual boot from prompt:
root=(hd1,gpt5) # Ubuntu root partition
linux /boot/vmlinuz-something- root=/dev/... |
Not a solution but a couple of Workarounds.
Apparently, that's a bug in os-prober .
I personally tried the second one and it works!
To quote from the link:
Workaround 1: (proaction)
When you are reaching
the “Install the GRUB boot loader to the master boot record?” prompt,
(in my case, no such prompt appeared bu... | Ubuntu 18.04 server installation gets stuck at 66% while running'update-grub' |
1,361,905,344,000 |
Can a user shove the cause of a kernel panic to the screen?
|
Linux does dump panics to the screen...depending on your definition of the screen.
What Linux actually does is dump to the system console. Often this is the screen, but can be the serial console (or elsewhere) instead.
However, most people are running X on their desktops. Which means that the console is not on the scr... | Is there a way to shove kernel-panic to the screen? |
1,361,905,344,000 |
I have a Lenovo Thinkpad L440.
Core i7
4GB RAM
1TB HDD
Windows 7 64 bits installed though right now it has Windows 10.
I made space in disk to install Linux Mint. Left:
20~ GB for /
8~ GB for swap
and almost 195~ GB for /home folder.
Installed Linux Mint 17 (64bits) with Cinnamon as desktop environment and everyth... |
All this was about a bad hard drive. Don't know how or when but it got bad. Asked Lenovo support for a replacement, got it and it's been working since.
| Too many Kernel Panic (6) and Linux installations problems in same computer |
1,361,905,344,000 |
I've just updated packages:
2013-05-23 11:15:34 startup archives unpack
2013-05-23 11:15:35 upgrade locales:all 2.13-38 2.17-3
2013-05-23 11:15:35 status half-configured locales:all 2.13-38
2013-05-23 11:15:35 status unpacked locales:all 2.13-38
2013-05-23 11:15:35 status half-installed locales:all 2.13-38
2013-05-23 ... |
I did as schaiba said, so:
backup your sensitive stuff (for me only /home dir)
reinstall operating system
| How to repair system if kernel panic? |
1,361,905,344,000 |
After: Fixing recursive fault but reboot is needed on x3850 x6 SLES12
Q: I was thinking that if I get a kernel panic on a linux server, how can I debug, what driver causes the kernel-panic?
In my case, it seems to have been due to an emulex driver issue, in that since updating that driver, kernel panics have no longe... |
In regards to your previous issue, I would add debug to your kernel cmdline to see more verbose output.
As far as recovering from a kernel crash, I usually boot into a livecd and check the logs. A simple way to troubleshoot drivers is to blacklist the ones you think may be causing the crash, working backwards until th... | How to debug what driver causes a kernel-panic? |
1,361,905,344,000 |
I just installed a new fresh Ubuntu 12.04.5 on a Dell laptop, I had 14.04 but as I really love 12.04 stability I decided to get back to it.
I have a Windows installed alongside which I just keep to have a way to preserve laptop warranty somehow.
So, I had used 14.04 with out any problem, but now I just installed on fi... |
Try to fully turn off your Intel Rapid Start and Secure Boot, and try it from BIOS, if you have a pre-installed 64-bit Windows 8 with UEFI, since it is pre-installed, and you also need 64-bit ubuntu, try this
https://askubuntu.com/questions/221835/installing-ubuntu-on-a-pre-installed-windows-8-64-bit-system-uefi-suppo... | How to solve this kernel bug on OS start? |
1,361,905,344,000 |
I'm using Linux in embedded systems, and want to configure the system to automatically reboot after a kernel panic. However, when the system comes back up, it's important for me to detect and log the fact that the kernel panicked (rather than, say, the user toggling the power switch).
I could configure a kernel core d... |
If you run customized kernels for your embedded hw and have some hw register/bit available you may be able to customize the kernel crash code to set a flag in that hw location which you'd check after reboot.
If not AFAIK you're only chance is to configure your kernel core dumping facility. Indeed, it's risky to write ... | How do I detect that my system has auto-rebooted after a kernel panic? |
1,361,905,344,000 |
Given the limited fixed size of kernel stack, my guess is that although theoretically we might have a recursive function if its recursion doesn't go too deep, pragmatism would suggest to do away with recursive functions all together, to be on a safer side. After all, too much of recursion can result in wiping off the ... |
Yes!
Maybe some of the recurive calls are either documented or part of function names? Then, a find/grep should reveal them. Here is a command to do it:
find /usr/src/linux/ -name "*.c" -exec grep recursive {} ";" -ls
Piping this through | wc -l gives me 270, which is, since -ls prints one additional line per file, ... | Does the linux kernel (specifically 2.6 onwards) have any recursive function? |
1,361,905,344,000 |
I have created a image file with this commands:
dd if=/dev/zero of=linux.img bs=16M count=1024
cfdisk linux.img
mkfs.ext4 linux.img
and installed a linux system following the instructions from the book Linux From Scratch 11.3. I have access to this system via chroot, but when I try run it with this command:
qemu-syst... |
The error message hd0,X not found comes from GRUB, and indicates GRUB configuration file has an error, pointing to a partition that either does not exist or is not readable by GRUB.
The titular error message Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) means you got through GRUB and i... | Kernel panic - not syncing: VFS: Unable to mount root fs on unknown block(0,0) |
1,361,905,344,000 |
I'm trying to install xubuntu on a usb flash drive following this quide. The command I'm running is
qemu-system-x86_64 -drive file=/dev/sdc,media=disk,index=0,format=raw -cdrom ./xubuntu-15.10-desktop-amd64.iso -boot menu=on
/dev/sdc is my usb drive formatted as ext4. It starts to boot from xubuntu*.iso, as I can see... |
It seems this obscure error is due to the ramdisk of the kernel image having grown so much these days that it no longer fits in the default size for ram memory of the qemu virtual machine (which is quite low at 128 MiB). Simply add a memory option like:
-m 512M
| qemu: boot from cdrom |
1,361,905,344,000 |
After recent Fedora 27 update, my KVM VM guest ended up in the kernel panic during boot process.
The system was updated to libvirt-3.7.0-4.fc27.x86_64 (and many other packages during this update) and rebooted. Before the VM guest running Kubuntu 16.04 had no problem. Previous kernel on the hypervisor doesn't help.
The... |
The culprit is really the system update (most probably the libvirt).
Before the VM guest was running with cpu mode=host-model more than one year. However now it was necessary to edit VM guest XML deffinition file - virsh edit <domain>. The cpu mode entry must have been changed to cpu mode=host-passthrough:
<cpu mode='... | Kernel panic in KVM guest after Fedora 27 - libvirt update |
1,361,905,344,000 |
From here: http://fedoraproject.org/wiki/Common_kernel_problems#Can.27t_find_root_filesystem_.2F_error_mounting_.2Fdev.2Froot
A lot of these bugs end up being a broken initrd due to bugs in
mkinitrd.
Get the user to attach their initrd for their kernel to the
bz, and also their /etc/modprobe.conf, or have them... |
An initrd (short for “initial RAM drive”) is a filesystem that's mounted when the Linux kernel boots, before the “real” root filesystem. This filesystem is loaded into memory by the bootloader, and remains in memory until the real boot. The kernel executes the program /linuxrc on the initrd; its job is to mount the re... | Kernel Panic - Can't find root filesystem / error mounting /dev/root |
1,361,905,344,000 |
nc -l -u 6666 on the receiving machine gets no messages from netconsole.
tested by doing "echo test > /dev/kmsg"
i am able to connect with netcat by doing "nc -u 10.0.0.192 6666" on the netconsole machine
"sudo tcpdump -i wlp170s0 -n -e port 6666" outputs nothing on the listening machine
netconsole options:
modprobe n... |
Turns out you have to increase the verbosity with dmesg -n 8
| Unable to get output from netconsole |
1,361,905,344,000 |
After upgrading my CentOS 7 kernel from 3.10.0 to 4.8.7, while rebooting the system I will get the following lines:
[ 0.641455] cpufreq: cpufreq_online: Failed to initialize policy for cpu: 0 (-19)
[ 0.641734] cpufreq: cpufreq_online: Failed to initialize policy for cpu: 1 (-19)
[ 0.641873] cpufreq: cpufreq... |
Are you using virtual machines or a hypervisor? If yes so, you should update your hypervisor host to the latest version so it can support the kernel version.
CPUFreq stands for CPU frequency scaling which enables the operating system to scale the CPU frequency up or down in order to save power.
I'm not sure why you're... | Kernel 4.8.7 failure on cpufreq - CentOS 7 |
1,361,905,344,000 |
I wanted to update my system (Slackware current) which was in multilib. Before updating, I tried to remove all packages (compat32 and multilib). Big mistake !!! This have broken some crucial symlinks and give me now a kernel panic when i trie to boot it.
I have tried several methods, including this one But it does not... |
since you can't boot your system, you need some other medium - cd or usb. there is no other magic way to boot unbootable system.
basically what you have to do is:
boot your machine (slackware installer).
mount your partitions and chroot to system / dir.
install packages you removed (download them from some slackware ... | Linux Slackware ( Broken - kernel panic ) |
1,435,751,574,000 |
We asked our server provider to increase ram (from 4gb to 6gb) on our server. After they increased and restarted server, it started giving these messages:
Message from syslogd@www at Jul 1 14:39:04 ...
kernel:[ 30.426516] Oops: 0002 [#1] SMP
Message from syslogd@www at Jul 1 14:39:04 ...
kernel:[ 30.426677] ... |
That's a kernel bug, Debian bug #789037 aka upstream bug #99161. It was introduced in a recent kernel update, and you probably saw it after the reboot (to install RAM) because you're now running that kernel.
The fix is already available; you need to install it (and reboot).
(BTW: I saw this on some of our servers afte... | Kernel panic? After ram increase |
1,435,751,574,000 |
I recently added a 2nd HDD to a system and then proceeded to do a clean install on to this 2nd HDD of CentOS 6.5. The original system was CentOS 5.9. My plan was to leave the original HDD in place so that I could pull data off of it as needed as we migrated several KVMs from HDD #1 to HDD #2.
All this went uneventfull... |
The key item to notice in the output of /etc/grub.conf are these types of arguments being passed to the kernel:
rd_LVM_LV=VolGroup00/LogVol01
Removing this argument from GRUB's linux .. line resolved the issue. These are remnants of HDD #1's LVM. These were added automatically by the install to assist you, but in thi... | Removal of HDD causes kernel panic |
1,435,751,574,000 |
Sometimes (very rarely actually) I have a problem that when I try to shut down my desktop, it will freeze with the following screen and I can only shut it down by pressing the power button for 8 seconds:
Does anyone know why this error occurs? I am guessing it is because of the proprietary fglrx-driver. How I could g... |
Such rarely occurring crashes are very hard to debug. It can be a hardware problem, driver (flgrx, as you've noticed) issue or even a kernel bug.
The easiest thing to do in your case is to change the video driver - of course that will only prevent further crashes only in case the driver was the problem source. Unfort... | Linux Mint does not shut down |
1,435,751,574,000 |
I downloaded pcap source compiled it and got a lib ending in libsomething.so.1.21.1. I tried to find how to install a lib online and in my impatience did the following
sudo .install-sh /lib libsomething.1.21.1
The output was the following
install-sh :250:chmod not found
install-sh : 1: rm :not found
After this I co... |
Ok, what I think happened is that the script moved /lib to libsomething.1.21.1 (in the directory where you were when you ran the script). After that, pretty much nothing worked. Every dynamically linked executable relies on the dynamic loader, which lives in /lib: move that and you're in trouble.
It is possible to rec... | Ubuntu 10.04 can't boot, kernel panic |
1,435,751,574,000 |
Is there any way to cause a kernel panic under Linux? I've heard of
echo c > /proc/sysrq-trigger
but it seems to just freeze, and I'm not sure it's a kernel panic. Is there any C program I can run as root to cause a kernel panic?
|
using kill
I think you could try the following:
$ kill -6 1
This sends signal # 6 to process #1 (the init process). If you read up in the signals man page: "man 7 signals":
Signal Value Action Comment
-------------------------------------------------------------------------
SIGHUP 1 Te... | Intentional kernel panic under Linux? |
1,435,751,574,000 |
Im getting kernel oops because ppp driver is trying to access to unaligned address (there is a pointer pointing to unaligned address). Im not sure about the meaning of unaligned address. It means not multiple or 4 or out of RAM scope? If my system has a bus 32-bits wide, given an address how can i know if its aligned ... |
In short an unaligned address is one of a simple type (e.g., integer or floating point variable) that is bigger than (usually) a byte and not evenly divisible by the size of the data type one tries to read.
Address % Size != 0
Say you have this memory range and read 4 bytes:
+---------- 8 %... | Know when a memory address is aligned or unaligned |
1,435,751,574,000 |
I'm trying to debug a prototype CPU that throws unhandled signal 11s and signal 7s in the startup process.
Here is what the kernel prints out. I have added extra print statements to the kernel to debug exactly which userspace processes are exhibiting the error.
[ 0.880000] Execing: /usr/bin/readlink
[ 0.884000] ... |
If I'm reading the kernel's source correctly, this line:
readlink[85]: unhandled signal 7 code 0x1 at 0x00000020000b8f60 in libc-2.26.so[2000049000+13e000]
Tells you what you need to know. libc is loaded at hexadecimal 0x2000049000, and is 0x13e000 bytes long. The address that the signal happened at is 0x00000020000b... | Interpreting the unhandled signal exception in Linux |
1,435,751,574,000 |
I have an iMac mid 2011 running OSX and I am trying to install Arch Linux following this guide. I successfully set up a dual boot last year following a similar procedure but now I can't even start since I get a kernel panic while booting from the live usb installation of archiso: right before the login prompt. I'm 100... |
I installed the linux-lts package as suggested by @mikeserv from chroot and I set it as the default boot option from the grub configuration.
This way I could boot nicely into linux 3.14 and complete the installation process. The vanilla linux kernel is installed alongside with the LTS version so using the "advanced op... | How to debug a kernel panic on boot with archiso? |
1,435,751,574,000 |
I'm using an embedded board ARM9 SAM9G25. I want to boot from SD card.
When I build a linux kernel with a built-in rootfs (initramfs) then it boots.
I want to separate the kernel from rootfs and I generated a rootfs.squashfs.
The kernel command line is:
console=ttyAT0,115200 root=/dev/mmcblk0 ro rootfstype=squashfs
... |
I found out the driver uses different pins (in the board header file, of the device drivers) than the actual hardware for the SD device. Thank you for your help, I thought it was a more generic error
| Why does boot from SD card with my custom kernel result in "VFS: Cannot open root device"? |
1,435,751,574,000 |
Background
I have a debian system on which I have something like the following in the fstab file.
/dev/sda1 / ext3 defaults,noatime,errors=panic 0 0
The option I wish to focus on is the errors=panic. According to the man page, it states the following.
Define the behaviour when an error is encountered. (Either igno... |
This behaviour can partially be depending on the implementation in the file system. Since in your case you appear to use Ext3, I'm talking about Ext3 here:
Regarding the first question, it will cause a panic whenever an error is encountered. This means if your disk is mounted and running and gets corrupted while alrea... | Behavior of filesystem when mount option has been specified as error=panic |
1,435,751,574,000 |
When I installed Fedora, it did not have the Schrödinger's cat boot option, but then I installed a bunch of updates and now it is there. What is even more annoying is that it is the default boot option. Here is the log I get on the screen during boot:
Is there any way to fix this without reinstalling? If anyone wants... |
I found this thread over on AskFedora, titled: kernel panic Fedora 19. This doesn't solve the issue but works around it for the tim being:
I just blacklisted the buggy kernels in the /etc/yum.conf file. Stick
with the last one which works for now. Here's the line which you can
add to the YUM config.
exclude=kerne... | Fedora 19 (Schrödinger's cat) gets stuck on boot |
1,435,751,574,000 |
I was following http://fedoraproject.org/wiki/How_to_use_kdump_to_debug_kernel_crashes and in step 2 I need to add the line to grub.cfg, but grub.cfg is a shell I do not know how to edit it, most available resources tell you only the method to rearrange menu items, can anyone tell me what should be added to the file. ... |
The kernel line in grub should looks like:
kernel /vmlinuz-3.1.4-1.fc16.x86_64 ro root=/dev/VolGroup00/LogVol00 rhgb LANG=en_US.UTF-8 crashkernel=128M
There's a note in the instructions:
(...) An example command line might look like this (for grub2, "kernel" is replaced by "linux"):
So, the one you are looking for ... | How to edit grub2 to use kdump? |
1,435,751,574,000 |
My OS got kernel panic ( it looks like triggered another kernel to dump, kdump ? )
[ 124.674715] core: Uncorrected hardware memory error in user-access at xxxxxxx
[ 124.684140] BUG: scheduling while atomic: einj_mem_uc/5151/0xxxxxxxxx
[ 124.684310] {1}[Hardware Error]: Hardware error from APEI Generic Hardware E... |
OK then, only in order to confirm my comments here-above thanks to the supplemental information you provided :
The kernel does not panic because of BUG: scheduling while atomic (being, as intended with kernel.panic_on_warn = 0, not a valid reason for panicing) but more obviously because of repeated hardware memory fai... | Why kernel panic when panic_on_warn==0 |
1,435,751,574,000 |
Few hours later after this issue occurred, out of nowhere i got a some sort of a kernel panic for the first time !
lines were flying all the way up i couldn't read it properly, so i unplugged the laptop and restarted it , check my syslog and i've found this weird spam
Oct 9 23:19:03 www tracker-miner-f[4463]: Could... |
Problem resolved, I noticed that the problems started to occur the day after installing kernel 4.9.0-4, So I used kernel 4.9.0-3 and the problem disappeared, then reinstalled the kernel 4.9.0-4 and found an error I didn't notice last time
Error! Bad return status for module build on kernel: 4.9.0-4 (x86_64)
Consult /... | kernel panic then a spam from tracker-miner-f in syslog [closed] |
1,435,751,574,000 |
I'm trying to boot the 4.13.0-rc2 mainline kernel on the Beaglebone Black (rev C) with omap2plus_defconfig over NFS. I've enabled CONFIG_NFS_ROOT along with the following options:
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_NFS_SWAP=y
CONFIG_NFS_V4_1=y
CONFIG_NFS_V4_2=y
C... |
For some reason a lot of boards with u-Boot based bootloader don't like NFSv4. If you add v3 option to nfs it should work well. Of course, this needs to be investigated further, but due to lack of time I was not able to find the reason for that.
| Kernel Boot over NFS |
1,435,751,574,000 |
I recently finally finished my build of LinuxFromScratch version 7.9-SYSTEMD. There is one change I had to make from the book. I needed to aquire a patch for the package inettools that caused PATH_PROCNET_DEV to be undefined. Besdides that, my LFS build is on a second hard drive and will be booting independently from ... |
I know it's been awhile, but in recently rebuilding the LFS project, it is, by default, incompatible with VM booting. The LFS has to be booted as the host lb a physical machine. If anyone can prove me wrong, please do.
| LFS Kernel Panic on first boot |
1,435,751,574,000 |
Getting this message attempting to boot CentOS 7
BUG: unable to handle kernel NULL pointer dereference at 000000000000009B
And then a kernel panic
Happens when trying to boot from the OS HDD or from the CentOS 7 CD in rescue mode.
Kernel Version: 3.10-123
I would like to recover this installation if I can instead of ... |
For those of you interested. Turns out there was some kind of corruption of the LVM. My guess is due to me resizing the LVM partitions. Managed to get a Live CD of CentOS 7 booting and every time I try to mount the partition I need, I receive the Kernel Panic. So my tip to anyone. If you have resized your LVM par... | CentOS 7 Crash on boot |
1,435,751,574,000 |
Is the name kernel panic being used outside of Linux-based systems?
|
The original v1 version of Unix had a label in the source code (assembly language) called panic:. If something went wrong elsewhere, code would jump to there and the system would reboot (that's an assumption given a comment in the code, in contradiction to the Van Vleck quote). The string "kernel panic" does not appea... | Where is 'kernel panic' used? |
1,435,751,574,000 |
The following Kernel Panic occurred on my embedded board.
I am using 3.10 Kernel.
I am analyzing the cause of the Kernel Panic.
The Kernel Panic message shows the PID(735).
Feb 22 19:40:28 TEST kenel: CPU: 0 `PID: 735` Comm: cat Not tainted 3.10.73 #2
Feb 22 19:40:28 TEST kernel: Process cat `(pid: 735`, stack limit =... |
The cat program was running with a PID of 735 when the panic occurred, i.e. the fault happened in the context of the process with PID 735. This does not mean that the cat program did something wrong. The fault is in the kernel, a panic is something that should not happen under any circumstances (unless you really try ... | Is the [PID] of Kernel Panic the killer of Kernel Panic? |
1,435,751,574,000 |
I have an old laptop. The newer kernels that ship with the latest versions of the most popular Linux distributions crash from time to time. I want to use a new Linux distribution to get the latest packages and therefore I think that I need an old kernel. (correct me if there is some other solution please)
How can I fi... |
Bios
To maximize you chances, make sure you have the latest BIOS installed for your system(always do such updating with AC properly secured and being motionless). Compare the settings with the defaults(which you should have done if you reloaded setup defaults after flashing - take notes of your settings prior settings... | How to find a Linux kernel that works ok on my PC? |
1,582,051,348,000 |
I am trying to debug my kernel module.
When I run it I get the following kernel warnings, but it seems that there is no informative message like other warnings I've seen. Is it possible to get any useful info out of this?
Some more info:
The module is called firewall, it diverts tcp packets to a proxy server in user ... |
Have you tried following backwards from end of stack trace with addr2line?
For example looking at the last line sysenter_do_call+0x12/0x28
It tells us that the offset is 0x12 and the length is 0x28
$ addr2line -e [path-to-kernel-module-with-issue] 0xc15af55f
and so on...gdb is another alternative in terms of breaking... | Understanding a dmesg kernel warning message |
1,582,051,348,000 |
I installed Arch Linux from arch linux evolution-image to a virtual device.
I tested the installation with GRUB MBR and GRUB efi.
Inside virtualbox, I can see the grub menu, but when I select Arch Linux it gives me a
Kernel panic - not syncing: VFS: unable to mount root fs on unknown block(0,0)
What is going wrong?
|
I had a wrong fstab generated by genfstab (as pointed out here). So the kernel (please correct me, if this is wrong) didn't find my root-partition.
I generated fstab with labels and had a partition with a space in it. In fstab this must be written with \040. genfstab wrote garbage for the space.
Other answeres suggest... | Arch Linux in virutalbox: kernel panic-not syncing: VFS: unable to mount root fs on unknown block(0,0) |
1,582,051,348,000 |
to install Arch on a PC I have to make partition of the HDD
boot
swap
/
The swap is used by virtual memory, right?
What's up if I make a too small or a too big swap partition? Could I have as result some kernel panic?
|
Actually you don't need the swap partition and the /boot partition.
But returning to your question: yes, the swap is used as virtual memory (and also for hibernation). If both the swap file and the physical RAM fill up, you most likely won't have a kernel panic: applications will just start to be killed by the kernel... | Arch installation and swap partition |
1,582,051,348,000 |
Suppose we are working in environment where you can't be sure that your computer won't just suddenly shut off. What measures can be taken to improve system's (unix) resist to such failures? And how to ensure that risk of data loss (on hard drive) is as low as possible?
|
Use a journaling file system and make sure the flush to disk frequency is set pretty high.
If you are having frequent kernel panics, don't use the machine for anything important! It's broken. Fix it. Remove whatever modules or hardware is a problem before using it in a production environment.
If power or other physica... | What are the ways to improve system stability and prevent data loss in conditions of frequent hard reboots and/or kernel panics? |
1,582,051,348,000 |
Few days ago, after I did an apt upgrade, I got something like this in the log, multiple times
Error 24 : Write error : cannot write compressed block
E: mkinitramfs failure cpio 141 lz4 -9 -I 24
update-initramfs: failed for /boot/initrd.img-5.4.0-52-generic with 1.
dpkg: error processing package initramfs-tools (--con... |
First let's have a look at:
I just checked my /boot, it seems that there's no more available space left...
So, now you could basically run the Mint Update manager, and uninstall the oldest kernel(s) in order to install a new one:
Also, please check if you have intel-microcode package installed for your Haswell CPU,... | end Kernel panic - not syncing |
1,582,051,348,000 |
Is it possible to cause kernel panic by removing a device driver and then making a system call that uses that driver so that kernel goes in panic?
|
It is possible when driver is not properly removed and application tried to use. If driver is removed properly kernel will give error like driver not found but never crash(In 99.99% cases until it hit any bug).
| How to cause kernel panic by deleting a device driver (module)? |
1,582,051,348,000 |
Having some problems with booting in Centos 7 since the last update. The Centos 7 partition does not boot due to a soft kernel panic after the following error is thrown *ERROR* atombios stuck in loop for more than 5secs aborting. I cannot find back the trace of the error in /var/log/messages. Also, there is no hardwar... |
I found an ongoing discussion on this issue on Red Hat discussions and the CentOS bug tracker. It has to do with the graphics driver of my pc (AMD driver, working on a DELL computer). Bug appears for the 3.10.0-693 kernel version.
A workaround for the moment is to add nomodeset to the grub boot command line, as sugges... | troubleshooting kernel panic during boot (centos7) |
1,582,051,348,000 |
I installed and configured Debian 7.2 Wheezy AMD64 few days ago, I spent days configuring everything out and installing useful apps etc, so finally I tried to install Wine.
And what happened?
Dependency problem - libc6 is version 2.13 but it should be 2.17 to satisfy Wine.
Unfortunately, there is no stable version av... |
To repair libc6, start your Debian-based rescue system from the USB flash, mount your broken system partition and prepare a chroot environment using
mount --bind /proc MOUNTPATH/proc
mount --rbind /dev MOUNTPATH/dev
mount --bind /sys MOUNTPATH/sys
Download the libc6 2.13-38 package for your architecture (probably am... | Debian 7 - Kernel Panic after libc6 update |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.