Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disk_Check: Scan & mount as RW when disk turns into Read-only #1872

Merged
merged 5 commits into from
Nov 20, 2021

Commits on Oct 11, 2021

  1. disk_check: Check & mount RO as RW using tmpfs (sonic-net#1569)

    What I did
    There is a bug that occasionally turn root-overlay as RO. This makes /etc & /home as RO. This blocks any new remote user login, as that needs to write into /etc & /home.
    
    This tool scans /etc & /home (or given dirs) as in RW or RO state. If RO, it could create a writable overlay using tmpfs.
    This is transient and stays until next reboot. Any write after the overlay will be lost upon reboot.
    
    But this allows new remote users login.
    
    How I did it
    Create upper & work dirs in /run/mount (tmpfs). Mount /etc & /home as lowerdirs and use the same name for final merge. This allows anyone opening a file in /etc or /home to operate on the merged overlay, transparently.
    
    How to verify it
    Mount any dir on tmpfs ( mount -t tmpfs tmpfs test_dir)
    remount as RO (mount -o remount,ro test_dir)
    Pass that dir to this script. (disk_check.py -d ./test_dir)
    Now it should be RW
    renukamanavalan committed Oct 11, 2021
    Configuration menu
    Copy the full SHA
    82b02ec View commit details
    Browse the repository at this point in the history
  2. disk_check updates: (sonic-net#1736)

    1) Set default loglevel to SYSLOG_ERR
    2) Make log level configurable via args
    renukamanavalan committed Oct 11, 2021
    Configuration menu
    Copy the full SHA
    4e76dac View commit details
    Browse the repository at this point in the history
  3. disk_check: Script updated to run good in 201811 & 201911 (sonic-net#…

    …1747)
    
    What I did
    Have independent subdirs for each mounted dir to avoid any collisions of files/dirs by same name.
    Adopt for older version of python3
    
    How I did it
    Changes:
    Individual subdirs for each dir to be mounted
    subprocess args made compatible with older version of python3 (tested in version 3.5.3)
    
    How to verify it
    Simulate read-only state
    Run this script
    Test ssh via new tacacs user (who had not logged in earlier)
    renukamanavalan committed Oct 11, 2021
    Configuration menu
    Copy the full SHA
    0c19b4a View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2021

  1. Configuration menu
    Copy the full SHA
    57d789e View commit details
    Browse the repository at this point in the history
  2. disk_check.py: Move to python2 (sonic-net#1903)

    Move to python2
    renukamanavalan committed Nov 4, 2021
    Configuration menu
    Copy the full SHA
    5c72cc3 View commit details
    Browse the repository at this point in the history