LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-22-2008, 02:26 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Rep: Reputation: Disabled
How to find out the size of an ext3 journal, how to change that?


Probably a stupid question, but I simply failed to find a solution.

This is the situation:

I installed SuSE 10.3 and choose ext3 with journal=data as the file system. Since I couldn't give the size of the journal during the installation I wanted to check later and set the maximum (it's journal=data after all). So I did a
Code:
tune2fs -l /dev/hda17
which gave a lot of output / information but no journal size. So I decided to resort to brute force and issued a
Code:
tune2fs -J size=400 /dev/hda17
and got "device has already a journal".

Fine. How large? It didn't tell. When I changed the size parameter to "size=200" it didn't acknowledge the change either, it just repeated "device has already a journal".

So, how do I find out the size of an ext3 journal and how can I change its size?

Last edited by JZL240I-U; 01-22-2008 at 07:50 AM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-22-2008, 11:07 AM   #2
hansalfredche
Member
 
Registered: Jun 2005
Posts: 445

Rep: Reputation: 31
I don't think you can change the size of the journal.
 
Old 01-22-2008, 11:22 AM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675

Rep: Reputation: Disabled
As a workaround you may remove journal and re-create it.
 
Old 01-24-2008, 02:06 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
As a workaround you may remove journal and re-create it.
I thought of that, too. But that would mean to use a rescue CD since / and the system directories are journaled as well. And I don't know the commands .

And it doesn't answer my original question: "how do I find out the size of an ext3 journal...?" It might well be that the journals already have the maximum size (400M)...
 
Old 01-30-2008, 07:37 AM   #5
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Original Poster
Rep: Reputation: Disabled
Really nobody else?
 
Old 01-30-2008, 08:47 AM   #6
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675

Rep: Reputation: Disabled
Cool

Code:
tune2fs -O ^has_journal /dev/hdXX
This will remove the journal.

Code:
tune2fs -l /dev/hdXX
This will show current options.

Code:
tune2fs -J size=foo /dev/hdXX
This will create journal with desired size.

If man pages are not installed in your computer they are accessible here.
 
Old 01-30-2008, 08:56 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603
The journal is located at inode:
'tune2fs -l /dev/device | awk '/Journal.inode/ {print $3}''
The size is:
debugfs -R "stat <inodenumber>" /dev/device 2>&1| awk '/Size: / {print $6}'|head -1
 
1 members found this post helpful.
Old 01-30-2008, 08:56 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Original Poster
Rep: Reputation: Disabled
Thank you . I even read the man page -- but I need new spectacles .

P.S.: Out of curiosity: What happens when one does that to a mounted partition?

P.P.S.: Special thanks for your contribution unSpawn. Now, woudn't that be a nice improvement for tune2fs, a new option like
Code:
tune2fs -S[b|k|m|g] /dev/device
with the output of the journal size in bytes | kB | MB | GB ...

And one could even dream of a resize option .

Last edited by JZL240I-U; 01-30-2008 at 09:23 AM.
 
Old 01-30-2008, 09:27 AM   #9
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Since the journal file is just that, a journal, removing it from a running ext3 fs will not cause any problems. It just changes the fs from ext3 to ext2, and ext2 works fine unless an operation is aborted by, e.g., a power loss.

In fact, I believe that the partition must be mounted to remove/reinstall the journal file. How would you be able to write to the fs to make the change if the partition containing the fs was not mounted?
 
Old 01-30-2008, 09:37 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603
Quote:
Originally Posted by JZL240I-U View Post
What happens when one does that to a mounted partition?
That's the power of GNU/Linux: you can experiment with it and find out w/o needing anyones agreement. I suggest you try it only on something disposable like a mounted loop device. And make some background process do constant read/writes while you're at it.
 
Old 02-05-2008, 04:36 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
...I suggest you try it only on something disposable like a mounted loop device...
That's for future research.

I tested your commands on an unused partition which I had set up with a 400 MB journal using tune2fs. The journal size is returned with 419430400. That is close enough to 400MB for me but what in units is this ?

It is (10^20) *400, but is 10^20 bytes 1 MB? I always thought that is 1000*1024 bytes? Where am I wrong?
 
Old 10-22-2008, 08:25 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JZL240I-U View Post
... journal size is returned with 419430400. That is close enough to 400MB for me but what in units is this ?

It is (10^20) *400, but is 10^20 bytes 1 MB? I always thought that is 1000*1024 bytes? Where am I wrong?
Tsk, tsk. It is (2^20) *400, but is 2^20 bytes 1 MB? I always thought that is 1000*1024 bytes?

"Where am I wrong?" Where? Well, in math at least

But I still don't get the source for that value.
 
Old 11-05-2008, 08:06 AM   #13
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JZL240I-U View Post
Tsk, tsk. It is (2^20) *400, but is 2^20 bytes 1 MB? I always thought that is 1000*1024 bytes?

"Where am I wrong?" Where? Well, in math at least

But I still don't get the source for that value.
This time tsk^tsk ^

1 MB = 1024*1024 = 2^10*2^10 = 2^20 = 1.048.576 byte.

And 1.048.576*400 = 419430400.

So my journal is 400 MB. Darn.

My humble apologies, unSpawn.

Last edited by JZL240I-U; 11-05-2008 at 08:07 AM.
 
Old 11-17-2008, 06:00 AM   #14
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by unSpawn View Post
The journal is located at inode:
'tune2fs -l /dev/device | awk '/Journal.inode/ {print $3}''
The size is:
debugfs -R "stat <inodenumber>" /dev/device 2>&1| awk '/Size: / {print $6}'|head -1
Attention, other newbies (like me):

Upon wanting to play with the information you'd better
  • omit the dot between "Journal.inode" and make that "Journal inode"
  • keep in mind that the "stat" statement is an debugfs option and not the stat command of the sh-utils, i.e. the built-in(?) tools of the shell (to find that out the hard way I needed several hours )
  • "<>" are relly necessary around the inode number, just like unSpawn posted it, see "man debugfs"


Last edited by JZL240I-U; 11-18-2008 at 02:26 AM.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ext3 journal idol007 Linux - Kernel 6 12-19-2007 11:02 PM
LXer: Tips and Tricks: How do I find the inode size of an ext2/ext3 filesystem? LXer Syndicated Linux News 0 07-31-2007 12:01 PM
Western Digital My Book Ext3 format reports "Ext3-fs: Journal inode is deleted" ChronusDark Linux - Desktop 3 10-31-2006 04:56 PM
Remove journal from ext3 ilikejam Linux - General 12 03-02-2004 01:53 AM
Turning off the ext3 journal? Phaethar Red Hat 2 02-04-2004 11:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration