Re: Problems with Ext2fs on a CF card.



Mic <michaelzwrk@xxxxxxxxx> wrote:
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

no. first you do an fdisk and setup the partition(s), even if it is only
one partition. After you have setup the partion(s), then you use mkfs
to make the kind of file system you want on each partition e.g.

mkfs -t ext2 /dev/hda1

If you can't fdisk it then something is up.

When you've made your partitions in fdisk you have done the 'w' command to
write the partition table to disk?



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: Writing File System Driver & Creating Virtual Disk Drive in Windows XP [Question by a Novice
    ... strange partition it should be safe, but having a backup of it would be a ... virtual disk, but this is quite dodgy - if you make a mistake here (and ... He needs a file system. ... ***How to show partitions in windows explorer? ...
    (microsoft.public.win32.programmer.kernel)
  • Re: reformating and fdisking help
    ... Fdisk will delete any partition you ... >> tell it too no matter what file system is on that partition. ... technical details usually just confuses them. ...
    (microsoft.public.windowsxp.general)
  • Re: Problems with Ext2fs on a CF card.
    ... | I use a Compact Flash card to hold an ext2 Linux File System ... Have you rebooted since fdisk stored the partition table? ...
    (comp.os.linux.embedded)
  • Re: large disk space problem?
    ... whole drive as one partition), fdisk is one tool that you can use. ... looks like the partition was resized but the file system wasn't. ... I was never too good at figuring out fdisk block counts, ... 156288321 blocks times 512 byte blocks times two ...
    (Fedora)
  • Re: reformating and fdisking help
    ... >> The point was that the file system does matter using FDISK. ... > tell it too no matter what file system is on that partition. ...
    (microsoft.public.windowsxp.general)