Check Filesystems on a Terminal

Check Filesystems on a Terminal

Check Filesystems on a Terminal

Objectives

  1. Determine if a filesystem check is necessary.
  2. Determine which filesystem needs to be checked.
  3. Determine which OS image version is installed on the terminal.
  4. Run appropriate commands to check filesystem(s).
  5. Check for orphaned files.

Prerequisites

  1. Terminal gets at least part way through the boot process.
  2. Physical access to the terminal.
  3. USB keyboard.
  4. Password for "root" user on the terminal.

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:

  • After a forced shut down (i.e. user held down power button on terminal to force power off).
  • After a power outage (if the terminal was powered on when the outage occurred).
  • Hard drive in the terminal is failing.

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:

  • UNEXPECTED INCONSISTENTCY; RUN fsck MANUALLY.
  • fsck failed. Please repair manually and reboot.
  • Give root password for login:

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

  1. You CANNOT run a filesystem check on a mounted filesystem. Running a filesystem check on a mounted filesystem will completely destroy the filesystem and you will have to re-image the machine. The fsck command will warn you if you try to run a filesystem check on a mounted filesystem, and ask if you want to continue; always choose "n" for no.
  2. Do not type "yes" at the "(repair filesystem) #" command prompt. This is not a question, it is just the command prompt.
  3. Use ↑ (up arrow) on the keyboard to browse through the shell command history. You can save a lot of time by editing similar commands instead of typing them in from scratch.

    • Related Articles

    • Check Filesystems on a Terminal that is Stuck During the Boot Process Without Shell Access

      Check Filesystems on a Terminal that is Stuck During the Boot Process Without Shell Access Objectives 1. Determine if this article is the correct choice for the present issue. 2. Determine if a filesystem check is necessary. 3. Determine which ...
    • How to Check the HDD Cable Connections on Pioneer S-Line Terminals

      How to Check the HDD Cable Connections on Pioneer S-Line Terminals Objectives Check and reseat connections for cables attaching the HDD to the terminal. Prerequisites These instructions apply only to Pioneer S-Line Terminals and will not apply to ...
    • Check Code Into Subversion

      Instructions Once you have run your project and you are satisfied with your test results, you will want to check in code to our repository. All of our code is stored in a central repository hosted in our data center. The subversion tool, Tortoise ...
    • Troubleshoot Terminal Not Registered Error Message

      Troubleshoot Terminal Not Registered Error Message Objectives Troubleshoot situation where customer calls to say they have received a message on the terminal of ‘Your terminal is not currently registered with FullCount. Please contact FullCount to ...
    • Cheatsheet for Terminal OS Image Version 5.0 and Newer

      Task Instructions Why am I doing this? Local Remote Switch to Shell: Connect USB keyboard to terminal. Press Control + Alt + F1. At the login: prompt, type root and press Enter. At the Password: prompt, type #FullCount#Support# and press Enter. ...