krishraghuram / mess

Mess Feedback System using RFID, Raspberry Pi and Django
GNU General Public License v2.0
0 stars 0 forks source link

"The root account is locked" on rebooting the pi #31

Open krishraghuram opened 6 years ago

krishraghuram commented 6 years ago

28768316_2355996164426332_958836270_o

The above error message pops up on every boot.

This requires keyboard for getting into the kiosk - which defeats the point of a kiosk mode.

Need to solve this.

krishraghuram commented 6 years ago

Root account was "locked", in the same sense that root account is locked by default in ubuntu.

https://raspberrypi.stackexchange.com/a/48057

Unlocked root account by

However, this does not solve the problem. After doing this and rebooting, we get,

28810403_2356176704408278_667760290_o

Need to find out why this is coming

krishraghuram commented 6 years ago

The Why

  1. fsck is a utility that checks file system for errors.
  2. If system detects improper shutdown, fsck is run at next boot.
  3. That is the maintenance in "Give root password for maintenance"

The Solution

  1. It's important to ensure file system does not become corrupt beyond recovery. Else, we will lose mariadb data.
  2. But, as a temporary workaround, we can disable fsck at boot. To disable fsck from running, we can edit /etc/fstab and set any file systems we don't want checked to have a 0 in the 6th (last) field.

References :

krishraghuram commented 6 years ago

This link seems to have several ideas for a true solution

https://unix.stackexchange.com/questions/136269/corruption-proof-sd-card-filesystem-for-embedded-linux

In short, we can,

krishraghuram commented 6 years ago

Replying to comment above

Reply

The Problem

The temporary workaround - Setting last field to '0' in /etc/fstab - is a terrible idea

After I set it to '0', on the next dirty shutdown and subsequent boot, a huge problem surfaced.

The root file system was being mounted as read-only.

Found this and this, which explained the situation clearly

The default behaviour for most Linux file systems is to safeguard your data. When the kernel detects an error in the storage subsystem it will make the filesystem read-only to prevent (further) data corruption.

and

perhaps it is because the disk is unclean, try changing: /dev/sda1 / ext3 defaults 0 0 to /dev/sda1 / ext3 defaults 0 1 or at least do an fsck and then reboot

The Solution

The Conclusion

So, we still don't have a solution for the original issue. Need to work on it.

krishraghuram commented 6 years ago

Workaround 2 - Auto-respond to fsck prompt at boot

In the Foundation's spindle-era images, FSCKFIX=yes was actually the default. In recent images, /boot/cmdline.txt has "fsck.repair=yes". I believe that takes precedence and is basically equivalent. If you want "no", remove the stanza from /boot/cmdline.txt as well.

We have to add the following to /boot/cmdline.txt fsck.mode=force fsck.repair=yes Make sure that file remains all one line. Parameters should be separated with spaces.

krishraghuram commented 6 years ago

Workaround 3 / Solution 1 (depending on whether it suceeds)

BTRFS with RAID 1

https://unix.stackexchange.com/questions/136269/corruption-proof-sd-card-filesystem-for-embedded-linux

krishraghuram commented 6 years ago

Workaround 4 / Solution 2 (depending on whether it succeeds)

Power backup for Rpi