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: Fri, 06 Sep 2013 15:19:20
Message-Id: CAHH9eM6BaWg2Dc2qe1b0Fb0xG_1uFcPPfjfGfN2n2V_4NhobbA@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: Need help: Filesystem (ext4) corrupted! by meino.cramer@gmx.de
1 2013/9/3 <meino.cramer@×××.de>
2
3 > Francisco Ares <frares@×××××.com> [13-09-04 02:08]:
4 > > Em 03/09/2013 13:12, <meino.cramer@×××.de> escreveu:
5 > > >
6 > > > William Kenworthy <billk@×××××××××.au> [13-09-03 17:16]:
7 > > > > On 03/09/13 11:26, meino.cramer@×××.de wrote:
8 > > > > > William Kenworthy <billk@×××××××××.au> [13-09-03 05:08]:
9 > > > > >> On 03/09/13 10:45, meino.cramer@×××.de wrote:
10 > > > > >>> walt <w41ter@×××××.com> [13-09-03 04:15]:
11 > > > > >>>> On 09/02/2013 09:15 AM, meino.cramer@×××.de wrote:
12 > > > > >>>>> The rootfs and $HOME of my embedded system is stored
13 > > > > >>>>> on a 16GB SD-card (about 5GB used, rest free). The FS
14 > > > > >>>>> is ext4.
15 > > > > >>>>>
16 > > > > >>>>> Since the system hangs for unknown reasons several times
17 > > > > >>>> Does it hang at a predictable point, like during boot, or
18 > poweroff?
19 > > > > >>>>
20 > > > > >>>> I know almost nothing about SD cards (yet). Do they develop bad
21 > > > > >>>> blocks like other storage media? I notice fsck.ext4 has a -c
22 > flag
23 > > > > >>>> to check for bad blocks.
24 > > > > >>>>
25 > > > > >>> No, it hangs while compiling or while updateing (eix-sync; emerge
26 > > ...).
27 > > > > >>>
28 > > > > >>>
29 > > > > >>> I did the following now:
30 > > > > >>> I did a binary image backup with dd of the sdcard.
31 > > > > >>> I made a backup of the all files from the bad fs with tar.
32 > > > > >>> I say "YES" to fsck to fix what it found.
33 > > > > >>> I made another backup of the all files from the bad fs with tar.
34 > > > > >>> I md5summed both tar archives and found them identical.
35 > > > > >>>
36 > > > > >>> Now...is the conclusion correct, that the identical md5sum
37 > > > > >>> indicate, that the fixed error of the fs only had impact to
38 > > > > >>> already invalidated data?
39 > > > > >>> Or whatelse could this indicate?
40 > > > > >>>
41 > > > > >>> Best regards,
42 > > > > >>> mcc
43 > > > > >>>
44 > > > > >>> PS: What come mind just in this moment:
45 > > > > >>> Can I ran fsck on an binary image of the fs which I made with dd
46 > > somehow?
47 > > > > >>>
48 > > > > >>>
49 > > > > >>>
50 > > > > >>>
51 > > > > >>>
52 > > > > >> Have you run out of inodes? - ext 4 has had very mixed success for
53 > > me on
54 > > > > >> solid state. Running out of inodes is a real problem for gentoo
55 > on
56 > > > > >> smaller SD cards with standard settings.
57 > > > > >>
58 > > > > >> BillK
59 > > > > >>
60 > > > > >>
61 > > > > >>
62 > > > > > Does this error message from fsck indicate that? I am really bad in
63 > > > > > guessing what fsck tries to cry at me ... ;)
64 > > > > >
65 > > > > >
66 > > > > >>> solfire:/root>fsck.ext4 -f -p /dev/sdb2
67 > > > > >>> rootfs: Inodes that were part of a corrupted orphan linked
68 > list
69 > > found.
70 > > > > >>>
71 > > > > >>> rootfs: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
72 > > > > >>> (i.e., without -a or -p options)
73 > > > > >>> [1] 18644 exit 4 fsck.ext4 -f -p /dev/sdb2
74 > > > > >>>
75 > > > > >>>
76 > > > > > Is there any way to correct the settings from the default values to
77 > > > > > more advances ones, which respect the sdcard size of 16GB *without*
78 > > > > > blanking it...a "correction on the fly" so to say???
79 > > > > >
80 > > > > > And if not: Is there a way to backup the sdcard and playback the
81 > files
82 > > > > > after reformatting it by preserving all three time stamps of the
83 > > > > > files (atime is deactivated via fstab though) ?
84 > > > > >
85 > > > > > Best regards,
86 > > > > > mcc
87 > > > > >
88 > > > > >
89 > > > > >
90 > > > > >
91 > > > > >
92 > > > > df -i - if you get 100% iUSE or near to it thats your problem ... I
93 > have
94 > > > > seen that error message you give as a result of running out of inodes
95 > > > > corrupting the FS.
96 > > > >
97 > > > > No, your only way out is to copy (I use rync) the files off, recreate
98 > > > > the fs with max inodes ("man mke2fs") and rsync the files back.
99 > Once an
100 > > > > ext* fs has been created with a certain number of inodes its fixed
101 > until
102 > > > > you re-format.
103 > > > >
104 > > > > I get it happening regularly on 4G cards when I forget and just
105 > emerge a
106 > > > > couple of packages without cleaning up in between packages. On 16G
107 > > > > cards, its compiling something like glibc or gcc that uses huge
108 > numbers
109 > > > > of inodes at times. On a single 32G card I have, the standard
110 > settings
111 > > > > have been fine ... so far :)
112 > > > >
113 > > > > Billk
114 > > > >
115 > > > >
116 > > >
117 > > > df -i gives the following:
118 > > >
119 > > > rootfs 971040 352208 618832 37% /
120 > > > /dev/root 971040 352208 618832 37% /
121 > > > devtmpfs 63420 434 62986 1% /dev
122 > > > tmpfs 63456 389 63067 1% /run
123 > > > shm 63456 1 63455 1% /dev/shm
124 > > > cgroup_root 63456 6 63450 1% /sys/fs/cgroup
125 > > > /dev/mmcblk0p1 0 0 0 - /boot
126 > > >
127 > > >
128 > > > You mentioned rsync to backup...
129 > > >
130 > > > I used
131 > > >
132 > > > sudo tar cvf <backup file> <root of embedded system>
133 > > >
134 > > > the rootfs has only one partition...
135 > > >
136 > > > Is it alos ok to use tar or is there any drawback....?
137 > > >
138 > > > Best regards,
139 > > > mcc
140 > > >
141 > > >
142 > > >
143 > >
144 > > There are some parameters for creating a better backup archive using tar,
145 > > like --same-owner and --atime- preserve.
146 > >
147 > > By the way, it would be an interesting project to export some folders on
148 > > your home computer using nfs, tuneling it through ssh, monting it locally
149 > > in your embedded computer, and applying an unionfs to the rootfs. Just
150 > > dreaming, of course.
151 > >
152 > > Góod luck
153 > > Francisco
154 >
155 > Hi Francisco,
156 >
157 > as I understand the man page, --same-owner is only activ while
158 > extracting a tar:
159 >
160 > --same-owner
161 > create extracted files with the same ownership
162 >
163 > while extracting I always use
164 >
165 > --preserve
166 > like --preserve-permissions plus --same-order
167 >
168 > . Atime setting is disabled via fstab on my embedded system for two
169 > reasons:
170 > Performance wise since any access to a file will trigger a write
171 > action to the flash chip even when reading the file.
172 > Any write action to a flash chip wear out the chip -- it has a limited
173 > number of write cycles.
174 > I also disbaled atime on my PC for the first reason.
175 >
176 > What makes the unionfs'ed nfs mount of my PC on the embedded system
177 > interesting to you ?
178 > (sorry if this question sounds bad/negative/... or so...its my limited
179 > english. Its simply and only a question and the wish of getting more
180 > infos... :)
181 >
182 > Best regards,
183 > mcc
184 >
185 >
186 >
187 >
188 >
189 >
190 Hi, Meino.
191
192 Sorry for my delay in answering your message. Sorry for my english, too, as
193 a non-native speaker, I know sometimes I may sound strange.
194
195 I am (trying to) finishing an embedded equipment, using an Intel x64, and
196 Gentoo Linux. The main file system will be stored in a SATA "disk on
197 module" flash device, but there are some directories that are not needed
198 for daily use, or should not be present at all on the final product, like
199 private source code used to build the program that run this equipment.
200
201 So on the development system, I have used several disk partitions (as a
202 first approach) for this directories, like /usr/portage , /usr/src ,
203 /usr/include and so on, and I was thinking on a way of remote access, so
204 that a remote system could use the structure of this local development
205 system. So I suppose that some unionfs mounts would make things appear
206 local to the remote system. But probably just nfs would do the trick. As I
207 said, just dreaming.
208
209 And what about your problem?
210
211 Best regards,
212 Francisco