Forum
sd corruption - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Software (/forum-6.html)
+--- Forum: Configuration (/forum-17.html)
+--- Thread: sd corruption (/thread-946.html)



sd corruption - effemmeffe - 30th May, 2013 05:37 AM

I recently bought a new sd 8G class 10 and installed on it the last xbian 5.
Today I checked dmesg and saw this:
Code:
[    2.285942] EXT4-fs (mmcblk0p2): warning: mounting fs with errors, running e2fsck is recommended
[    2.290153] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   11.021491] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)

How do I correct that?
I can't run fsck on mmcblk0p2 because there's / mounted on that.
I tried shutdown -rF now, but still got those message.


RE: sd corruption - Uncle_Tubbie - 30th May, 2013 05:54 AM

This might help.

http://forum.xbian.org/thread-421.html?highlight=corruption


RE: sd corruption - mk01 - 2nd Jun, 2013 04:52 AM

(30th May, 2013 05:37 AM)effemmeffe Wrote:  How do I correct that?
I can't run fsck on mmcblk0p2 because there's / mounted on that.
I tried shutdown -rF now, but still got those message.

for ext4 active fsck partition needs to be unmounted.
in /boot/cmdline.txt change root=/dev/mmcblk0p2 to nonexistent device (root=/dev/mmcblk0p10). console=tty2 change to =tty1, remove "splash" and "quiet".

reboot.

during starting, rpi will complain about nonexistent root device and will drop you to shell.

in the shell do e2fsck -f /dev/mmcblk0p2.

when finished mount /dev/mmcblk0p1 /tmp. edit cmdline.txt and restore previous parameters (you can use "vi /tmp/cmdline.txt").

then umount /tmp, sync, reboot -f ...

mk


RE: sd corruption - effemmeffe - 2nd Jun, 2013 06:29 AM

thanks.
two more questions:
can i ssh in the rpi after the non existent root device error?
and there is no way to have it done right after a reboot using shutdown -rF and having the troot partition enabled to fsck in fstab?

I'll answer myself to the first question: no, ssh is not running after reboot.
the rest worked as expected and i could correct some fs errors.
thanks.


RE: sd corruption - mk01 - 2nd Jun, 2013 07:15 AM

(2nd Jun, 2013 06:29 AM)effemmeffe Wrote:  and there is no way to have it done right after a reboot using shutdown -rF and having the troot partition enabled to fsck in fstab?

not for rootfs without initramfs taking care.

as soon as you run into init (starting runlevels and services) the rootfs is busy, unmountable and therefore unable to fsck with repair. this can work for non-rootfs partitions though.

it is indeed too much hassle with the sd card manipulation and cmdconfig.txt editing - that's why we added hot-key emergency drop down to initramfs console in beta1 (if you attach keyboard and holds left shift during startup, you get emergency console. after you do what's needed, you simply type exit and booting continues).

mk


RE: sd corruption - effemmeffe - 2nd Jun, 2013 07:20 AM

(2nd Jun, 2013 07:15 AM)mk01 Wrote:  that's why we added hot-key emergency drop down to initramfs console in beta1 (if you attach keyboard and holds left shift during startup, you get emergency console. after you do what's needed, you simply type exit and booting continues).

well, that's new to me. and i think it's really great, i'll use it next time i'll have some fs problems.
thanks.


RE: sd corruption - effemmeffe - 5th Jun, 2013 05:27 AM

i tried and got no emergency console... the keyboard is working in xbmc, so i suppose it's recognized by the system.


RE: sd corruption - mk01 - 5th Jun, 2013 07:09 AM

it's beta1 feature. or get initramfs package from git and install before.


RE: sd corruption - effemmeffe - 5th Jun, 2013 06:11 PM

Can I update to beta 1? Is there an how to?
Thanks.


RE: sd corruption - mk01 - 6th Jun, 2013 03:05 AM

what is size of your SD and how much you have free ?


RE: sd corruption - effemmeffe - 6th Jun, 2013 06:03 PM

the sd is 8 gb and it has nearly 7 gb free


RE: sd corruption - raspberry_pd - 7th Jun, 2013 04:19 AM

I'm also very interested in this option. Since the Raspi has no power button, and XBMC crashes too often, file system corruption can't be a surprise, can it?

So all I need to do is plug a keyboard in, reboot with the left shift key down, then?


RE: sd corruption - effemmeffe - 8th Jun, 2013 11:34 PM

(7th Jun, 2013 04:19 AM)raspberry_pd Wrote:  So all I need to do is plug a keyboard in, reboot with the left shift key down, then?

at the moment you can't, it's a feature in the future version of xbian.