Emanuel_Haine
Flight Engineer
Flight Engineer
  • 1,220 Views

Is it possible to change the size for an existing gfs2 journal?

Jump to solution

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?

Emanuel_Haine_0-1701608905296.png

 

1 Solution

Accepted Solutions
Chetan_Tiwary_
Moderator
Moderator
  • 1,133 Views

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__0-1701703753540.png

 

View solution in original post

8 Replies
Wasim_Raja
Moderator
Moderator
  • 1,175 Views

@Emanuel_Haine 

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... 

0 Kudos
Emanuel_Haine
Flight Engineer
Flight Engineer
  • 1,162 Views

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_0-1701688131878.png

 

0 Kudos
Wasim_Raja
Moderator
Moderator
  • 1,156 Views

@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.

 

Chetan_Tiwary_
Moderator
Moderator
  • 1,134 Views

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__0-1701703753540.png

 

Wasim_Raja
Moderator
Moderator
  • 1,132 Views

@Chetan_Tiwary_ Thank you for clarifying.

Emanuel_Haine
Flight Engineer
Flight Engineer
  • 1,096 Views

@Wasim_Raja 

Don't be sorry. We are here to learn and share our knowledge and experience. I really appreciate your interaction on this post.

@Chetan_Tiwary_ 

Thanks for clarifying and assisting us on this topic.

Thank you, all!

Wasim_Raja
Moderator
Moderator
  • 1,095 Views

Pleasure @Emanuel_Haine 

Chetan_Tiwary_
Moderator
Moderator
  • 1,086 Views

Very rightly said @Emanuel_Haine !!

That is what makes our community really vibrant and enriching ! 

Join the discussion
You must log in to join this conversation.