How to read systemd journal file on system that has no systemd?
Olivia Zamora
I am trying to troubleshoot a system (Arch Linux) that had systemd installed.
The volume has been mounted on an Ubuntu system (14.04) that has no systemd installed.
How can I troubleshoot said systemd journal without switching the host box to systemd?
apt-get install journalctl does not work.
2 Answers
chroot into the Arch Linux system:
cd /location/of/arch/root
chroot /location/of/arch/root /bin/bashjournalctl 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,
a) use journalctl --directory=/var/log/journal/<machine-id>
b) or journalctl -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.
the command line partition recovery program called TestDisk should allow some manipulation to the systemd (Arch Linux) volume
this not not a full or "good" solution. but TestDisk can
- Rebuild a partition table, recover deleted partition
- Locate the ext2/ext3/ext4 Backup SuperBlock
- Copy files from deleted a ext2/ext3/ext4 partition.
- handle a non-partitioned volume
- Rewrite the Master boot record (MBR)
give it a try.
$ sudo apt-get install testdisk
start it
$ sudo testdisk
press Enter to create a new log & select the disk with the volume you want to manipulation
select the partition table type.
yours is Intel
from here you can
- view files
- Copy files
hope it helps
3