LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Embedded & Single-board computer (http://www.linuxquestions.org/questions/forumdisplay.php?f=78)
-   -   Read Only File system (http://www.linuxquestions.org/questions/showthread.php?t=4175433011)

PrayingMantis 10-19-2012 01:50 AM

Read Only File system
 
Hi Guys,

I am using RedHat (kernel: 2.4.32) on my embedded device.

The device which uses a CF, mounted as Read-Write, becomes read-only with the following error in dmesg:

Code:

_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35540, sector=33556
end_request: I/O error, dev 03:01 (hda), sector 33556
hda: write_intr error1: nr_sectors=4, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35542, sector=33558
end_request: I/O error, dev 03:01 (hda), sector 33558
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35544, sector=33560
end_request: I/O error, dev 03:01 (hda), sector 33560
attempt to access beyond end of device
03:01: rw=1, want=603316511, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=1419531931, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=453756917, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=1924671130, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=99783895, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=1448032459, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=1955962354, limit=499472
hda: write_intr error1: nr_sectors=4, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35290, sector=33306
end_request: I/O error, dev 03:01 (hda), sector 33306
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35292, sector=33308
end_request: I/O error, dev 03:01 (hda), sector 33308
hda: write_intr error1: nr_sectors=4, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35326, sector=33342
end_request: I/O error, dev 03:01 (hda), sector 33342
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35328, sector=33344
end_request: I/O error, dev 03:01 (hda), sector 33344
attempt to access beyond end of device
03:01: rw=1, want=1802612460, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=2013165295, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=2093294207, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=99743100, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=25160966, limit=499472
attempt to access beyond end of device
03:01: rw=1, want=1186893051, limit=499472
hda: write_intr error1: nr_sectors=12, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35334, sector=33350
end_request: I/O error, dev 03:01 (hda), sector 33350
hda: write_intr error1: nr_sectors=10, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35336, sector=33352
end_request: I/O error, dev 03:01 (hda), sector 33352
hda: write_intr error1: nr_sectors=8, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35338, sector=33354
end_request: I/O error, dev 03:01 (hda), sector 33354
hda: write_intr error1: nr_sectors=6, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35340, sector=33356
end_request: I/O error, dev 03:01 (hda), sector 33356
hda: write_intr error1: nr_sectors=4, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35342, sector=33358
end_request: I/O error, dev 03:01 (hda), sector 33358
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=35344, sector=33360
end_request: I/O error, dev 03:01 (hda), sector 33360
journal_bmap: journal block not found at offset 3191 on ide0(3,1)
Aborting journal on device ide0(3,1).
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=2534, sector=550
end_request: I/O error, dev 03:01 (hda), sector 550
ext3_abort called.
EXT3-fs abort (device ide0(3,1)): ext3_journal_start: Detected aborted journal
Remounting filesystem read-only
EXT3-fs error (device ide0(3,1)) in start_transaction: Journal has aborted
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=34770, sector=32786
end_request: I/O error, dev 03:01 (hda), sector 32786
hda: write_intr error1: nr_sectors=4, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=1986, sector=2
end_request: I/O error, dev 03:01 (hda), sector 2
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=1988, sector=4
end_request: I/O error, dev 03:01 (hda), sector 4
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=34754, sector=32770
end_request: I/O error, dev 03:01 (hda), sector 32770
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=34760, sector=32776
end_request: I/O error, dev 03:01 (hda), sector 32776
hda: write_intr error1: nr_sectors=4, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=34766, sector=32782
end_request: I/O error, dev 03:01 (hda), sector 32782
hda: write_intr error1: nr_sectors=2, stat=0x51
hda: write_intr: status=0x51 { DriveReady SeekComplete Error }
hda: write_intr: error=0x80 { BadSector }, LBAsect=34768, sector=32784
end_request: I/O error, dev 03:01 (hda), sector 32784
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #12293: rec_len is smaller than minimal - offset=0, inode=1262895942, rec_len=0, name_len=27
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #14338: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #12293: rec_len is smaller than minimal - offset=0, inode=1262895942, rec_len=0, name_len=27
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #14338: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #12293: rec_len is smaller than minimal - offset=0, inode=1262895942, rec_len=0, name_len=27
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #14338: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #14338: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #14338: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #12293: rec_len is smaller than minimal - offset=0, inode=1262895942, rec_len=0, name_len=27
EXT3-fs error (device ide0(3,1)): ext3_readdir: bad entry in directory #14338: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, name_len=0

This happens not just on a single board, but many.

e2fsck returns a lot of "inode" related errors, and I think if I try to fix them using fsck, it might destory the data I have.

Any Suggestions?

Thanks.

syg00 10-19-2012 03:15 AM

I don't know anything about CF, but you'd better look real close at your mount options. And your filesystem options - check out the manpage for tune2fs.
As for fsck - there is always the possibly it is going to munge data; it's designed to ensure the consistency of filesystems (metadata), not the contents there-in. Most of the time most of us might be lucky, but you can never be sure. Short answer is I never trust the filesystem after something like you are seeing - I reformat it and restore in-toto.

eSelix 10-19-2012 03:44 AM

By CF you mean a CompactFlash memory card? Did you used the same card on these different boards or all have own card? If the same then most probably card is broken, they have limited write cycles. Also using a journaling with ext3 is not a good option for theses devices (too many writes). You need to use system or configure it that it does not need to write to disk too many data (get rid of logs, mount /var in memory, etc).

PrayingMantis 10-19-2012 03:58 AM

Quote:

Originally Posted by eSelix (Post 4809744)
By CF you mean a CompactFlash memory card? Did you used the same card on these different boards or all have own card? If the same then most probably card is broken, they have limited write cycles. Also using a journaling with ext3 is not a good option for theses devices (too many writes). You need to use system or configure it that it does not need to write to disk too many data (get rid of logs, mount /var in memory, etc).

Hi eSelix,

Thank you for your reply.

Yes I am using a Compact Flash (64M) on my boards, and each board has its own CF Card. I tried to google about these errors and realised the problem might be the Compact Flash is nearing its end. Another reason might be the power supply (I'm not quite sure).

However, the problem is not just with a single board, it is reproducible with many of them.

Any suggestions?

Thanks Again.

PrayingMantis 10-19-2012 04:04 AM

Quote:

Originally Posted by syg00 (Post 4809732)
I don't know anything about CF, but you'd better look real close at your mount options. And your filesystem options - check out the manpage for tune2fs.
As for fsck - there is always the possibly it is going to munge data; it's designed to ensure the consistency of filesystems (metadata), not the contents there-in. Most of the time most of us might be lucky, but you can never be sure. Short answer is I never trust the filesystem after something like you are seeing - I reformat it and restore in-toto.

Hi Syg,

Thank you for replying.

I mount the Compact Flash using (MS_MANDLOCK | MS_NOATIME | MS_NODIRATIME), on my board.

The mount is done by a linuxrc script (in initrd) during boot, and the CF is mounted as /var on my board.

Do you think reflashing is the only option left, to recover from this error?

In the meanwhile I will read the man pages for tune2fs.

Thanks again.

syg00 10-20-2012 04:14 AM

I would mkfs without question. Maybe you'll have to look at running without a journal - can be done on ext3, but ext4 might be a better option these days.


All times are GMT -5. The time now is 11:57 PM.