LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-02-2004, 06:10 PM   #1
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Remove journal from ext3


Hi all.

My system is running with three partitions: /boot, /, and swap.

I previously used ext3 on the / partition, but have changed the entries in fstab to mount / as ext2 (so that shred works properly). This leaves me with the journal from the ext3 filesystem still on the ext2 mounted root partition with potentially sensitive information contained therein.

Does anyone know how to completely remove the journal? I recieve messages on boot that the partition is an ext3 partition being mounted as ext2, so I know it's still there.

Cheers.

Dave
 
Old 01-02-2004, 06:26 PM   #2
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Here is a link that might help you.

ext3 2 ext2
 
Old 01-02-2004, 06:32 PM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Original Poster
Rep: Reputation: 97
Cheers g-rod.

I guess I'll have to burn a knoppix cd. Oh well - I was hoping I wouldn't have to do that.

Dave
 
Old 01-02-2004, 06:36 PM   #4
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Na. Use you redhat cd boot to rescue and don't mount the filesystem.
 
Old 01-03-2004, 09:07 AM   #5
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Original Poster
Rep: Reputation: 97
Hmmm. Good point.

Oh well, I burned a Knoppix CD (I'm sure it'll be handy to have around anyway) and followed the instructions for converting ext3 to 2.

The conversion went without errors, but I'm still getting a message on boot warning that I'm booting an ext3 partition as ext2. How irritating.

The journal has been delete by 'tune2fs -O ^has_journal /dev/hda' so that's fine (the partition won't mount at ext3 any more, which is good), but that boot message is rubbing me up the wrong way.

I'm just being pedantic now, but any ideas?

Cheers again.

Dave

Last edited by ilikejam; 01-03-2004 at 09:12 AM.
 
Old 01-03-2004, 09:34 AM   #6
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Is it giving you that error before it has mounting the root filesystem read/write? Check dmesg if the error is in there than it is before root is mounted read/write.
If it is it is probably the linuxrc in you initrd. If you need help with it let me know.
 
Old 01-03-2004, 11:59 AM   #7
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Original Poster
Rep: Reputation: 97
Hi again.

Yeah, the message is in dmesg.

I'm working with a stock 2.4.23 kernel which has ext2 compiled in, but which doesn't have ext3 support at all. I'm also not using an initrd, as I'm booting straight from the compiled kernel (space on the /boot partition is extremely tight).

My grub.conf looks like:
-----start
title GNU/Linux-2.4.23/ILikeJam_31_12_03
root (hd0,0)
kernel /bzImage-2.4.23-31_12_03 hdc=ide-scsi hdd=ide-scsi
-----end

The output from dmesg is:
-----start
...
usbdevfs: USBDEVFS_CONTROL failed dev 2 rqt 128 rq 6 len 18 ret -6
EXT2-fs warning (device ide0(3,1)): ext2_read_super: mounting ext3 filesystem as ext2
0: nvidia: loading NVIDIA Linux x86 nvidia.o Kernel Module 1.0-4496 Wed Jul 16 19:03:09 PDT 2003
...
-----end

I'm wondering how the kernel knows it's an ext3 partition, when the journal has been removed and I've run e2fsck. Might I have to reinstall Grub to complete the conversion?

Cheers

Dave
 
Old 01-03-2004, 12:22 PM   #8
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
When the kernel boots it uses the inital root device (initrd) that was loaded by the boot loader. That file is a zipped ext2 filesystem. After that device is unzipped and mounted by the kernel through a loopback device the kernel begins executine the script linuxrc. That is the script that is causing you trouble. The initial root disk is built automatically when Redhat installs kernel a new kernel. This is done via the script mkinitrd. I can go on and on with this. I have probably told you more than you wanted to know already.

How to fix it. Find out what initrd you are using from your grub.conf. I will refer to this file as initrd.fil from here on in.

--move it out of the way in case we do something dumb.
mv /boot/initrd.fil /boot/initrd.bak;
cd /tmp;
-- unzip the initrd into a temporary file
gzip -dc /boot/initrd.bak /tmp/initrd.img;
-- mount the unzip initrd throug a loop backup device
mount /tmp/initrd.img /mnt/floppy -o loop;
-- edit the linuxrc script
vi /mnt/floppy/linuxrc;
change the line
mount -o defaults --ro -t ext3 /dev/root /sysroot
to
mount -o defaults --ro -t ext2 /dev/root /sysroot
save and exit;
-- unmount file system
umount /mnt/floppy;
-- zip initrd and put back
gzip -c /tmp/initrd.img > /boot/initrd.fil;
-- remove temp file
rm /tmp/initrd.img;
-- reboot error should be gone.
 
Old 01-03-2004, 12:54 PM   #9
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Original Poster
Rep: Reputation: 97
That would be fine, but I'm not using an initrd. The kernel I'm running I compiled myself, and I haven't installed an initrd. It's just the compiled bzImage that results from doing 'make bzImage' when you compile a kernel from source.

(this makes booting take a little longer, but means less messing around when I'm compiling and testing kernels, and as I mentioned I don't have much space to play with on /boot anyway).

i.e. The contents of /boot are:
bzImage-2.4.23-31_12_03 <- this is just a bzImage.
grub <- directory
test <- directory
kernel.h
lost+found
System.map
 
Old 01-03-2004, 01:22 PM   #10
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
I don't know the details of how the bzImage is constructed. Your best bet would be to remove the bzImage from under the /usr/src/linux directory, and try to rebuild it again. I like using initrd because they are very customizable. I always have stupid trouble when creating a new kernel. For me it wouldn't be worth the risk and headache just for a stupid warning when mounting the read-only filesystem.
 
Old 01-03-2004, 01:32 PM   #11
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Original Poster
Rep: Reputation: 97
True, true.

I'll hunt around the grub manuals (god damn that 'info' system), and see what I can find in kernel documents.

Cheers for the help (esp. the link in post #2)!

Dave
 
Old 01-03-2004, 01:34 PM   #12
g-rod
Member
 
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Its not in grub. It would be somewhere in the kernel docs.
 
Old 03-02-2004, 12:53 AM   #13
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Original Poster
Rep: Reputation: 97
Long time, but I've finally stumbled on a solution (the reason I'm posting this after so long is that this is the first hit on Google for 'remove ext3 journal', so it might help someone...)

Anyway, forcing an ext2 fsck appears to solve the problem

i.e.
# e2fsck -f /dev/hda1

Dave
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
EXT3-fs: error loading journal Delphinusnz Fedora 12 07-28-2009 11:59 AM
Ext3 journal corruption? Arkanoid Linux - Hardware 10 10-12-2005 05:02 AM
EXT3-fs: error loading journal canyon289 Fedora 2 06-23-2005 03:02 PM
EXT3 recovering journal during boot rjw1678 Mandriva 1 03-28-2005 10:23 AM
Turning off the ext3 journal? Phaethar Red Hat 2 02-04-2004 10:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:12 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