Troubles with chrooted Debian

Troubles with chrooted Debian

2012-01-02 11:01 UTC
My dear Maemo friends,

On my N900, I use the Debian chrooted system but I very often run into troubles with it.

To read quickly, go after the words in italics ;-)

I just need to compile the Lazarus Free Pascal IDE for my device and/or to develop applications with it.
Sometimes it happened when I had Debian in an image file that my N900 suddenly crashed and switched off during the installation of some packages into Debian. So I ran fsck, expecting some damage to the filesystem in that image file. But the corruption appeared so heavy that it was basically unrepairable.
This happenened very frequently so I started to keep a backup of the standard 2GiB image. Still, the loss of work was very annoying… it’s a bit time consuming to backup 2GiB of data after each single step, don’t you think so?
OK, I thought it was better to use a physical device, an MMC SD card. So I’ve formatted an 8GB card to ext3 and copied all the contents of the Debian image onto it using rsync.
I’ve then modified the /home/user/.chroot configuration script accordingly.
All has worked fine except that during installation of the compiled Lazarus (make install) a copy command has frozen for all the night. That was strange, so I pressed Ctrl+C with no effect. I tried to Close Debian. It has also hung. So I’ve turned my device off.
OK, the first run of fsck on /dev/mmcblk1p1 has just recovered the ext3 filesystem journal.
I’ve been curious then if there were some errors left there, so I’ve run fsck -f /dev/mmcblk1p1. Ouch! A destruction of the fs again!

The side question:
Is it a good idea to check an ext3 filesystem right after a journal recovery? Or should I first mount it? I’m apparently lacking an essential knowledge here.

The main question:
Is it possible to avoid severe filesystem damage during just normal but io-intensive operations on the Debian for armel on the N900?

Thank you in advance for just any hint!

Pavel Řezníček
  •  Reply

Re: Troubles with chrooted Debian

Michael Rösch
Karma: 100
2012-01-02 13:40 UTC
Am 02.01.2012 12:01, schrieb Pavel Řezníček:
> My dear Maemo friends,
>
> On my N900, I use the /Debian chrooted system/ but I /very often run
> into troubles/ with it.
>
> To read quickly, go after the words /in italics/ ;-)
>
> I just need to compile the /Lazarus Free Pascal IDE/ for my device
> and/or to /develop applications with it./
> Sometimes it happened when I had Debian in an image file that /my N900
> suddenly crashed and switched off/ during the installation of some
> packages into Debian. So I ran fsck, expecting some damage to the
> filesystem in that image file. But the corruption appeared so heavy that
> it was /basically unrepairable./
> This happenened /very frequently/ so I started to keep a backup of the
> standard 2GiB image. Still, the loss of work was /very annoying…/ it’s a
> bit time consuming to backup 2GiB of data after each single step, don’t
> you think so?
> OK, I thought it was better to use a physical device, an MMC SD card. So
> /I’ve formatted an 8GB card to ext3/ and /copied/ all the contents of
> the Debian image onto it using rsync.
> I’ve then modified the /home/user/.chroot configuration script accordingly.
> All has worked fine except that during installation of the compiled
> Lazarus (make install) /a copy command has frozen for all the night./
> That was strange, so I pressed /Ctrl+C with no effect./ I tried to
> /Close Debian./ /It has also hung./ So I’ve turned my device off.
> OK, the first run of fsck on /dev/mmcblk1p1 has just /recovered the ext3
> filesystem journal./
> I’ve been curious then if there were some errors left there, so I’ve run
> /fsck -f /dev/mmcblk1p1. Ouch! A destruction of the fs again!/
>
> *The side question:*
> /Is it a good idea to check an ext3 filesystem right after a journal
> recovery? Or should I first mount it?/ I’m apparently lacking an
> essential knowledge here.

I think fsck before mounting is never a bad idea. When the fs is damaged
the mount can make things even worse.

> *The main question:*
> /Is it possible to avoid severe filesystem damage/ during just normal
> but io-intensive operations /on the Debian for armel on the N900?/
>

I am using my debian on an ext2-Partition for over a year now on two
three different cards- never had any problems like you.
I also use another ext3-Partition on the same card for data, the same
here: no problems.

Have you ever considered your sd-card may be broken or simply not
suitable for the n900?
Do you have the possibility to try another one?
I using a Patriot 32Gb Class 10 now, before it was a Transcend 16 GB
Class 6.

CU Michael
--
BOMBING for peace is like FUCKING for virginity.
  •  Reply

Re: Troubles with chrooted Debian

2012-01-03 00:19 UTC
2012/1/2 Michael Rösch <maemo@dobiwe.de>

> Am 02.01.2012 12:01, schrieb Pavel Řezníček:
> > My dear Maemo friends,
> >
> > On my N900, I use the /Debian chrooted system/ but I /very often run
> > into troubles/ with it.
> >
> > To read quickly, go after the words /in italics/ ;-)
> >
> > I just need to compile the /Lazarus Free Pascal IDE/ for my device
> > and/or to /develop applications with it./
> > Sometimes it happened when I had Debian in an image file that /my N900
> > suddenly crashed and switched off/ during the installation of some
> > packages into Debian. So I ran fsck, expecting some damage to the
> > filesystem in that image file. But the corruption appeared so heavy that
> > it was /basically unrepairable./
> > This happenened /very frequently/ so I started to keep a backup of the
> > standard 2GiB image. Still, the loss of work was /very annoying…/ it’s a
> > bit time consuming to backup 2GiB of data after each single step, don’t
> > you think so?
> > OK, I thought it was better to use a physical device, an MMC SD card. So
> > /I’ve formatted an 8GB card to ext3/ and /copied/ all the contents of
> > the Debian image onto it using rsync.
> > I’ve then modified the /home/user/.chroot configuration script
> accordingly.
> > All has worked fine except that during installation of the compiled
> > Lazarus (make install) /a copy command has frozen for all the night./
> > That was strange, so I pressed /Ctrl+C with no effect./ I tried to
> > /Close Debian./ /It has also hung./ So I’ve turned my device off.
> > OK, the first run of fsck on /dev/mmcblk1p1 has just /recovered the ext3
> > filesystem journal./
> > I’ve been curious then if there were some errors left there, so I’ve run
> > /fsck -f /dev/mmcblk1p1. Ouch! A destruction of the fs again!/
> >
> > *The side question:*
> > /Is it a good idea to check an ext3 filesystem right after a journal
> > recovery? Or should I first mount it?/ I’m apparently lacking an
> > essential knowledge here.
>
> I think fsck before mounting is never a bad idea. When the fs is damaged
> the mount can make things even worse.
>
> > *The main question:*
> > /Is it possible to avoid severe filesystem damage/ during just normal
> > but io-intensive operations /on the Debian for armel on the N900?/
> >
>
> I am using my debian on an ext2-Partition for over a year now on two
> three different cards- never had any problems like you.
> I also use another ext3-Partition on the same card for data, the same
> here: no problems.
>
> Have you ever considered your sd-card may be broken or simply not
> suitable for the n900?
> Do you have the possibility to try another one?
> I using a Patriot 32Gb Class 10 now, before it was a Transcend 16 GB
> Class 6.
>
> CU Michael
> --
> BOMBING for peace is like FUCKING for virginity.
>

Dear Michael,

thank you for your kind response!

I'm glad to know that running fsck before mounting is never a bad idea [?]

OK, *the SD-card may really be broken,* that's right. I have to go for one
and buy it (or via an e-shop) as soon as I have the time. Or, I may *test
this old one for bad blocks.*
*
*
But *what was then wrong with my Debian when run from an image file* on the
internal memory storage (/home/user/MyDocs/debian-m5-v3e.img.ext2)?

As I mentioned before, during the installation process of some more
packages, my N900 just went off regularly. Did you any time try to *upgrade
your whole Debian system* ("sudo apt-get update; sudo apt-get upgrade"
without specifying a package)? This is what I actually tried a couple of
times but always ended up in a switch-off in random stages of the package
installation, resulting in a severe filesystem damage inside the Debian
image file…

The case with the installation of the Lazarus IDE on the SD-card and on an
ext3 formatted partition might be related but also unrelated.

So the next step is to check the card for physically bad blocks. I'll give
it a try and report the results [?]
--
Pavel Řezníček
software developer and computer network administrator
vývojář a správce počítačových sítí

‰PNG

  •  Reply

Re: Troubles with chrooted Debian

Michael Rösch
Karma: 100
2012-01-04 13:19 UTC
Am 03.01.2012 01:19, schrieb Pavel Řezníček:

> Dear Michael,
>
> thank you for your kind response!
>
> I'm glad to know that running fsck before mounting is never a bad idea
>
> OK, /the SD-card may really be broken,/ that's right. I have to go for
> one and buy it (or via an e-shop) as soon as I have the time. Or, I may
> /test this old one for bad blocks./
> /
> /
> But /what was then wrong with my Debian when run from an image file/ on
> the internal memory storage (/home/user/MyDocs/debian-m5-v3e.img.ext2)?

That's a good point- frankly I don't know- maybe the explaination bellow
also fits for this...

> As I mentioned before, during the installation process of some more
> packages, my N900 just went off regularly. Did you any time try to
> /upgrade your whole Debian system/ ("sudo apt-get update; sudo apt-get
> upgrade" without specifying a package)? This is what I actually tried a
> couple of times but always ended up in a switch-off in random stages of
> the package installation, resulting in a severe filesystem damage inside
> the Debian image file…

Ah now it is ringing: this sound like this:

"Then we'll do the dist-upgrade. Unfortunately Maemo has a very snappish
watchdog that reboots your phone if it thinks it hangs due to a runaway
process. This is almost certainly triggered when doing mayor package
installations with normal process priority. So we'll do the dist-upgrade
wit the lowest priority using the nice command:

nice -n 19 sudo apt-get update
nice -n 19 sudo apt-get dist-upgrade"

I never had this problem but maybe that is yours?

> The case with the installation of the Lazarus IDE on the SD-card and on
> an ext3 formatted partition might be related but also unrelated.
>
> So the next step is to check the card for physically bad blocks. I'll
> give it a try and report the results




--
Die SED hat stets sämtliche gesellschaftlichen Umwälzungen und
Reformen geführt. So wird und soll es auch diesmal sein.
(Egon Krenz am 18.10.1989)
  •  Reply

Re: Troubles with chrooted Debian

2012-01-04 13:51 UTC
Dne 4.1.2012 14:19, Michael Rösch napsal(a):
> Am 03.01.2012 01:19, schrieb Pavel Řezníček:
>
>> Dear Michael,
>>
>> thank you for your kind response!
>>
>> I'm glad to know that running fsck before mounting is never a bad idea
>>
>> OK, /the SD-card may really be broken,/ that's right. I have to go for
>> one and buy it (or via an e-shop) as soon as I have the time. Or, I may
>> /test this old one for bad blocks./
>> /
>> /
>> But /what was then wrong with my Debian when run from an image file/ on
>> the internal memory storage (/home/user/MyDocs/debian-m5-v3e.img.ext2)?
> That's a good point- frankly I don't know- maybe the explaination bellow
> also fits for this...
>
>> As I mentioned before, during the installation process of some more
>> packages, my N900 just went off regularly. Did you any time try to
>> /upgrade your whole Debian system/ ("sudo apt-get update; sudo apt-get
>> upgrade" without specifying a package)? This is what I actually tried a
>> couple of times but always ended up in a switch-off in random stages of
>> the package installation, resulting in a severe filesystem damage inside
>> the Debian image file…
> Ah now it is ringing: this sound like this:
>
> "Then we'll do the dist-upgrade. Unfortunately Maemo has a very snappish
> watchdog that reboots your phone if it thinks it hangs due to a runaway
> process. This is almost certainly triggered when doing mayor package
> installations with normal process priority. So we'll do the dist-upgrade
> wit the lowest priority using the nice command:
>
> nice -n 19 sudo apt-get update
> nice -n 19 sudo apt-get dist-upgrade"
>
> I never had this problem but maybe that is yours?
>
WOW!! This sounds very much like a solution! Thank you for this tip!
Will try ASAP!
>> The case with the installation of the Lazarus IDE on the SD-card and on
>> an ext3 formatted partition might be related but also unrelated.
I’m now pretty sure it /is related./
>> So the next step is to check the card for physically bad blocks. I'll
>> give it a try and report the results
I still didn’t have the time and the rememberance to check the memory
card’s partition for physically bad blocks. It’s still on the to do list
;-)

Pavel

--
function Podpis(): String;
begin
Jméno('Pavel Řezníček');
Bydliště('Borová 18', '312 00', 'Plzeň');
Pracoviště('Korandův sbor', 'Anglické nábřeží 13', '301 00', 'Plzeň');
Result := 'vývojář a správce sítě';
end;


  •  Reply