sonic-buildimage/files/image_config
Olivier Singla 799f22d4c7
[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-04-30 00:33:20 -07:00
..
apt [baseimage]: various fixes due to buster changes 2020-04-17 04:51:51 +00:00
bash [baseimage]: Increase TMOUT for serial port connections to 15 minutes (#3032) 2019-06-19 00:16:01 -07:00
caclmgrd [caclmgrd] Fix application of IPv6 service ACL rules (part 2) (#4036) 2020-01-17 17:33:31 -08:00
config-setup Fix typo in config-setup service (#4388) 2020-04-07 23:44:50 -07:00
constants [bgpcfgd]: Split one bgp mega-template to chunks. (#4143) 2020-04-23 09:42:22 -07:00
corefile_uploader corefile uploader: Updates per review comments offline (#3915) 2019-12-30 13:01:03 -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 [baseimage]: setup ebtables.service in buster image 2020-04-17 04:51:51 +00: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 [tacacs]: fix /etc/nsswitch.conf for buster image (#4303) 2020-03-22 09:44:48 -07:00
hostname [hostname-config] improve hostname-config process (#3676) 2019-10-29 08:30:27 -07:00
interfaces [mgmt-vrf]: mgmt vrf related change for Buster (#53) 2020-04-17 04:51:51 +00:00
kubernetes [baseimage]: Install Kubernetes packages if enabled in image (#4374) 2020-04-13 08:41:18 -07:00
logrotate [logrotate] Enhance robustness (#2942) 2019-05-25 18:00:18 -07:00
misc [docker-wait-any] Use APIClient instead of Client according to API update 2020-04-17 04:51:51 +00:00
monit [Monit] Delay start of monitoring for 5 minutes (#4281) 2020-03-19 14:14:47 -07:00
ntp [ntp] add ntp support in buster with mgmt vrf (#55) 2020-04-17 04:51:51 +00:00
platform [baseimage]: Run fsck filesystem check support prior mounting filesystem (#4431) 2020-04-30 00:33:20 -07:00
procdockerstatsd [procdockerstatsd] Fix CMD field in dB (#4335) 2020-03-28 11:43:48 -07:00
process-reboot-cause [process-reboot-cause]Clean up the process-reboot-cause as reqired in issue 3927 (#4128) 2020-02-11 09:54:12 -08: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-01-28 17:41:21 -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-03-31 10:06:19 -07:00
updategraph [MultiDB] (except ./src and ./dockers dirs): replace redis-cli with sonic-db-cli and use new DBConnector (#4035) 2020-01-22 11:26:23 -08:00
warmboot-finalizer Changes in sonic-buildimage to support the NAT feature (#3494) 2020-01-29 17:40:43 -08:00