Hi everyone!
I have a question regarding gfs2 journal size.
I created the gfs2 filesystem with 3 journals and I didn't specify its size. The filesystem was created with 3 journals with 32MB each. Then I added a new one with 64MB size. What if I want to resize the journals that have 32MB, is that possible?
Hello @Emanuel_Haine !
I dont think we can resize the existing journal. We can add extra journal or create a new file system with desired journal size and then migrate the old data to new location.
Thank you for reaching out.
You can resize the journals of a GFS2 file system using the gfs2_jadd command. This command is used to add journals to a GFS2 file system dynamically at any point without expanding the underlying logical volume 1. You can specify the size of the new journals in megabytes using the -J flag. The default journal size is 128 megabytes, and the minimum size is 32 megabytes.
To resize the journals that have 32MB, you can use the gfs2_jadd command with the -J flag and specify the new size of the journal. For example, if you want to resize a journal to 64MB, you can run the following command:
gfs2_jadd -J 64 /path/to/mount/point
This command will resize the journal to 64MB. You can also use the -j flag to specify the number of new journals to be added.
Please note that the gfs2_jadd command must be run on a mounted file system, but it needs to be run on only one node in the cluster. All the other nodes sense that the expansion has occurred. Also, if a GFS2 file system is full, the gfs2_jadd command will fail, even if the logical volume containing the file system has been extended and is larger than the file system. This is because in a GFS2 file system, journals are plain files rather than embedded metadata, so simply extending the underlying logical volume will not provide space for the journals.
References: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/global_file_system_2/s... and https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/global_file_system_2/c...
Hello @Wasim_Raja
I tried to use just the -J option with the new journal size, but the command adds a new journal with the specified size and it doesn't adjust the other journals' size.
I am running this command on a RHEL 8.3, using the lab from RHLS
@Emanuel_Haine I am sorry for the confusion, The gfs2_jadd command is used to add new journals to a GFS2 file system.
I am not 100% sure if it will work as I have referenced few docs and came to the below conclusion.
Unmount the GFS2 FS >> use gfs2_edit -D to delete the journal >> Use the gfs2_jadd command to add a new journal with the desired size.
Hello @Emanuel_Haine !
I dont think we can resize the existing journal. We can add extra journal or create a new file system with desired journal size and then migrate the old data to new location.
@Chetan_Tiwary_ Thank you for clarifying.
Don't be sorry. We are here to learn and share our knowledge and experience. I really appreciate your interaction on this post.
Thanks for clarifying and assisting us on this topic.
Thank you, all!
Pleasure @Emanuel_Haine
Very rightly said @Emanuel_Haine !!
That is what makes our community really vibrant and enriching !
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.