2

I am running Debian 8.1 on an SD card on a Banana PI with U-boot bootloader.

I'm trying to force my system to run fsck on reboot, but no matter what I do, nothing happens. Here are what I have tried so far:

  • Set FSCKFIX=yes inside /etc/defaults/rcS
  • touch /forcefsck and reboot
  • Update /proc/cmdline to include fsck.mode=force and fsck.repair=yes (this was done by cp the file to another location, and then mount -n --bind to it

No matter what, nothing happens. When I look at the log file (/var/logs/fsck/checkfs) there are no entries.

I tried creating my own file to run on bootup that would call fsck and I looked at my own log file and all I see is fsck from util-linux 2.25.2. I changed the init script to explicitly run on the drive (i.e. fsck -yf /dev/mmcblk0p2) and then the log file said the system is aborting because the drive is already mounted. FYI, this init script is running before checkfs or checkroot run!

I would really appreciate any help!!

1 Answer 1

1

I stumbled across this recently on the BananaPi myself. It's likely your booting with Systemd so setting FSCKFIX=yes inside /etc/defaults/rcS

Won't help you. Also /proc is a virtual filesytem, so changes will disappear between reboots.

Setting those kernel options are correct for systemd, but you need to append them to the boot args.

In /boot/boot.cmd I appended fsck.repair=yes to the end of the setenv bootargs:

setenv bootargs "console=tty1 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=${verbosity} fsck.repair=yes"

It's important to note you need to re-generate the /boot/boot.cmd before they'll appear using the following command (it's at printed at the end of /boot/boot.cmd)

mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

You can can confirm it applied after rebooting with cat:

~# cat /proc/cmdline 
console=tty1 root=/dev/mmcblk0p1 rootwait rootfstype=ext4 cgroup_enable=memory swapaccount=1 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16 hdmi.audio=EDID:0 disp.screen0_output_mode=1920x1080p60 panic=10 consoleblank=0 enforcing=0 loglevel=1 fsck.repair=yes

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .