Re: Problems with Ext2fs on a CF card.
- From: Mic <michaelzwrk@xxxxxxxxx>
- Date: 24 May 2007 08:09:16 -0700
On May 22, 4:01 am, phil-news-nos...@xxxxxxxx wrote:
On 20 May 2007 06:59:55 -0700 Mic <michaelz...@xxxxxxxxx> wrote:
| 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.
This issue should be addressed. CF looks like IDE, so this should
appear to the userspace as a device name for an IDE device. The
kernel shouldn't even see a difference other than soem manufacturer
ID info and a small size.
| That's why I run it straight on /dev/hda.
Which should also work.
| 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
Have you rebooted since fdisk stored the partition table? There is an
ioctl() to update the kernel's idea of what partitions are present,
but there are times when that can fail.
| 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.
Something else must be writing on there.
|
| 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,
Try wiping the whole CF clean to zero, then partition it with fdisk, save
the partition table, verify it is saved with "fdisk -l /dev/hda", and
reboot (with NFS, still) again. Now verify again with "fdisk -l /dev/hda"
and with "dmesg | grep hda". At this point "mkfs.ext2 /dev/hda1" should
work. Or maybe try "mke2fs /dev/hda1". If they fail still, add the -F
option (and be careful you are really typing right). Verify that your
node is created correctly, too:
root@varuna:/root 1# ls -ld /dev/hda
brw-rw---- 1 root disk 3, 0 2002-06-09 14:27 /dev/hda
root@varuna:/root 2#
If you don't see 3 and 0 in there, something is wrong with the node.
--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2007-05-21-1...@xxxxxxxx |
|------------------------------------/-------------------------------------|
Hi.
First, thanks for the help.
I still have the problem, but maybe now I can add some more info:
1. I followed the recomendation:
1.1.wipe everything out -
dd if=/dev/zero of=/dev/hda
1.2 fdisk, fdisk -l -
fdisk -l /dev/hda
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
Still, the mkfs does not work:
1.3 mke2fs -F /dev/hda1
mke2fs 1.38 (30-Jun-2005)
mke2fs: No such file or directory while trying to determine filesystem
size
I also bought a card reader and created the partition and a filesystem
successfully from the Linux host PC:
2.1 fdisk -l /dev/sdd
Disk /dev/sdd: 512 MB, 512483328 bytes
16 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 992 * 512 = 507904 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 505 250449 83 Linux
2.2 mke2fs /dev/sdd1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0) ....
I then booted over NFS on the embedded.
the fdisk -l successfully read the partition table, but mke2fs failed.
BTW -
I noticed fdisk read the disk info differently:
On the embedded:
16 heads, 63 sectors/track, 993 cylinders
On the host PC:
16 heads, 62 sectors/track, 1009 cylinders
Why can it be?
Can it be the cause of the problems?
Also, the versions I used were:
on the host PC:
mke2fs 1.35, fdisk 2.12a
on the embedded:
mke2fs 1.38
fdisk 2.12
Thanks again,
Michael
.
- Follow-Ups:
- Re: Problems with Ext2fs on a CF card.
- From: phil-news-nospam
- Re: Problems with Ext2fs on a CF card.
- References:
- Problems with Ext2fs on a CF card.
- From: Mic
- Re: Problems with Ext2fs on a CF card.
- From: phil-news-nospam
- Problems with Ext2fs on a CF card.
- Prev by Date: Re: ARM development board recommendation
- Next by Date: Re: ARM development board recommendation
- Previous by thread: Re: Problems with Ext2fs on a CF card.
- Next by thread: Re: Problems with Ext2fs on a CF card.
- Index(es):
Relevant Pages
|