PDA

View Full Version : SLES 12 SP4 Can be the Journal path on a filesystem other than /?



AAEBHolding
19-Mar-2019, 13:49
According to this guide (https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.journalctl.html) I made the Journal persistent because I had a serious issue where I needed the logged information but it got lost after I reboot the server.

I would like to store the default Journal directory /var/log/journal/ on a mounted file system other than /, but I am not sure if I can do it due to the fact that Journal is an important service which may already run before any device is mounted which would lead to the fact that suddenly the directly changes.

Is it safe/possible to store the Journal directory on a mounted device and if yes, how to do it, if a simple mounting doesn't work.

This is the current directory listing which is getting bigger and bigger so there won't be enough space in few days on the / file system.
I have to create an additional virtual disk I use for the Journal file system.


2019-03-18 22:16:41 root@AAEB-APP206LY:/var/log/journal/d41cf15550e34487abe7103b61fbf794 => ll
total 792M
drwxr-sr-x 1 root systemd-journal 884 Mar 12 06:35 ./
drwxr-sr-x 1 root systemd-journal 64 Feb 26 18:17 ../
-rw-r----- 1 root systemd-journal 96M Mar 18 22:16 system.journal
-rw-r----- 1 root root 120M Feb 26 18:17 system@d5301574c947425cb992f7839ae52cdb-0000000000000001-0005827c7effc14d.journal
-rw-r----- 1 root systemd-journal 96M Mar 5 12:29 system@d5301574c947425cb992f7839ae52cdb-0000000000051acb-000582cf3a7ba719.journal
-rw-r----- 1 root systemd-journal 96M Mar 12 06:35 system@d5301574c947425cb992f7839ae52cdb-00000000000872b4-000583572e31154d.journal
-rw-r-----+ 1 root systemd-journal 128M Mar 18 22:16 user-5000.journal
-rw-r-----+ 1 root root 128M Mar 5 12:29 user-5000@cf6acecdf28e48c790173a36447ec2e7-0000000000051ad9-000582cf3d435013.journal
-rw-r-----+ 1 root systemd-journal 128M Mar 12 06:35 user-5000@cf6acecdf28e48c790173a36447ec2e7-00000000000872b9-000583572e312040.journal

KBOYLE
19-Mar-2019, 15:29
According to this guide (https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.journalctl.html)
The tag on your post says you are using SLES12 SP4 but you are referring to a document for openSUSE Leap which is a different product.
You should refer to the documentation for SUSE Linux Enterprise Server 12 SP4 (https://www.suse.com/documentation/sles-12/index.html).

AAEBHolding
19-Mar-2019, 17:25
I appreciate your help but - honestly - your comment doesn't help at all.

Journal for SLES 12.4 is described here (https://www.suse.com/documentation/sles-12/pdfdoc/book_sle_admin/book_sle_admin.pdf). Please, forget the link in the first paragraph in the initial question.

Under 15.1 there is EXACTLY the same wording regarding "Making the Journal Persistent" as in the link I provided.

I apologize endless I dared to link to an article which is not supposed to be for SLES 12.4 - in the end, it doesn't really change anything because - as I wrote in my first question - I was talking only about making the Journal Persistent.

Good, I am not capable to fix my first question [where is the EDIT option?] so I ask the whole community to forgive me these dramatic mistake and may be someone can answer my question.

AndreasMeyer
19-Mar-2019, 21:34
Is it safe/possible to store the Journal directory on a mounted device and if yes, how to do it, if a simple mounting doesn't work.For a safe way to change the journal directory on a running system see chaptre 15.1 in sles administration guide:
https://www.suse.com/documentation/sles-12/book_sle_admin/data/journalctl_persistent.html
Prior you should mount your preferred partition to /var/log/journal.


This is the current directory listing which is getting bigger and bigger so there won't be enough space in few days on the / file system.
Please read chaptre 15.5.1 in sles administration guide:
https://www.suse.com/documentation/sles-12/book_sle_admin/data/journalctl_config.html

AAEBHolding
19-Mar-2019, 21:44
Prior you should mount your preferred partition to /var/log/journal.

This is exactly my problem: How can I assure that the partition/file system has been mounted before Journal starts to work?
For me it is the chicken or the egg problem. Which one starts first?

When Journal starts before the file system has been mounted so what happens? Inconsistency? Undefined behaviour? ???
In this case I am removing the underlying file system for the service Journal.

malcolmlewis
20-Mar-2019, 00:42
On Tue 19 Mar 2019 08:54:02 PM CDT, AAEBHolding wrote:

AndreasMeyer;57236 Wrote:
> Prior you should mount your preferred partition to /var/log/journal.

This is exactly my problem: How can I assure that the partition/file
system has been mounted before Journal starts to work?
For me it is the chicken or the egg problem. Which one starts first?

When Journal starts before the file system has been mounted so what
happens? Inconsistency? Undefined behaviour? ???
In this case I am removing the underlying file system for the service
Journal.




Hi
From the man page journactld.conf under Storage= is set to persistent,
it stores to ram until the location is mounted...

--
Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.28-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!

malcolmlewis
20-Mar-2019, 00:44
On Tue 19 Mar 2019 11:42:20 PM CDT, malcolmlewis wrote:



On Tue 19 Mar 2019 08:54:02 PM CDT, AAEBHolding wrote:

AndreasMeyer;57236 Wrote:
> Prior you should mount your preferred partition
> to /var/log/journal.

This is exactly my problem: How can I assure that the partition/file
system has been mounted before Journal starts to work?
For me it is the chicken or the egg problem. Which one starts first?

When Journal starts before the file system has been mounted so what
happens? Inconsistency? Undefined behaviour? ???
In this case I am removing the underlying file system for the service
Journal.




Hi
From the man page journactld.conf under Storage= is set to persistent,
it stores to ram until the location is mounted...



Hi
Opps, that should be journald.conf

--
Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.28-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below... Thanks!

AAEBHolding
20-Mar-2019, 09:28
Good, I am studying the man page. I will try it on a test system and let you know!