- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script for unmounting all filesystem and deact...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2010 10:15 PM
тАО02-20-2010 10:15 PM
Script for unmounting all filesystem and deactivating VGs over ssh
Do anyone have a script alreay using on HPUX for ssh into a group of servers and unmounting all filesystems and deactivating the VGs?
I want to unmount all filesystems and deactivtae VGS excpet VG00.
Can anyone help me on this. I am not good at scripting so all your help will be a great help
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2010 10:49 PM
тАО02-20-2010 10:49 PM
Re: Script for unmounting all filesystem and deactivating VGs over ssh
You can't unmount ALL filesystems without rebooting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 12:29 AM
тАО02-21-2010 12:29 AM
Re: Script for unmounting all filesystem and deactivating VGs over ssh
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1409419
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 01:42 AM
тАО02-21-2010 01:42 AM
Re: Script for unmounting all filesystem and deactivating VGs over ssh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 05:58 AM
тАО02-21-2010 05:58 AM
Re: Script for unmounting all filesystem and deactivating VGs over ssh
> Whenever we need to perform any SAN activities where we have to unmount all filesystems and deactivate VGS,
You could write something yourself. Read the lines of a list of filesystem names and volume groups. Knowing the filesystem names you would probably have to kill any processes using them ('fuser -k'); then unmount the filesystem; and finally use 'vgchange -a n' to deactivate the volume group.
The "guts" of your script might look something like:
#!/usr/bin/sh
MYFILESYS=/var/tmp/myfilesys
MYVGS=/var/tmp/myvgs
cat <<- EOF
filesys1
filesys2
filesys3
filesysX
filesysY
EOF > ${MYFILESYS}
cat <<- EOF
vg01
vg02
vg03
EOF > ${MYVGS}
while read FS
do
kill -k ${FS}
umount ${FS}
done < ${MYFILESYS}
while read VG
do
vgchange -a n ${VG}
done < ${MYVGS}
exit 0
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-21-2010 07:27 AM
тАО02-21-2010 07:27 AM
Re: Script for unmounting all filesystem and deactivating VGs over ssh
Here's a more viable script that drives its actions from the '/etc/fstab' of each server:
# cat ./sanmaint
#!/usr/bin/sh
MYVGS=/var/tmp/myvgs
while read DEV MNTPT X
do
VG=$( echo ${DEV} | awk '/^\/dev\// {split($1,a,"/");print a[3]}' )
if [ ! -z "${VG}" -a "${VG}" != "vg00" ]; then
echo fuser -k ${MNTPT} #...remove 'echo' to activate
echo ${VG} > ${MYVGS}
fi
done < /etc/fstab
sort -u ${MYVGS} | while read VG
do
echo vgchange -a n ${VG} #...remove 'echo' to activate
done
rm ${MYVGS}
exit 0
Regards!
...JRF...