cubieplayer / Cubian

Debian for Cubieboard
http://cubian.org
271 stars 49 forks source link

Cubian X Nano Nand Cubietruck incorrect shutdown #418

Open brunoaduarte opened 9 years ago

brunoaduarte commented 9 years ago

I have a Cubiantruck running Cubian X Nano HDMI at NAND flash, and after a improper shutdown (removed power from it while it was running chromium) it won't boot anymore.

[.....] Checking root file system...fsck from util-linux 2.20.1 /dev/nandb contains a file system with errors, check forces. Unattached inode 9004

/dev/nandb: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY. fsck died with exit status 4 failed (code 4) .... Some other messages ... Give root password for maintenance (or type Control-D to continue):

But as i don't have root enabled, i can't login or do anything else.

Is it possible to avoid this data corruption ?

One solution would be to change the default fsck to run with parameter -y (YES TO ALL QUESTIONS) instead of -p (Automatic Repair)

ghost commented 9 years ago

Hi !

I have the same problem - how can I avoid a corrupt fs after power loss or how can I run a automatic fsck on every boot?

Have chromium running, too.

. pit

danfos commented 9 years ago

how can I run a automatic fsck on every boot?

sudo -i
echo y > /forcefsck
chattr +i /forcefsck
exit
ghost commented 9 years ago

done and works in a first try - will keep a eye on this in the next days a quite simple solution for a big problem

@danfos thank you very much!

malustra commented 9 years ago

Hi I had the same problem. After pressing crtl-D to boot and the system is up, change the /etc/fstab, remark the line /dev/mmcblk0p1... with

/dev/mmcblk0p1...

Now the system should boot as expected.. Regards

ghost commented 9 years ago

Hm, I boot from nand and a SD card is not insered !?

malustra commented 9 years ago

Hi pit I boot from nand and SSD without sd card. If you have a usb keyboard connected, press ctrl+alt+f2 during boot, you will get the boot messages. You will get a message "Press CTRL + D to....(whatever)", just do so, the cubietruck will boot from nand. Change to root user and edit /etc/fstab as described above, and reboot, works like a charm...

Regards

brunoaduarte commented 9 years ago

None of the above solutions worked for me, in my /etc/fstab i only have "/dev/nandb...." And if i comment this line it wont boot after a improper shutdown

vovcacik commented 9 years ago

Hi, I would

To prevent inconsistency on power failure enable data=journal:

nirp1995 commented 5 years ago

I want to know how to solve this error?

INPUT fsck -n /dev/nandb" OUTPUT
fsck from util-linux 2.25.2 e2fsck 1.42.12 (29-Aug-2014) Warning! /dev/nandb is mounted. /dev/nandb contains a file system with errors, check forced. Pass 1: Checking inodes, blocks, and sizes Deleted inode 389 has zero dtime. Fix? no Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Block bitmap differences: -(34036--34059) -(1097199--1097472) -(1119106--1119161) -(1608640--1608649) -(1616520--1616569) -(1644614--1644615) -(1644726--1644727) -(1644784--1644785) -(1645185--1645186) -(1646267--1646268) -(1646403--1646412) -(1655093--1655094) -(1655655--1655664) -(1655805--1655806) Fix? no Free blocks count wrong for group #49 (802, counted=809). Fix? no /dev/nandb: ** WARNING: Filesystem still has errors ** /dev/nandb: 62693/486720 files (0.2% non-contiguous), 444968/1943536 blocks