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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-22-2008, 02:26 AM
|
#1
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
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.
|
01-22-2008, 11:07 AM
|
#2
|
Member
Registered: Jun 2005
Posts: 445
Rep:
|
I don't think you can change the size of the journal.
|
|
|
01-22-2008, 11:22 AM
|
#3
|
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675
Rep:
|
As a workaround you may remove journal and re-create it.
|
|
|
01-24-2008, 02:06 AM
|
#4
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
|
Quote:
Originally Posted by Emerson
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)...
|
|
|
01-30-2008, 07:37 AM
|
#5
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
|
Really nobody else?
|
|
|
01-30-2008, 08:47 AM
|
#6
|
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675
Rep:
|
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.
|
|
|
01-30-2008, 08:56 AM
|
#7
|
Moderator
Registered: May 2001
Posts: 29,415
|
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.
|
01-30-2008, 08:56 AM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
|
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.
|
|
|
01-30-2008, 09:27 AM
|
#9
|
Senior Member
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187
|
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?
|
|
|
01-30-2008, 09:37 AM
|
#10
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by JZL240I-U
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.
|
|
|
02-05-2008, 04:36 AM
|
#11
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
...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?
|
|
|
10-22-2008, 08:25 AM
|
#12
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
|
Quote:
Originally Posted by JZL240I-U
... 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.
|
|
|
11-05-2008, 08:06 AM
|
#13
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
|
Quote:
Originally Posted by JZL240I-U
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.
|
|
|
11-17-2008, 06:00 AM
|
#14
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
|
Quote:
Originally Posted by unSpawn
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.
|
All times are GMT -5. The time now is 05:06 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|