Summary: | journalctl cannot be used when systems is not started | ||
---|---|---|---|
Product: | systemd | Reporter: | chris21 <chris21.roux> |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED NOTABUG | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
chris21
2014-11-08 12:29:56 UTC
Sorry for automatic completion orthography; here is the real text: I am starting my system with a rescue cd boot, and I want to consult systemd logs from a previous boot without systemd started. Journalctl works only when systemd is started. Is there a work around to consult a previous boot logs without starting systemd? Hi, There is the --directory or --file arguments to make journalctl operate on a directory or on a specific journal file instead of the system journal files. Did you use one of these arguments ? Hello Ronny, I don't understand: are you telling me to use the --directory or --file argument to make journalctl operate on the system journal files as it is its default behavior? Hmm, you are right. In this case you need to use the --root option. Since you use a rescue cd boot, you mounted your system in /mnt/ or equivalent, journalctl needs to know where is the root filesystem, so: journalctl --root=/mnt/ If this is not the problem what arguments did you use ? and what error is shown by journalctl exactly ? No Ronny, I am chrooted. Ok, can you provide the error shown by journalctl and the command line you used ? journalctl looks for the journal files in /var/log/journal/<machine-id>/. If you boot up with a rescue OS that has a different machine ID or a different root it hence won't find any data there. Hence, make sure: a) to either chroot to the host OS, and then use journalctl --directory=/var/log/journal/<machine-id> b) or chroot to the host OS, and then use journalctl -m b) or to run journalctl --directory=<pathtorootdir>/var/log/journal/<machine-id> c) or to run journalctl --root=<pathtorootdir> -m The "-m" swicth merges the journals of all directories in /var/log/journal/*, hence makes it unnecessary to figure out the machine id of the host. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.