Capturing kernel error/stack trace after running a command in bash

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I'm trying to capture what looks like a kernel error/stack trace when I run the command sudo zpool import. There error starts with:




[104.877657] BUG: unable to handle kernel paging request at 00000000ffff4167



...




I've tried simply redirecting stderr to a file with sudo zpool import &> err_file but that doesn't seem to capture it (I'm using bash) - the error still prints to the screen.



How can I grab the entire error message?







share|improve this question




















  • You will most probably need to redirect the error to the file as at the moment, it is redirecting to screen and so use "sudo zpool import 2> err_file"
    – Raman Sailopal
    Feb 1 at 12:10














up vote
2
down vote

favorite












I'm trying to capture what looks like a kernel error/stack trace when I run the command sudo zpool import. There error starts with:




[104.877657] BUG: unable to handle kernel paging request at 00000000ffff4167



...




I've tried simply redirecting stderr to a file with sudo zpool import &> err_file but that doesn't seem to capture it (I'm using bash) - the error still prints to the screen.



How can I grab the entire error message?







share|improve this question




















  • You will most probably need to redirect the error to the file as at the moment, it is redirecting to screen and so use "sudo zpool import 2> err_file"
    – Raman Sailopal
    Feb 1 at 12:10












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I'm trying to capture what looks like a kernel error/stack trace when I run the command sudo zpool import. There error starts with:




[104.877657] BUG: unable to handle kernel paging request at 00000000ffff4167



...




I've tried simply redirecting stderr to a file with sudo zpool import &> err_file but that doesn't seem to capture it (I'm using bash) - the error still prints to the screen.



How can I grab the entire error message?







share|improve this question












I'm trying to capture what looks like a kernel error/stack trace when I run the command sudo zpool import. There error starts with:




[104.877657] BUG: unable to handle kernel paging request at 00000000ffff4167



...




I've tried simply redirecting stderr to a file with sudo zpool import &> err_file but that doesn't seem to capture it (I'm using bash) - the error still prints to the screen.



How can I grab the entire error message?









share|improve this question











share|improve this question




share|improve this question










asked Feb 1 at 11:47









Timmy O'Mahony

1134




1134











  • You will most probably need to redirect the error to the file as at the moment, it is redirecting to screen and so use "sudo zpool import 2> err_file"
    – Raman Sailopal
    Feb 1 at 12:10
















  • You will most probably need to redirect the error to the file as at the moment, it is redirecting to screen and so use "sudo zpool import 2> err_file"
    – Raman Sailopal
    Feb 1 at 12:10















You will most probably need to redirect the error to the file as at the moment, it is redirecting to screen and so use "sudo zpool import 2> err_file"
– Raman Sailopal
Feb 1 at 12:10




You will most probably need to redirect the error to the file as at the moment, it is redirecting to screen and so use "sudo zpool import 2> err_file"
– Raman Sailopal
Feb 1 at 12:10










1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










The error message isn't being written to the console by the zpool command. The kernel is writing the message. It's most likely being written to the console via syslog/rsyslog.



You might be able to find the error message by running dmesg which will print the kernel messages. dmesg > err_file






share|improve this answer




















  • Ah that shows it. Great! I actually forgot to mention I checked tail -f /var/log/dmesg but didn't see it in there. Why is it showing up when I run the command dmesg instead of in the log files?
    – Timmy O'Mahony
    Feb 1 at 12:14






  • 1




    OK, answering my own question: unix.stackexchange.com/questions/191560/…
    – Timmy O'Mahony
    Feb 1 at 12:15










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f421185%2fcapturing-kernel-error-stack-trace-after-running-a-command-in-bash%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










The error message isn't being written to the console by the zpool command. The kernel is writing the message. It's most likely being written to the console via syslog/rsyslog.



You might be able to find the error message by running dmesg which will print the kernel messages. dmesg > err_file






share|improve this answer




















  • Ah that shows it. Great! I actually forgot to mention I checked tail -f /var/log/dmesg but didn't see it in there. Why is it showing up when I run the command dmesg instead of in the log files?
    – Timmy O'Mahony
    Feb 1 at 12:14






  • 1




    OK, answering my own question: unix.stackexchange.com/questions/191560/…
    – Timmy O'Mahony
    Feb 1 at 12:15














up vote
2
down vote



accepted










The error message isn't being written to the console by the zpool command. The kernel is writing the message. It's most likely being written to the console via syslog/rsyslog.



You might be able to find the error message by running dmesg which will print the kernel messages. dmesg > err_file






share|improve this answer




















  • Ah that shows it. Great! I actually forgot to mention I checked tail -f /var/log/dmesg but didn't see it in there. Why is it showing up when I run the command dmesg instead of in the log files?
    – Timmy O'Mahony
    Feb 1 at 12:14






  • 1




    OK, answering my own question: unix.stackexchange.com/questions/191560/…
    – Timmy O'Mahony
    Feb 1 at 12:15












up vote
2
down vote



accepted







up vote
2
down vote



accepted






The error message isn't being written to the console by the zpool command. The kernel is writing the message. It's most likely being written to the console via syslog/rsyslog.



You might be able to find the error message by running dmesg which will print the kernel messages. dmesg > err_file






share|improve this answer












The error message isn't being written to the console by the zpool command. The kernel is writing the message. It's most likely being written to the console via syslog/rsyslog.



You might be able to find the error message by running dmesg which will print the kernel messages. dmesg > err_file







share|improve this answer












share|improve this answer



share|improve this answer










answered Feb 1 at 12:02









sapensadler

48016




48016











  • Ah that shows it. Great! I actually forgot to mention I checked tail -f /var/log/dmesg but didn't see it in there. Why is it showing up when I run the command dmesg instead of in the log files?
    – Timmy O'Mahony
    Feb 1 at 12:14






  • 1




    OK, answering my own question: unix.stackexchange.com/questions/191560/…
    – Timmy O'Mahony
    Feb 1 at 12:15
















  • Ah that shows it. Great! I actually forgot to mention I checked tail -f /var/log/dmesg but didn't see it in there. Why is it showing up when I run the command dmesg instead of in the log files?
    – Timmy O'Mahony
    Feb 1 at 12:14






  • 1




    OK, answering my own question: unix.stackexchange.com/questions/191560/…
    – Timmy O'Mahony
    Feb 1 at 12:15















Ah that shows it. Great! I actually forgot to mention I checked tail -f /var/log/dmesg but didn't see it in there. Why is it showing up when I run the command dmesg instead of in the log files?
– Timmy O'Mahony
Feb 1 at 12:14




Ah that shows it. Great! I actually forgot to mention I checked tail -f /var/log/dmesg but didn't see it in there. Why is it showing up when I run the command dmesg instead of in the log files?
– Timmy O'Mahony
Feb 1 at 12:14




1




1




OK, answering my own question: unix.stackexchange.com/questions/191560/…
– Timmy O'Mahony
Feb 1 at 12:15




OK, answering my own question: unix.stackexchange.com/questions/191560/…
– Timmy O'Mahony
Feb 1 at 12:15












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f421185%2fcapturing-kernel-error-stack-trace-after-running-a-command-in-bash%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)