sonic-buildimage/files/image_config
Olivier Singla 18bbbb3c02 [baseimage]: Run fsck filesystem check support prior mounting filesystem (#4431)
* Run fsck filesystem check support prior mounting filesystem

If the filesystem become non clean ("dirty"), SONiC does not run fsck to
repair and mark it as clean again.

This patch adds the functionality to run fsck on each boot, prior to the
filesystem being mounted. This allows the filesystem to be repaired if
needed.

Note that if the filesystem is maked as clean, fsck does nothing and simply
return so this is perfectly fine to call fsck every time prior to mount the
filesystem.

How to verify this patch (using bash):

Using an image without this patch:

Make the filesystem "dirty" (not clean)
[we are making the assumption that filesystem is stored in /dev/sda3 - Please adjust depending of the platform]
[do this only on a test platform!]

dd if=/dev/sda3 of=superblock bs=1 count=2048
printf "$(printf '\\x%02X' 2)" | dd of="superblock" bs=1 seek=1082 count=1 conv=notrunc &> /dev/null
dd of=/dev/sda3 if=superblock bs=1 count=2048

Verify that filesystem is not clean
tune2fs -l /dev/sda3 | grep "Filesystem state:"

reboot and verify that the filesystem is still not clean
Redo the same test with an image with this patch, and verify that at next reboot the filesystem is repaired and becomes clean.

fsck log is stored on syslog, using the string FSCK as markup.
2020-06-16 08:12:11 -07:00
..
apt [build]: SONiC buildimage ARM arch support (#2980) 2019-07-25 22:06:41 -07:00
bash [baseimage]: Increase TMOUT for serial port connections to 15 minutes (#3032) 2019-06-19 00:16:01 -07:00
caclmgrd [caclmgrd] Get first VLAN host IP address via next() (#4685) 2020-06-03 15:38:11 -07:00
config-setup Changes to support config-setup service for multi-npu (#4609) 2020-05-20 22:44:14 -07:00
constants [bgpcfgd]: Split one bgp mega-template to chunks. (#4143) 2020-04-25 09:41:28 +00:00
corefile_uploader corefile uploader: Updates per review comments offline (#3915) 2019-12-31 14:42:01 -08:00
cron.d [core_cleanup] Fix issue where core_cleanup job runs too frequently (#3659) 2019-10-23 15:55:47 -07:00
ebtables [ebtables]add the filter rule for ARP packets with vlan tag: (#3945) 2020-05-09 18:36:36 -07:00
environment [image]: Update login message (#706) 2017-06-14 15:18:02 -07:00
fstrim [baseimage]: Add fstrim service and fstrim timer by default (#2804) 2019-04-21 14:21:16 -07:00
hostcfgd [docker_image_ctl.j2] Share UTS namespace with host OS (#4169) 2020-03-22 23:04:02 -07:00
hostname [hostname-config] improve hostname-config process (#3676) 2019-10-29 08:30:27 -07:00
interfaces Fixing Bad Cherry-pick 2020-03-04 10:46:45 -08:00
kubernetes [baseimage]: Install Kubernetes packages if enabled in image (#4374) (#4432) 2020-04-16 21:54:45 -07:00
logrotate [logrotate] Enhance robustness (#2942) 2019-05-25 18:00:18 -07:00
misc [docker-syncd]: Restart SwSS, syncd and dependent services if a critical process in syncd container exits unexpectedly (#3534) 2019-11-09 10:26:39 -08:00
monit [Monit] Delay start of monitoring for 5 minutes (#4281) 2020-03-22 22:58:57 -07:00
ntp [ntp] enable/disable NTP long jump according to reboot type (#4577) 2020-05-20 22:44:14 -07:00
platform [baseimage]: Run fsck filesystem check support prior mounting filesystem (#4431) 2020-06-16 08:12:11 -07:00
procdockerstatsd [procdockerstatsd] Fix CMD field in dB (#4335) 2020-03-29 22:47:05 -07:00
process-reboot-cause [process-reboot-cause] If software reboot cause is unknown add note if first boot into new image (#4538) 2020-05-09 18:17:31 -07:00
rsyslog [rsyslog] Add support for IPv6 remote addresses (#3754) 2019-11-14 00:00:55 -08:00
snmp mvrf_avoid_snmp_yml_config: made changes to pass SNMP config from con… (#4057) 2020-02-03 15:38:38 -08:00
sudoers [sudoers] Add /usr/bin/teamshow to READ_ONLY_CMDS (#2846) 2019-05-01 08:01:44 -07:00
systemd [services] Restart SwSS service upon unexpected critical process exit (#2845) 2019-05-01 08:02:38 -07:00
topology Multi-ASIC implementation (#3888) 2020-04-15 13:08:34 -07:00
updategraph Changes to support config-setup service for multi-npu (#4609) 2020-05-20 22:44:14 -07:00
warmboot-finalizer [MultiDB] use sonic-db-cli PING and fix wrong multiDB API in NAT (#4541) 2020-05-09 18:16:48 -07:00