maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Clean way to e2fsck /home? (https://talk.maemo.org/showthread.php?t=50428)

nightfire 2010-04-19 04:44

Clean way to e2fsck /home?
 
Hey everyone,

Has anyone figured out a clean way to e2fsck the /home filesystem? I noticed in my kernel log that it mounted with errors, but it never runs e2fsck on bootup.

For now I suspended maemo-launcher (kill -STOP) and killed all the subprocesses, as well as the thumbnailer daemon, and anything else that looked like it may write. However, if you kill anything dsme related, it seems to trigger a watchdog that immediately reboots.

I couldn't remount r/o at that point, but it seemed all I/O was quiescent. After a sync, I fsck'd with /home mounted r/w (yeah, yeah, I know .. that's why I'm asking the question! :)). Quick reboot -f, and everything seems fine now; filesystem is not in error.

There must be a cleaner way to do this.

dbrodie 2010-04-19 05:25

Re: Clean way to e2fsck /home?
 
I haven't tried it, but how about adding an init script to do it for you, and remove it when your done?

nightfire 2010-04-19 06:34

Re: Clean way to e2fsck /home?
 
I suppose it could be done, but I'm wary of inserting anything into the boot process; one mistake and it's time for a reflash. There's no way to see the console at the moment, which is quite annoying.

lma 2010-04-19 08:33

Re: Clean way to e2fsck /home?
 
Maybe remount it read-only, run e2fsck on it and reboot immediately?

nightfire 2010-04-19 14:48

Re: Clean way to e2fsck /home?
 
Yeah, but in order to do that you have to kill all processes that have files open in rw mode. One of these processes seem to be monitored by a watchdog that reboots the host.

stlpaul 2010-04-19 15:42

Re: Clean way to e2fsck /home?
 
In some linux you can create the file "forcefsck" in the root of your partition and it will force fsck on the next reboot. For example "sudo touch /home/forcefsck"

I haven't tried it on N900 so I don't know if it will work. Let us know :)

nightfire 2010-04-19 17:14

Re: Clean way to e2fsck /home?
 
Interesting .. didn't know that. :)

Well, I searched through /etc and /sbin for any mention of forcefsck and found nothing, so I'm guessing that's a no-go. Good idea, though.

titan 2010-04-19 18:36

Re: Clean way to e2fsck /home?
 
Quote:

Originally Posted by nightfire (Post 617769)
Yeah, but in order to do that you have to kill all processes that have files open in rw mode. One of these processes seem to be monitored by a watchdog that reboots the host.

at startup script for that is the way to go.
the first step could be move the script out of event.d/ so that it runs only once.

It would be nice to have such a script installed permanently
(fsck only runs when it is necessary) and let it change the LED while fscking so that you know what its doing.

an alternative is to temporarily disable mounting /home in event.d/rcS-late.
it creates a new /home in rootfs and you can fsck the home partition from there.
then rm -rf /home and reboot.

nightfire 2010-04-19 19:24

Re: Clean way to e2fsck /home?
 
Well when I get a chance I guess I'll write something that can execute on bootup and see if I can get it into the repository. Sure would be nice to have a real console instead of that silent boot. :/

qwerty12 2010-04-19 19:26

Re: Clean way to e2fsck /home?
 
What program, exactly, causes your N900 to reboot when you kill it? Try stopping it with "dsmetool -k".

nightfire 2010-04-19 19:39

Re: Clean way to e2fsck /home?
 
It was killing dsme that did it for me; dsme was continually restarting something (I forget what, now) and following up the chain, I eventually killed dsme triggering the watchdog (I think). To be honest I wasn't watching the device, but working remotely from another room, so I'm not sure what happened on the screen. But as soon as I killed it, it rebooted.

Reads up on dsme..

Actually ... I'm not sure I understand how dsme differs from the standard /etc/event.d asynchronous service daemon. Does anyone have a good link to more thorough documentation?

Edit: Actually, found some here: http://wiki.maemo.org/Documentation/...ity_.28DSME.29

Interestingly, they mention thermal management. I didn't know there was any.

tvogel 2011-10-11 15:34

Re: Clean way to e2fsck /home?
 
At your own risk. This is risky by nature!

I have put the following fragment at the beginning of mount_home() in /etc/event.d/rcS-late:

Code:

   
    if [ -e /etc/homeless ]; then
      rm /etc/homeless
      return 0
    fi

This allows the following: Make sure, the N900 auto-connects to your WLAN on power-up. Then "sudo gainroot" and "touch /etc/homeless" and "reboot". Next boot-up will proceed without the /home partition mounted. Boot-up works OK but the UI will look totally mixed up because graphics and fonts seem to be missing in this "mode". You will need to put in your lock code half-blind because the number-pad numbers are just rectangles. You can skip entering the SIM PIN.

Then, ssh in and fix things. Next boot-up will (shall) be with mounting /home again.

Again: Your own risk to use this.

af7567 2011-10-11 16:15

Re: Clean way to e2fsck /home?
 
I am sure I have used the root shell option of backup menu to fsck /home. After installing backupmenu just reboot with the keyboard open and press t at the bootmenu menu. - Make sure you have set a root password on your system first though, and that it doesn't have any special characters in it


All times are GMT. The time now is 22:59.

vBulletin® Version 3.8.8