Gentoo Archives: gentoo-user

From: Francisco Ares <frares@×××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] Re: Need help: Filesystem (ext4) corrupted!
Date: Tue, 03 Sep 2013 14:14:51
Message-Id: CAHH9eM6HAwyoAzkmWcXsCLwuZwg0RHiF=L=aFrJkS52m37+DAA@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: Need help: Filesystem (ext4) corrupted! by William Kenworthy
1 2013/9/3 William Kenworthy <billk@×××××××××.au>
2
3 > On 03/09/13 11:26, meino.cramer@×××.de wrote:
4 > > William Kenworthy <billk@×××××××××.au> [13-09-03 05:08]:
5 > >> On 03/09/13 10:45, meino.cramer@×××.de wrote:
6 > >>> walt <w41ter@×××××.com> [13-09-03 04:15]:
7 > >>>> On 09/02/2013 09:15 AM, meino.cramer@×××.de wrote:
8 > >>>>> The rootfs and $HOME of my embedded system is stored
9 > >>>>> on a 16GB SD-card (about 5GB used, rest free). The FS
10 > >>>>> is ext4.
11 > >>>>>
12 > >>>>> Since the system hangs for unknown reasons several times
13 > >>>> Does it hang at a predictable point, like during boot, or poweroff?
14 > >>>>
15 > >>>> I know almost nothing about SD cards (yet). Do they develop bad
16 > >>>> blocks like other storage media? I notice fsck.ext4 has a -c flag
17 > >>>> to check for bad blocks.
18 > >>>>
19 > >>> No, it hangs while compiling or while updateing (eix-sync; emerge ...).
20 > >>>
21 > >>>
22 > >>> I did the following now:
23 > >>> I did a binary image backup with dd of the sdcard.
24 > >>> I made a backup of the all files from the bad fs with tar.
25 > >>> I say "YES" to fsck to fix what it found.
26 > >>> I made another backup of the all files from the bad fs with tar.
27 > >>> I md5summed both tar archives and found them identical.
28 > >>>
29 > >>> Now...is the conclusion correct, that the identical md5sum
30 > >>> indicate, that the fixed error of the fs only had impact to
31 > >>> already invalidated data?
32 > >>> Or whatelse could this indicate?
33 > >>>
34 > >>> Best regards,
35 > >>> mcc
36 > >>>
37 > >>> PS: What come mind just in this moment:
38 > >>> Can I ran fsck on an binary image of the fs which I made with dd
39 > somehow?
40 > >>>
41 > >>>
42 > >>>
43 > >>>
44 > >>>
45 > >> Have you run out of inodes? - ext 4 has had very mixed success for me on
46 > >> solid state. Running out of inodes is a real problem for gentoo on
47 > >> smaller SD cards with standard settings.
48 > >>
49 > >> BillK
50 > >>
51 > >>
52 > >>
53 > > Does this error message from fsck indicate that? I am really bad in
54 > > guessing what fsck tries to cry at me ... ;)
55 > >
56 > >
57 > >>> solfire:/root>fsck.ext4 -f -p /dev/sdb2
58 > >>> rootfs: Inodes that were part of a corrupted orphan linked list
59 > found.
60 > >>>
61 > >>> rootfs: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
62 > >>> (i.e., without -a or -p options)
63 > >>> [1] 18644 exit 4 fsck.ext4 -f -p /dev/sdb2
64 > >>>
65 > >>>
66 > > Is there any way to correct the settings from the default values to
67 > > more advances ones, which respect the sdcard size of 16GB *without*
68 > > blanking it...a "correction on the fly" so to say???
69 > >
70 > > And if not: Is there a way to backup the sdcard and playback the files
71 > > after reformatting it by preserving all three time stamps of the
72 > > files (atime is deactivated via fstab though) ?
73 > >
74 > > Best regards,
75 > > mcc
76 > >
77 > >
78 > >
79 > >
80 > >
81 > df -i - if you get 100% iUSE or near to it thats your problem ... I have
82 > seen that error message you give as a result of running out of inodes
83 > corrupting the FS.
84 >
85 > No, your only way out is to copy (I use rync) the files off, recreate
86 > the fs with max inodes ("man mke2fs") and rsync the files back. Once an
87 > ext* fs has been created with a certain number of inodes its fixed until
88 > you re-format.
89 >
90 > I get it happening regularly on 4G cards when I forget and just emerge a
91 > couple of packages without cleaning up in between packages. On 16G
92 > cards, its compiling something like glibc or gcc that uses huge numbers
93 > of inodes at times. On a single 32G card I have, the standard settings
94 > have been fine ... so far :)
95 >
96 > Billk
97 >
98 >
99 >
100 Just my 2 cents: while updating I think it would it be a good practice to
101 have some sort of external storage (even networked) and do a unionfs with
102 the working file system. Some folders inside /usr use to keep almost half
103 (more, sometimes) of all files in my systems (like "/usr/portage" ,
104 "/usr/src" and "/usr/include" , which are not needed while not under system
105 maintenance).
106
107 Francisco

Replies