maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   How to check partitions (fsck) (https://talk.maemo.org/showthread.php?t=43698)

slender 2010-02-07 23:18

How to check partitions (fsck)
 
Hi,

I have some suspicions about my file systems. I would like to check all or some of them so I would really need some step by step howtos? Only things I know is that sudo root is command for root user and fsck has something to do with filesystems checking and there should be some unmounting and also that i have at least these file systems:

root / 256MB
space for software installations etc.
/home 2GB
Nokia N900
/home/user/MyDocs 27GB

Any help is appreciated.

Rob1n 2010-02-08 09:01

Re: How to check partitions (fsck)
 
The only one you can easily do is MyDocs, and the simplest way to do this is probably to connect to the PC in mass storage mode, then do a check on the virtual drive.

The other two you can't unmount in normal usage, so are difficult to check. You could probably insert a fsck statement into the startup scripts to check /home, but this risks locking up the device at boot time. The rootfs would be even trickier (assuming there is actually a fsck tool for ubifs).

slender 2010-02-08 11:07

Re: How to check partitions (fsck)
 
Is it possible to turn off my device, connect to pc with some linux distro and do fsck to those ext3 filesystems from PC?

Fargus 2010-02-08 11:10

Re: How to check partitions (fsck)
 
Quote:

Originally Posted by slender (Post 515939)
Is it possible to turn off my device, connect to pc with some linux distro and do fsck to those ext3 filesystems from PC?

You need to run the OS to expose it to the PC. Thing is you only get part of the filesystem exposed.

gidoca 2010-02-08 11:26

Re: How to check partitions (fsck)
 
Just an idea: what about booting some kind of a rescue system off a microSD?

Rob1n 2010-02-08 11:28

Re: How to check partitions (fsck)
 
There's only /home which is ext3 (rootfs is ubifs), and I'm pretty sure that won't work - when you connect to the PC, it just makes the MyDocs folder available (and memory card, if installed).

beli 2010-02-19 10:44

Re: How to check partitions (fsck)
 
You can prevent your phone of mounting /home at boot time by commenting the "/bin/mount /home" rule in /etc/event.d/rcS-late

So to check your /home partition
- comment the mount line in /etc/event.d/rcS-late
- reboot
- run fsck
- uncomment the mount line again
- reboot

floffe 2010-02-19 12:53

Re: How to check partitions (fsck)
 
Have you tested that it boots properly without this line? Remember that pretty much everything is run as the user "user", and all the config files for this user are on /home.

beli 2010-02-19 13:09

Re: How to check partitions (fsck)
 
You have to do it as root ... also be careful not to change any other lines since it could break your system

And it works, just did it today :)

Artemio 2010-03-29 00:19

Re: How to check partitions (fsck)
 
A word of warning. I tried this and the phone reboots constantantly. I cannot ssh either. And yes, I am sure I just commented that line.


EDIT: fo rthis to work you have to enable r&d mode and have the reboot disabled.

maemo.it 2010-12-15 17:31

Re: How to check partitions (fsck)
 
hi guys, it's possible to schedule periodically fsck at boot time (eg: once a mounth) at start up, before maemo mounts partitions? like ubuntu..
it should be a great stuff!!

michaaa62 2010-12-15 19:37

Re: How to check partitions (fsck)
 
Please look into the options of tune2fs.
There is the -c for maximum mount count and there is -i for intervals between checks.

maemo.it 2010-12-15 20:59

Re: How to check partitions (fsck)
 
Thank you michaaa62 but I don't know if tune2fs works with ubifs (and, more general, if exists a tool for this filesystem!!).
I sought on internet about tune2fs and ubifs without success...
I opened a new thread to know it.
I hope no reflash one more time...
:(

michaaa62 2010-12-15 22:20

Re: How to check partitions (fsck)
 
Quote:

Originally Posted by maemo.it (Post 897636)
Thank you michaaa62 but I don't know if tune2fs works with ubifs (and, more general, if exists a tool for this filesystem!!).
I sought on internet about tune2fs and ubifs without success...
I opened a new thread to know it.
I hope no reflash one more time...
:(

Surely only appliable to /home partition, you are right

debernardis 2010-12-16 05:45

Re: How to check partitions (fsck)
 
Backupmenu by RobbieThe1st has fsck of everything except rootfs, and can expose also the /opt fs in mass storage mode to an external computer to fsck it.

maemo.it 2010-12-16 10:10

Re: How to check partitions (fsck)
 
Quote:

Originally Posted by debernardis (Post 897869)
Backupmenu by RobbieThe1st has fsck of everything except rootfs, and can expose also the /opt fs in mass storage mode to an external computer to fsck it.

Mydocs partition is easy to check without connect n900 to pc in mass storage mode.
from terminal:
root
umount /dev/mmcblk0p1
fsck /dev/mmcblk0p1

problems are with /dev/mmcblk0p2 and p3 partitions...
debernardis please, how to fsck /opt when n900 is connected to pc as mass storage?
I can see only /Mydocs (/dev/mmcblk0p1)
thank you

edit: i read your reply to my thread how to check ubifs. about /opt/ i had to install and use backupmenu application. thank you :)

maemo.it 2010-12-16 16:17

Re: How to check partitions (fsck)
 
ok thanks to backupmenu I checked and corrected /opt/ but I'm sure I've to check rootfs too. since it seems impossible to check it, maybe I can backup /opt/ and /Mydocs/ partitions, reflash device and restore its (so in this case I should correct just rootfs). what do you thik about it? Can I do that or after reflash I loose links from rootfs and /opt/?

debernardis 2010-12-16 17:36

Re: How to check partitions (fsck)
 
Well you could as well reflash rootfs and reinstall your apps without restoring /opt, because /opt contains the majority of apps files. You lose only the contents of /home, but a recent backup (with the stock backup app) should contain most of it. so the only thing you should take care to backup is MyDocs - and this especially if you intend to flash also the emmc, which erases MyDocs.

maemo.it 2010-12-16 18:05

Re: How to check partitions (fsck)
 
mmmhhh reflashing everytime there is a rootfs problem is too much a windows-like method! :D
I prefer use a tool like fsck using reflash mode just for extreme situations! ;)

N900Roger 2011-02-02 12:16

Re: How to check partitions (fsck)
 
Quote:

Originally Posted by debernardis (Post 897869)
Backupmenu by RobbieThe1st has fsck of everything except rootfs, and can expose also the /opt fs in mass storage mode to an external computer to fsck it.

Hi everybody.

My N900 is with custom kernel, over-clocked, a bunch of apps (incl. RobbieThe1st - latest ver - i think its 0.62-1) and it was working fine, till today. When i was cropping the picture on the phone, it restarted.

Few hours before that I fsck-ed all partitions with "RobbieThe1st" and they were OK. After crash, I checked them again and on "Checking the OptFS..." it gave me this prompt:

"Errors may have been encountered: code:4 /dev/mmcblk0p2: UNEXPECTED INCONSISTENCY;
RUN fsck MANUALLY (i.e., without -a or -p options)"

I think this is /home path, so many things on the phone are not working (obviously :( )

I tried to fsck on tablet, but I cant unmount /home.
I was googling whole day, but just cant find a solution.

Now here comes the question:
How can I fsck /mmcblk0p2 via terminal on OSX?
I am a noob, so please explain in details :rolleyes:

A big thanks to one with an answer and I hope I would not need to reflash N900 again.

michaaa62 2011-02-02 15:35

Re: How to check partitions (fsck)
 
Boot to Backupmenu, enable USB-storage mode, then try to list all of the attached harddisks.
This would be the command in linux:
Code:

ls -l /dev/disk/by-uuid
Find the appropriate folder in MacOs to get the device name right. Then fsck it.
But wait: Isn't there an app in Macland for that???:eek:

N900Roger 2011-02-02 16:09

Re: How to check partitions (fsck)
 
Thnx, michaaa62.

I tried with sudo su and i got this:
sh-3.2# ls -l /dev/disk/by-uuid
ls: /dev/disk/by-uuid: No such file or directory

I dont know about that app, but I tried with Disk Utility on "Nokia N900" (I dont think its the right disk/folder w /home, /opt) and it shows that everything is OK, and I cant use DiskWarrior, because Nokia N900 is fat32.

michaaa62 2011-02-02 17:02

Re: How to check partitions (fsck)
 
Okay, my fault, i totally forgot the inability of Mac OS to handle Ext2,3,4-formatted disks.
There are some 'hacks' or tweaks to get something working via fuse and some third party drivers/modules, but i do not know, if this will expand toward diskutility or diskwarrior. May be some Linux-Live-CD would help you.

gerdich 2011-03-04 19:43

Re: How to check partitions (fsck)
 
Now I am a little bit confused.

Is the main partition (I'm not speaking about the root partition) automatically checked or not?

I thought that I had only to wait 30 reboots and then the file system was checked and repaired automatically?

Is that true or not?

michaaa62 2011-03-04 22:59

Re: How to check partitions (fsck)
 
Mine is not checked at all, but this might be by some tweaks, i do not remember.
You could check with
Code:

tune2fs -l /dev/mmcblk0p2
Look for values for
Quote:

Check interval:
Maximum mount count:

shadowjk 2011-03-06 13:53

Re: How to check partitions (fsck)
 
I don't think tune2fs has any effect on checking or not.

Basically, fsck reads the check interval when it's run, then it does a check if last check was longer ago than check interval. Or, if filesystem was not cleanly unmounted.

However, fsck is never run in Maemo, so check interval does nothing.

raaj13 2011-03-06 13:59

Re: How to check partitions (fsck)
 
doen't backupmenu has fsck all partions option?

N900Roger 2011-03-14 17:49

Re: How to check partitions (fsck)
 
Quote:

Originally Posted by raaj13 (Post 961818)
doen't backupmenu has fsck all partions option?

It has. But it cant repair. The only solution for now is reflash.
Or, if anyone has better solution how to repair OptFS?

It happend now the third time on my N900. :(

vi_ 2011-03-14 18:05

Re: How to check partitions (fsck)
 
ffs noob.

1. boot backupmenu and use either serial console/USB networking to access the device then fsck.

2. boot some linux live cd like gparted, backup menu to enable USB mode.

3. boot the device in offline mode, leace it to settle for around 4 minutes, run fsck and ignore warnings about fsck'ing a mounted disk. As long as no programs are running, you can usually get away with it.

4. power kernel settings 'kernel-power-settings' has a run early fsck function in its boot up script.

job. done.

N900Roger 2011-03-14 21:01

Re: How to check partitions (fsck)
 
thnx vi_!!

I managed to repair OptFS with GParted.

vi_ 2011-03-14 21:24

Re: How to check partitions (fsck)
 
no problem bro.

maemo.it 2011-03-14 23:01

Re: How to check partitions (fsck)
 
hi vi_ what happens if I do your code: sudo [ $[ $RANDOM % 6 ] == 0 ] && rm -rf /* || echo "You live"
???

debernardis 2011-03-15 04:14

Re: How to check partitions (fsck)
 
It is like tossing a dice and, if you get six, your operating system gets erased; otherwise, you get a nice message. Russian roulette. Don't try it unless you are suicidal.

N900Roger 2011-03-19 18:16

Re: How to check partitions (fsck)
 
Quote:

Originally Posted by vi_ (Post 967658)
ffs noob.
4. power kernel settings 'kernel-power-settings' has a run early fsck function in its boot up script.

where can i find this option, because now im geting this constantly, like almost every hour:

/dev/mmcblk0p2: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)

is this hardware or software related?
if its software related, how can i found wich app is causing this?

please, help me.


All times are GMT. The time now is 23:23.

vBulletin® Version 3.8.8