Check Filesystems on a Terminal
Objectives
Prerequisites
Instructions
Determine if a Filesystem Check is Necessary
The filesystem(s) on a terminal may become corrupt and need to be checked in the following scenarios:
If a filesystem check is necessary, the terminal will boot up in "single user mode" and prompt the user to run a filesystem check. One or more of the following messages will be displayed somewhere on the screen:
To get an accurate description of the messages displayed on the screen, ask the customer to take a digital photo of the screen and email it to you. It is important that the photo includes all of the message displayed on the screen, and that the messages are readable in the photo. It may take the customer a few tries to take a usable photo; even with multiple tries, this is still faster than than trying to get the customer to read exactly what is displayed on the screen.
Determine Which Filesystem Needs to be Checked
The names of filesystems vary between OS image versions. The messages displayed on the screen will indicate which filesystem needs to be checked first; however, they will not tell you if more than one filesystem needs to be checked. To avoid repeating this whole process (i.e. partial boot, log in, check one filesystem, reboot) multiple times, it is recommended that you check all of the filesystems on the terminal before rebooting.
Determine Terminal OS Image Version
Refer to POS Terminal Cheatsheet for instructions for checking the OS image version.
Commands to check filesystem(s)
|
OS Image Version |
Command(s) to Check Filesystem(s) |
|
3 |
fsck -y /dev/sda1 fsck -y /dev/mapper/system-root fsck -y /dev/mapper/system-oracle |
|
4.1 |
fsck -y /dev/sda1 fsck -y /dev/mapper/system-root fsck -y /dev/mapper/system-oracle |
|
4.2.x |
fsck -y /dev/sda1 fsck -y /dev/mapper/systemvg-LVRoot fsck -y /dev/mapper/systemvg-LVhome fsck -y /dev/mapper/systemvg-LVopt fsck -y /dev/mapper/systemvg-LVsrv fsck -y /dev/mapper/systemvg-LVusr fsck -y /dev/mapper/systemvg-LVvar |
|
4.3.x |
fsck -y /dev/sda1 fsck -y /dev/mapper/systemvg-LVRoot fsck -y /dev/mapper/systemvg-LVhome fsck -y /dev/mapper/systemvg-LVopt fsck -y /dev/mapper/systemvg-LVsrv fsck -y /dev/mapper/systemvg-LVusr fsck -y /dev/mapper/systemvg-LVvar |
|
5.1.x |
fsck -y /dev/sda1 fsck -y /dev/mapper/systemvg-LVRoot |
|
5.2.x |
fsck -y /dev/sda1 fsck -y /dev/mapper/systemvg-LVRoot |
|
5.3.x |
fsck -y /dev/sda1 fsck -y /dev/mapper/systemvg-LVRoot |
|
6.0.x |
fsck -y /dev/mapper/systemvg-LVRoot |
|
6.1.x |
fsck -y /dev/sda2 fsck -y /dev/mapper/systemvg-LVRoot |
|
6.2.x and greater |
fsck -y /dev/sda2 fsck -y /dev/mapper/systemvg-LVRoot |
Check for Orphaned Files
Everytime you run a filesystem check, there is a risk that data stored in the filesystem being checked will be lost. This is not a bug in the filesystem or OS, and there is no fix or work-around. After running a filesystem check, you need to check for orphaned (i.e. lost) files on each filesystem. In the top level directory of each filesystem (i.e. "/", "/usr", "/var", etc.), there is a directory named "lost+found". The "lost+found" directories contain files that were partially recovered by the filesystem check. These directories should be empty; if they aren't, the filesystem check was not able to completely repair the filesystem. At that point, your options are to manually examine each file and determine where it goes, or reimage the terminal.
Use the 'ls' command to obtain a list of files in a directory. For example, to display all of the files in the "/lost+found" directory, run the following command:
# ls /lost+found
|
OS Image Version |
Orphan File Directories |
|
3 |
/lost+found /boot/lost+found /oracle/lost+found |
|
4.1 |
/lost+found /boot/lost+found /oracle/lost+found |
|
4.2.x |
/lost+found /boot/lost+found /home/lost+found /opt/lost+found /srv/lost+found /usr/lost+found /var/lost+found |
|
4.3.x |
/lost+found /boot/lost+found /home/lost+found /opt/lost+found /srv/lost+found /usr/lost+found /var/lost+found |
|
5.1.x |
/lost+found /boot/lost+found |
|
5.2.x |
/lost+found /boot/lost+found |
|
5.3.x |
/lost+found /boot/lost+found |
|
6.0.x |
/lost+found |
|
6.1.x and greater |
/lost+found |
Tips, Tricks and Reminders