Security Compliance
SEM Filesystem Repair using `fsck` from a bootable ISO
This document provides steps for running `fsck` in a rescue environment on a non-booting SEM Appliance
First published date
Last published date
Overview
Should you encounter a SEM or LEM appliance that is giving an fsck error when booting or get stuck on either of the screens similar to below then you can use this guide to attempt to repair the file system.
Cause 1:
Cause 2: systemd-fsck[460]: /dev/sda5 contains a file system with errors, check forced.
Cause 3: Buffer I/O error on dev sda5, logical block, lost async page write
*Note: As per cause 2 screenshot, the fsck command was running on /dev/sda5. After reboot, let it run for about 30 to 50 minutes (depends on the size of the disk allocation) and see if that boots up normal.
Do note that this may not resolve the file system error and it is possible a redeployment of the appliance may be required.
Prior to following any of the instructions listed below you MUST do the following:
- Verify that the customer has a snapshot of the SEM in its current state. We want a snapshot event if the appliance is broken/not booting.
- Send the following disclaimer to the customer:
The SEM is in a state where the appliance will not boot and is in an unknown state due to an environmental event. We are using a process that may resolve the disk problem, but it may render the appliance unusable.
I agree that Solarwinds has advised me that there is a possibility of data loss and that this step may not work. If this step does not work, we must redeploy the appliance.
Please reply "I approve" via email if you accept.
Product section
Cause
- Resizing VM disk while the appliance is still running.
- Resizing VM disk when the disk is full and the snapshots are still in place.
- Underlying VM hard-drive issue with corrupted blocks
- SEM OS Partition is accidentally deleted from vmware V-Center while disk resizing - To rebuild SEM, you can refer to this KB - Unable to boot SEM - Operating System not found
Resolution
Prerequisites
- You must follow the steps listed in the Overview section for taking a snapshot and documenting customer acceptance BEFORE doing any of the below steps.
- Download Debian NetInst ISO
- A direct link is here: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.1.0-amd64-netinst.iso
- Should the above link be broken, navigate to https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ and download the file that matches the filename debian-X.Y.Z-amd64-netinst.iso where X.Y.Z matches the current release of Debian Linux (as of August 13th, 2023 the version is 12.1.0)
- Some of these steps will differ depending on the specific hypervisor its version the customer is running. This guide assumes VMware vSphere using the VMware Remote Console (VMRC)
SEM OS Partition/Disk is accidentally deleted from vmware V-Center:
Booting ISO
- Mount ISO on VM's Virtual DVD drive
- Boot into the Virtual Machine BIOS
- Change boot order to "boot CD-ROM" first
- Save changes and exit the BIOS
- Reboot VM
Starting Rescue Mode
- Debian Installer Loads
- Select 'Advanced Options' and hit *enter* on keyboard
- Select 'Graphical Rescue Mode' and hit *enter* on keyboard
Configure Rescue Mode
- On "Select Language" Select or Leave on 'English' and click *Continue*
- On "Select Your Location" Select or Leave on 'United States' and click *Continue*
- On "Configure The Keyboard" Select or Leave on 'American English' and click *Continue*
- On "Configure The Network" Leave hostname as-is and click *Continue*
- On "Configure The Network" Leave domain as-is and click *Continue*
- On "Configure The Clock" Leave as-is and click *Continue*
- On "Enter Rescue Mode" choose 'Do not use a root file system' and click *Continue*
- On "Enter Rescue Mode" choose 'Execute Shell In The Installer Environment' and click *Continue*
- On "Enter Rescue Mode" Click *Continue*
Running `fsck` in Rescue Mode
You should now have a BASH shell to run `fsck` commands in.Depending on the disk space allocated to the Appliance its possible for the `fsck` command to take a long time to run
!!Check VM if it has 1 disk or 2 disks
Depending on which version the appliance was deployed you will need to run the following different commands:
For Dual Disk SEM (6.4 to latest):
- fsck.ext4 -y /dev/sda1
- fsck.ext4 -y /dev/sda2
- fsck.ext4 -y /dev/sda4
- fsck.ext4 -y /dev/sdb1
For Single Disk SEM (versions below 6.4 - EOL):
- fsck.ext4 -y /dev/sda1
- fsck.ext4 -y /dev/sda2
- fsck.ext4 -y /dev/sda5
- fsck.ext4 -y /dev/sda6
Cleaning/Finishing Up
- Click *Go Back*
- Select 'Reboot' and click *continue*
- VM will reboot and start the Debian ISO again
- Power Off VM
- Remove ISO from Virtual DVD drive
- Power On VM