[Solved] Dirty Ext2 FS every time on FireBee...what's the issue??

All things related to the Atari Coldfire Project

Moderators: Mathias, Mug UK, moondog/.tSCc., [ProToS], Galvez, Moderator Team

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby wongck » Sun Sep 14, 2014 10:58 am

No real solution, I think it is the datetime not setup correctly as the clock battery is dead may be a cause of it.
Secondary, there is just a beta compilation of fsck tools for the FB, but I am using it.
So not even sure what is the real issue, so...

but I am using it. It just use GParted to write over it if it gets tool bad.
It's a pity as my dev tools are all there on the ext2 fs and at times I spend more time on this issue than doing any productive work.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby helmut » Sun Sep 14, 2014 9:40 pm

If it's a date/time-issue: why not remove the check from the boot-process and run fsck when date is set from a command-shell?
That's what I do anyway.
But then there should be no serious errors on the fs ..

-Helmut

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby wongck » Mon Sep 15, 2014 3:43 pm

yes.
but many times running from command shell cannot lock the disk and so it cannot do fsck.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby helmut » Mon Sep 15, 2014 8:37 pm

This is my script:

Code: Select all

#!/bin/ksh
if [ x$1 == x-a ]; then
        ALL=1
        shift
else
        ALL=0
fi
while read -A l ; do
        if [ ${l[5]} == 1 ]; then       # root-partition ..
                L=(${l[*]})
        else
                [ $ALL == 1 ] && /sbin/fsck.${l[2]} -p ${l[0]}
        fi
done </etc/fstab
exec /sbin/fsck.${L[2]} -a $* ${L[0]}


note the exec in the last line. This should work (using exec I mean). There is no AES or daemon, just the shell running. You won't be able to run the script because I have written /etc/fstab manually (I think):

Code: Select all

d:      /d      fat     defaults 0 2
e:      /e      vfat    defaults 0 2
f:      /f      ext2    defaults 0 1


-Helmut

joska
Hardware Guru
Hardware Guru
Posts: 3675
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby joska » Tue Sep 16, 2014 6:43 am

helmut wrote:You won't be able to run the script because I have written /etc/fstab manually (I think):


A small suggestion: Instead of a static text file you could write a small program that enumerates the current drives and their filesystem and outputs this to stdout. You could then use this as input to your script. While your solution works perfectly on a static setup, it won't work on a setup where the drives may change between boots. E.g. I'm booting from two different SD-cards on my Firebee, both with different partitioning. And the SD-card in drive A could be anything.

Of course, a program that enumerates the drives can just as well call e2fsck/dosfsck/whatever itself, depending on the filesystem on each drive/partition. That would be quicker, although not by much on a relatively fast computer like the Firebee.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

joska
Hardware Guru
Hardware Guru
Posts: 3675
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby joska » Tue Sep 16, 2014 7:51 pm

helmut wrote:If it's a date/time-issue: why not remove the check from the boot-process and run fsck when date is set from a command-shell?


I tested this just now. e2fsck still complains even if I set the clock first.

First run: Complains about "not cleanly shut down" and does a check of the fs without finding anything wrong.
Second run: e2fsck say that the partition is clean.

I then shut down properly and reboot. Same happens again.

Looks like *something* happens (or not happens) during shut-down.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby helmut » Tue Sep 16, 2014 8:24 pm

I noticed that on aranym the system-clock is 48 s behind the host's clock for some reason. So I fix it by shifting the time by 48 s from mint.cnf forward (using a shell-script ;)). Now when I run e2fsck it also always complains about a wrong time or something, but apart from that there is no issue.

Ext2 seems to track the time of boot and the time of mount/check or whatever. But that is only e2fsck, not the xfs here.

Your other reply: Yes, would be cool to let fstab be generated automatically, but I don't know how, and I'm happy it works at all ;)

-Helmut

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Dirty Ext2 FS every time on FireBee... Mint/Xaaes issue?

Postby wongck » Wed Sep 17, 2014 12:47 am

What I found out was at even if I manage to do a fsck in bash, then sync x 3 times and shutdown, it will still says soemthing not right on boot-up. My thinking is that FB implementation of the IDE may be cached and so may actually only write to the HDD after everything or some time later.... this is just my theory, nothing to back up the theory.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

joska
Hardware Guru
Hardware Guru
Posts: 3675
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby joska » Wed Sep 17, 2014 7:42 am

Or the filesystem is not properly "flagged" when shutting down. I think I should examine the ext2 partition with a disk editor and see if I can find something.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

joska
Hardware Guru
Hardware Guru
Posts: 3675
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby joska » Fri Sep 19, 2014 8:41 am

I had a look at this last night, but did not get any wiser. I have probably not understood how this works.

By looking at this document it looks like the member s_state of the superblock indicates if the filesystem was cleanly unmounted or not.

16bit value indicating the file system state. When the file system is mounted, this state is set to EXT2_ERROR_FS. After the file system was cleanly unmounted, this value is set to EXT2_VALID_FS.

When mounting the file system, if a valid of EXT2_ERROR_FS is encountered it means the file system was not cleanly unmounted and most likely contain errors that will need to be fixed.


EXT2_ERROR_FS is defined as 2 and EXT2_VALID_FS defined as 1. So I would expect to find either of these in s_state in the superblock. But I don't. Regardless of how the partition is unmounted s_state is always 0. It is also 0 when the partition is mounted. I have tested the SD-card with the partition in both my Firebee and on a PC running Linux. The state of the superblock after shutdown/unmounting is the same in both cases. Linux does not complain when mounting it, even when it has been unmounted by the Firebee. e2fsck on the Firebee always complains though. I believe shutdown/unmounting on MiNT/Firebee is correct since Linux finds the partition OK.

I guess I have to look further into how e2fsck makes this decision :)

Edit: I think the next step is to test the same e2fsck and partition on the Milan to see if this is a Firebee specific problem. It just occured to me that the ext2-partitions on my Milan are created by mke2fs on the Milan itself and it's running an ancient e2fsck from SpareMiNT. This e2fsck does not understand the ext2-partitions on my Firebee - probably because these are made on a Linux computer.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby wongck » Fri Sep 19, 2014 8:58 am

Wild guess.... May be issue of short integer and normal integer when reading the s_state ?
needing -mshort or something like that??? dunno.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

joska
Hardware Guru
Hardware Guru
Posts: 3675
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby joska » Fri Sep 19, 2014 10:40 am

wongck wrote:Wild guess.... May be issue of short integer and normal integer when reading the s_state ?
needing -mshort or something like that??? dunno.


I would assume that such an error would make e2fsck not work at all. But yes, it could be a bug in e2fsck.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

BlankVector
Captain Atari
Captain Atari
Posts: 407
Joined: Wed Oct 24, 2007 7:52 pm
Location: France
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby BlankVector » Fri Sep 19, 2014 10:56 am

On my FireBee,I have no e2fsck, but indeed something complains on each boot. I suppose it is the kernel itself, when it mounts the ext2 partition.

joska
Hardware Guru
Hardware Guru
Posts: 3675
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby joska » Fri Sep 19, 2014 12:04 pm

Would it be possible to send me a dump of the superblock on that ext2 partition? The superblock starts at offset 1024 from the start of the partition and is 1024 bytes long.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11990
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby wongck » Fri Sep 19, 2014 12:31 pm

joska wrote:
wongck wrote:Wild guess.... May be issue of short integer and normal integer when reading the s_state ?
needing -mshort or something like that??? dunno.


I would assume that such an error would make e2fsck not work at all. But yes, it could be a bug in e2fsck.


If it is used to keep numeric values for counting, it should be OK.
if it used to store bytes of certain length, it would then be wrong.
Then again my C is not that good.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby helmut » Sat Sep 20, 2014 7:17 am

There is a tool dumpe2fs which displays all relevant parameters of a drive. No need for a diskeditor I guess.

Maybe you have Maximum mount count set 0?

Second I would only use MiNT-tools (esp. mke2fs) to setup the fs not an external computer.

Third the versions of mke2fs and e2fsck should match.

-Helmut

User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 829
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby jfl » Sat Sep 20, 2014 7:40 am

helmut wrote:Second I would only use MiNT-tools (esp. mke2fs) to setup the fs not an external computer.

Ideally yes, but unfortunately this is not possible on the FireBee (or at least it wasn't when I got mine and I'm not aware that the situation has changed).
Jean-François
GEMDict – GEMClip

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby helmut » Sat Sep 20, 2014 9:14 am

I don't have a firebee, but I think it should work:

See:
http://forum.atari-home.de/index.php?topic=10234.700

Or ask Mattias :)

-Helmut

BlankVector
Captain Atari
Captain Atari
Posts: 407
Joined: Wed Oct 24, 2007 7:52 pm
Location: France
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby BlankVector » Sat Sep 20, 2014 11:47 am

I have just recompiled e2fsprogs for ColdFire (including mke2fs, tune2fs, dumpe2fs, e2fsck...):
http://vincent.riviere.free.fr/soft/m68 ... e2fsprogs/

I tried e2fsck on my ext2 partition originally formatted from Linux, but:

Code: Select all

# e2fsck d:
e2fsck: Filesystem has unsupported feature(s) (d:)
e2fsck: Get a newer version of e2fsck!


There is probably something too new there:

Code: Select all

# dumpe2fs -h d: |grep 'Filesystem features'
dumpe2fs 1.27 (8-Mar-2002)
Filesystem features:      ext_attr resize_inode dir_index filetype sparse_super large_file


So it seems that recent ext2 partitions are compatible with ext2.xfs, but not with the old e2fsck 1.27.

We should updade to the latest e2fsprogs, however that's not easy. FreeMiNT has no support for mass storage devices (/dev/sda...) so any Linux mass storage tool must be heavily patched for XHDI support. I don't know how much efforts would be needed to port the old SpareMiNT patch to newer e2fsprogs.

User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 829
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby jfl » Sat Sep 20, 2014 12:35 pm

helmut wrote:I don't have a firebee, but I think it should work:
See:
http://forum.atari-home.de/index.php?topic=10234.700

Actually I wasn't clear: it's the partitioning that cannot be done on the FireBee (HDDriver doesn't support the machine).
Jean-François
GEMDict – GEMClip

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby helmut » Sat Sep 20, 2014 12:50 pm

But then you should still be able to run mke2fs. I don't understand.

User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 829
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby jfl » Sat Sep 20, 2014 1:02 pm

helmut wrote:But then you should still be able to run mke2fs. I don't understand.

Yes, it should be possible. I wrongly mixed up partitioning and formatting. But I never used mke2fs on the FireBee myself.
Jean-François
GEMDict – GEMClip

BlankVector
Captain Atari
Captain Atari
Posts: 407
Joined: Wed Oct 24, 2007 7:52 pm
Location: France
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby BlankVector » Sat Sep 20, 2014 1:30 pm

I have just made a few experiments:

1) Provided that you have a clean ex2 partition, EXT2.XFS does not complain on boot. Whatever ext2 version.

2) If you always correctly shutdown FreeMiNT (ex: Ctrl+Alt+H with XaAES), your ext2 partition stays clean.

3) If for some reason you don't shutdown correctly (crash, reset button...) then your ext2 partition is flagged dirty and EXT2.XFS complains on startup. The only solution is to run e2fsck to check and/or fix the filesystem.

4) Unfortunately, the old e2fsck 1.27 is unable to check ext2 partitions created with newer tools (ex: current Linux distributions), due to new ext2 features.

5) If you have a new ext2 partition, a solution is to move your CompactFlash card to a Linux computer and run the new e2fsck there. Not very handy.

6) Another solution (the one I used) is to compile the old mke2fs 1.27 on Linux. Then backup and reformat the partition on Linux. Of course, I used tar to backup and restore the data, before and after the operation. It worked like a charm, now I can run the old e2fsck 1.27 on my FireBee without trouble, and get rid of the startup complaints.

7) Another solution would have been to do the backup and restore on the FireBee itself (to /ram ??) and run the old mke2fs there, but I have not been brave enough to do that.

Conclusion:
Until someone ports newer e2fsprogs to FreeMiNT, we have to format the ext2 partitions using the old mke2fs.

NB: Due to bug-or-features, it seems that newer e2fsprogs are unable to format ext2 partitions without newer features - at least sparse_super.

helmut
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Jan 07, 2010 4:30 pm

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby helmut » Sat Sep 20, 2014 1:34 pm

Why don't you use Alans builds?

http://gentoo.atariforge.org/files/sys-fs/

joska
Hardware Guru
Hardware Guru
Posts: 3675
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Dirty Ext2 FS every time on FireBee...what's the issue??

Postby joska » Sat Sep 20, 2014 1:39 pm

That's the one I use, and e2fsck does not complain about my Linux generated ext2 partition - except for the "not cleanly unmounted" issue.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64


Social Media

     

Return to “FireBee”

Who is online

Users browsing this forum: No registered users and 2 guests