Problems with Ext2fs on a CF card.



Hi.
I use a Compact Flash card (SanDisk) to hold an ext2 Linux File System
on an embedded system, running 2.6 Linux.
The CF is connected in true IDE mode.
I have numerous problems running a File System from the CF: mkfs does
not work on partitions, fsck reports errors after booting from the CF
etc. and the FS gets corrupted over time.
Below is the procedure I follow to put the FS on the CF.
Please advise if you recognize any faults in the procedure or have any
idea what else I can check - any help is most welcome.

Here is what I do:
------------------------
Boot over NFS
mkfs.ext2 /dev/hda
mount -t ext2 /dev/hda /mnt/hda/
cd /mnt/hda
tar -xvjf /my_file_system.tar.bz2
Boot over CF.

Notes and Problems I see:
------------------------
1. cannot mkfs partition
if I use fdisk to create partitions (i.e. hda1, hda2), mkfs fails.
That's why I run it straight on /dev/hda.
fdisk:
Disk /dev/hda: 512 MB, 512483328 bytes
16 heads, 63 sectors/track, 993 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 497 250456+ 83 Linux
/dev/hda2 498 993 249984 83 Linux

mkfs.ext2 /dev/hda1
mke2fs 1.38 (30-Jun-2005)
mkfs.ext2: No such file or directory while trying to determine
filesystem size


2. fsck complains right after untar
fsck -t ext2 /dev/hda
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/hda was not cleanly unmounted, check forced.

3. After booting from CF, and rebooting over NFS to run fsck:
3. After reboot from CF, another reset:
fsck -t ext2 /dev/hda
fsck 1.38 (30-Jun-2005)
e2fsck 1.38 (30-Jun-2005)
/dev/hda was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Inode 85069, i_blocks is 16, should be 2. Fix<y>? yes
Free blocks count wrong for group #23 (768, counted=769).
Fix<y>? yes...


Thanks for your help,
Michael

.



Relevant Pages

  • Re: wifi usb adaptor
    ... networking, and external backup drives, and so on). ... I'd love to use EXT3 but the IFS driver only supports the basic EXT2 FS. ... event fscks the file system into doing its disappearing act. ... FSCK utility rather than buy one that needs a 7 hour scan followed by ...
    (uk.comp.homebuilt)
  • Re: Problems with Ext2fs on a CF card.
    ... | I use a Compact Flash card to hold an ext2 Linux File System ... fsck reports errors after booting from the CF ... Have you rebooted since fdisk stored the partition table? ...
    (comp.os.linux.embedded)
  • Re: Forced FSCK on Bad Reboot
    ... >Why use a journalled file system then? ... >Use ext2 which has the slow fsck as the only way to recover. ... If you want to do an extended, then change to ext2. ... Even a journaled file system is subject to corruption. ...
    (Fedora)
  • RE: serioup problem after running fsck
    ... I'm not an expert in recovery and I'm not sure you could recover at ... > The easiest and first thing is to run fsck again (although I ... Running it once is no guarantee that the file system ... > shutdown command from the command line or the shutdown menu ...
    (RedHat)
  • fstab entries for external USB hard drives led to fsck.ext3 failure on boot, bug?
    ... 'F!3@$%ing fsck! ... Please repair the file system manually. ... CONTROL-D will terminate this shell and resume system boot. ... were to allow me to quickly mount an external hard drive ...
    (Debian-User)