Re: Problems with Ext2fs on a CF card.
- From: phil-news-nospam@xxxxxxxx
- Date: 22 May 2007 01:01:59 GMT
On 20 May 2007 06:59:55 -0700 Mic <michaelzwrk@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-1953@xxxxxxxx |
|------------------------------------/-------------------------------------|
.
- Follow-Ups:
- Re: Problems with Ext2fs on a CF card.
- From: Mic
- Re: Problems with Ext2fs on a CF card.
- References:
- Problems with Ext2fs on a CF card.
- From: Mic
- Problems with Ext2fs on a CF card.
- Prev by Date: Re: Most mature Linux GSM SMS box...
- Next by Date: Re: how to pre-grow file to certain size ?
- 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
|