Jump to content

need help fixing a corrupted (?) sdcard


mdel

Recommended Posts

i'm having a problem i don't understand.

 

i'm using @balbes150 armbian ubuntu xenial image for s905 (sticky thread above) on nexbox a95x s905 1G/8G box.

the system runs from sdcard without problems, i've been using a previous debian image for about 6 months without any problems.

 

i recently had to modify the box physical setup and touching it (simply pluging an usb cable), the power connector switched off (very annoying thing about those a95x boxes).

After that the system would not boot again (no screen display) so i simply figured the sdcard got corrupted.

 

that's what seems to have happened as using a serial connector i get the kernel boot message which at some point hangs and breaks like this :

 

Give root password for maintenance
(or press Control-D to continue):

 

last lines :

Spoiler

[    9.957647@1] systemd[1]: Started Create list of required static device nodes for the current kernel.
[    9.974625@1] systemd[1]: Started Restore / save the current clock.
[    9.987992@1] systemd[1]: Started Set console keymap.
[   10.000806@1] systemd[1]: Started Remount Root and Kernel File Systems.
[   10.015313@1] systemd[1]: Started Nameserver information manager.
[   10.033999@1] systemd[1]: Time has been changed
[   10.085598@1] systemd[1]: Reached target Network (Pre).
[   10.099056@1] systemd[1]: Activating swap /var/swap...
[   10.112716@1] systemd[1]: Starting Load/Save Random Seed...
[   10.131370@1] systemd[1]: Starting udev Coldplug all Devices...
[   10.134985@3] Adding 131068k swap on /var/swap.  Priority:-1 extents:1 across:131068k SSFS
[   10.153219@3] aml_wifi wifi.30: [extern_wifi_set_enable] WIFI  Enable! 234
[   10.154426@1] systemd[1]: Starting Create Static Device Nodes in /dev...
[   10.177859@3] systemd[1]: Activated swap /var/swap.
[   10.191627@3] systemd[1]: Started Load/Save Random Seed.
[   10.211994@3] systemd[1]: Started Create Static Device Nodes in /dev.
[   10.245253@3] systemd[1]: Reached target Local File Systems (Pre).
[   10.262976@3] systemd[1]: Mounting /tmp...
[   10.276628@3] systemd[1]: Starting udev Kernel Device Manager...
[   10.288933@3] systemd[1]: Reached target Swap.
[   10.302212@3] systemd[1]: Mounted /tmp.
[   10.330885@3] systemd[1]: Started Entropy daemon using the HAVEGE algorithm.
[   10.346012@3] systemd[1]: Starting Journal Service...
[   10.414472@0] systemd[1]: Started udev Kernel Device Manager.
[   10.445944@0] systemd[1]: Started udev Coldplug all Devices.
[   10.500689@3] sdio: new high speed SDIO card at address 0001
[   10.507016@3] sdio: clock 50000000, 4-bit-bus-width
 
[   10.519268@3] systemd[1]: Started Journal Service.
[   10.530414@3] [sdio_reinit] finish
[   10.678191@3] aml_nftl_dev: module license 'Proprietary' taints kernel.
[   10.684633@3] Disabling lock debugging due to kernel taint
[   10.730740@0] systemd-journald[2725]: Received request to flush runtime journal from PID 1
Give root password for maintenance
(or press Control-D to continue):

 

i have attached the full boot log.

 

so i tried fsck.ext4 and it gives me that on the live system :

 

root@amlogic-s905x:~
 fsck.ext4 -n -f /dev/mmcblk1p2 
e2fsck 1.42.13 (17-May-2015)
Warning!  /dev/mmcblk1p2 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (3307614, counted=3307612).
Fix? no

Free inodes count wrong (868976, counted=868974).
Fix? no

ROOTFS: 57168/926144 files (0.1% non-contiguous), 479298/3786912 blocks

 

here's my mount output on the live system :

Spoiler

root@amlogic-s905x:~
 mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=309372k,nr_inodes=77343,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=82984k,mode=755)
/dev/mmcblk1p2 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk1p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/mmcblk1p2 on /var/log.hdd type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
log2ram on /var/log type tmpfs (rw,nosuid,nodev,noexec,relatime,size=51200k,mode=755)

 

not sure what that one is about : 

/dev/mmcblk1p2 on /var/log.hdd type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)

 

touch /forcefsck, did not fix the problem.

the boot process seems to always hang at the same point, then fail to recovery login.

 

But when checking the sdcard i my ubuntu desktop, i don't get any fsck errors.

So i'm wondering what's going on..

thx

 

 

 

 

screenlog.0.recovery

Link to comment
Share on other sites

I don't know, that's just my guess, but I've read somewhere that this model often does not properly soldered USB connector (switched contacts) and the circuit, until the burn-in USB port or the device connected. Possible after such disconnection may be corrupted office files that are physically intact, but have not the correct information.

Link to comment
Share on other sites

okay it's weird, i don't think the sdcard is corrupted at all.

it looks like it fails to recovery login because of a fstab entry !?

 

while configuring my new sdcard, i got the same problem after a clean reboot.

As the only thing i changed was the fstab file, i just commented the USB disk line and then it booted again..

PARTUUID=9ca0ead7-01    /media/USBLinux         ext4    rw,noatime,nodiratime,data=writeback 0 0

This is a usb disc that was not plugged in..

Of course adding "noauto" solves the problem but that's not what i want.

 

Is this a normal ubuntu 16.04 behaviour ?

 

Link to comment
Share on other sites

the system boots but stops at  :

systemd[1]: Mounting Configuration File System...

[   10.139505@3] systemd[1]: Started Load/Save Random Seed.
[   10.159503@3] systemd[1]: Reached target Swap.
[   10.175676@3] systemd[1]: Started Create Static Device Nodes in /dev.
[   10.177515@0] sdio: new high speed SDIO card at address 0001
[   10.177685@1] sdio: clock 50000000, 4-bit-bus-width
[   10.177685@1]  
[   10.177686@1] [sdio_reinit] finish
[   10.229372@1] aml_nftl_dev: module license 'Proprietary' taints kernel.
[   10.234908@3] systemd[1]: Reached target Local File Systems (Pre).
[   10.243565@2] Disabling lock debugging due to kernel taint
[   10.259088@3] systemd[1]: Mounting /tmp...
[   10.272425@3] systemd[1]: Starting udev Kernel Device Manager...
[   10.285815@3] systemd[1]: Mounted /tmp.
[   10.297885@3] systemd[1]: Started Load Kernel Modules.
[   10.317779@3] systemd[1]: Starting Apply Kernel Variables...
[   10.330854@3] systemd[1]: Mounting Configuration File System...
Give root password for maintenance
(or press Control-D to continue):

 

this is simply because it can't mount that USBLinux partition (which s not connected to the box) as set in fstab.

it just drops to maintenance prompt ..

 

here's some debug info showing that nothing should be wrong on that system :

Spoiler

blkid 
/dev/cache: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/system: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/data: UUID="57f8f4bc-abf4-655f-bf67-946fc0f9f25b" TYPE="ext4"
/dev/mmcblk1p1: SEC_TYPE="msdos" LABEL="BOOT" UUID="CB0A-0BCB" TYPE="vfat" PARTUUID="2004b7c7-01"
/dev/mmcblk1p2: LABEL="ROOTFS" UUID="d18253cf-e1f8-442f-bba9-0c3515498bc5" TYPE="ext4" PARTUUID="2004b7c7-02"
/dev/mmcblk1: PTUUID="2004b7c7" PTTYPE="dos"

 

 

mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=309372k,nr_inodes=77343,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=82984k,mode=755)
/dev/mmcblk1p2 on / type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=33,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
tmpfs on /tmp type tmpfs (rw,nosuid,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk1p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/mmcblk1p2 on /var/log.hdd type ext4 (rw,noatime,nodiratime,errors=remount-ro,commit=600)
log2ram on /var/log type tmpfs (rw,nosuid,nodev,noexec,relatime,size=51200k,mode=755)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=82984k,mode=700)

 

 cat /etc/fstab 
LABEL=ROOTFS / ext4 defaults,noatime,nodiratime,commit=600,errors=remount-ro 0 1
LABEL=BOOT /boot vfat defaults 0 2
tmpfs /tmp tmpfs defaults,nosuid 0 0
/var/swap none swap sw 0 0

PARTUUID=9ca0ead7-01    /media/USBLinux         ext4    rw,noatime,nodiratime,data=writeback 0 0
 

 

 

i've attached, the fstab error boot and full correct boot serial data.

looking at the end, this is the only thing different :

 

[   10.479897@1] systemd[1]: Mounting Configuration File System...
[   10.495994@1] systemd[1]: Starting Apply Kernel Variables...
[   10.522178@1] systemd[1]: Mounted Configuration File System.


Ubuntu 16.04.2 LTS amlogic-s905x ttyS0

amlogic-s905x login:

 

 

 

 

i don't remember that all fstab (non system) entries absolutely have to be present, in order for the system to fully boot .. ?

Am i wrong ?

 

[ there seem to be some differences between 14.04 and 16.04 with mountall ]

 

screenlog.fstaberror

screenlog.fullboot

Link to comment
Share on other sites

Now I realized what it was. Add in the fstab line to mount a USB key, which disables the verification of the presence of the device (nofail)

 

PARTUUID=9ca0ead7-01    /media/USBLinux         ext4    rw,noatime,nodiratime,nofail,data=writeback 0 0

 

 

Link to comment
Share on other sites

thx it worked

 

it's also recommended to use x-systemd.device-timeout=1 along with nofail, otherwise timeout is 90 sec, but here the boot won't wait for that timeout.

Also it adds a "TIME" error to the boot log..

Link to comment
Share on other sites

for your info

 

it looks like the "nofail" option (with or without x-systemd.device-timeout) produces weird behaviors when mounting the drive.

it will often fail to actually mount it without reporting an error.

 

When executing the command manually after the system has booted, mount executes without error, you can see the drive flashing but the mount point is not set. 

 

i reverted to "noauto", which prevents boot failure and mount from rc.local or manually will not fail.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines