Link to home
Start Free TrialLog in
Avatar of sreecreddy
sreecreddy

asked on

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

can we umount /tmp and run fsck without downtime in AIX
Avatar of KishorDas
KishorDas
Flag of India image

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.
Avatar of xterm
xterm

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

ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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
Avatar of sreecreddy

ASKER

Thanks a lot for the solution that u have provided.