Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2011-10-26
6
Medium Priority
?
3,131 Views
Last Modified: 2012-06-21
can we umount /tmp and run fsck without downtime in AIX
0
Comment
Question by:sreecreddy
6 Comments
 
LVL 2

Expert Comment

by:KishorDas
ID: 37036104
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.
0
 
LVL 19

Expert Comment

by:xterm
ID: 37036143
@KishorDas
No, you cannot run fsck on a mounted partition, so you do not want to remount it elsewhere.

@sreecreddy
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.

0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 2000 total points
ID: 37036552
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.

wmp
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 14

Expert Comment

by:sjm_ee
ID: 37036628
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.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37036659
OK,

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!

wmp
0
 

Author Closing Comment

by:sreecreddy
ID: 37037019
Thanks a lot for the solution that u have provided.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month10 days, 23 hours left to enroll

571 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