Linux - GeneralThis 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
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.
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.
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.
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.
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.
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?
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.
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
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.