can we umount /tmp and run fsck without downtime in AIX

Posted on 2011-10-26
Last Modified: 2012-06-21
can we umount /tmp and run fsck without downtime in AIX
Question by:sreecreddy
    LVL 2

    Expert Comment

    If your /tmp is a separate partition. The it is possible.

    First unmount /tmp and again mount it to some other partition and then run fsck to check the partition that is mounted earlier as /tmp. After checking again unmount the /tmp and remount it to the original partition.
    LVL 19

    Expert Comment

    No, you cannot run fsck on a mounted partition, so you do not want to remount it elsewhere.

    The term "downtime" is subjective.  Although you may be able to keep the system itself running, any apps that write to (or just use) files in /tmp will have unpredictable results at best, if not bomb out spectacularly.  I propose that you schedule a late night maintenance when activity is low, and then switch to single-user mode ("init 1") in order to stop all activity on the partition.  Then you can "umount /tmp" and run fsck on whatever its device name is (you can find this in /etc/fstab, first column).   Then you can simply "mount /tmp" when its done.  Then reboot normally.

    LVL 68

    Accepted Solution

    The command to enter single user mode in AIX is

    telinit s

    There is no runlevel "1" in AIX.

    But you can't umount /tmp, not even in single user mode. because the shell opened in this mode will hold a temporary file open in /tmp (one of these /tmp/shxxxxxx.n things).

    Better boot into maintenance mode, from the installation DVD, the Diagnostic DVD or from NIM.

    Choose to access rootvg without mounting filesystems, then run

    fsck -f /dev/hd3

    Perform a normal reboot when done.

    Short: You can't fsck /tmp without downtime. Not in AIX.

    LVL 14

    Expert Comment

    No you cannot unmount /tmp from a running AIX system. There will always be some running operating system process that has a temporary file open in /tmp and/or has /tmp as it's current directory.
    LVL 68

    Expert Comment


    with some effort you could umount /tmp in single user mode.

    This will not avoid "downtime", but will get you rid of the need to boot from DVD/NIM.

    This involves changing root's shell to "/usr/bin/csh" before entering single user mode:

    "chsh root /usr/bin/csh"

    Once you entered the new mode you can try to umount /tmp, but this will most probably not work
    Now you need "lsof" to check which remaining processes are using /tmp. "fuser" is not sufficient, it will not show you all you need.

    "lsof" is on the Expansion DVD, for older AIX versions get it from the toolbox.

    Kill all the processes you found with "lsof /dev/hd3" until you can umount /tmp.

    Proceed with "fsck -f /dev/hd3" like above, then mount /tmp and change root's shell back to what it's been before (probably /bin/ksh).

    Now use "exit" to leave single user mode (just hit <Enter> when asked for a new runlevel).

    Good luck!


    Author Closing Comment

    Thanks a lot for the solution that u have provided.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (, discussed installing the Solaris Operating S…
    I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now