- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- need help with scripting
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
Forums
Discussions
Discussions
Discussions
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
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
10-07-2003 07:37 AM
10-07-2003 07:37 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 07:50 AM
10-07-2003 07:50 AM
Re: need help with scripting
I am not exact sure what you want do do, to list all logical volumes belonging to one group, try:
ls /dev/vg00/lvol*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 07:54 AM
10-07-2003 07:54 AM
Re: need help with scripting
I would make a text file list of the following information:
/dev/vg00/lvname1
/dev/vg09/lvname2
call it input_file
while read -r xx
do
lvremove -f $xx
done < input_file
This script assumes the filesystem is already unmounted. If not, ask add second field space delimited. The second field will be the filesystem name.
Data is:
/dev/vg01/lvname1 /filesystemname
Script is:
while read -r xx yy
do
umount $yy
lvremove -f $xx
done < input_file
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 08:03 AM
10-07-2003 08:03 AM
Re: need help with scripting
If you just want to see all the filesystems that are belong to a single volume group, and if you are mounting them in /etc/fstab, you could just use 'grep' to see all those entries for a particular volume group.
Something like this might work:
grep vghello /etc/fstab
Of course, if you have vghello and vghello1 and vghello2, you might find all of them. But it is a start.
As Leif has mentioned, you can use the entries for the logical volumes in the volume group device directory to provide a list of logical volumes. You could feed that to another command like 'bdf' and grab the output.
I'm just curious, but why do you have to remove 200 filesystems?
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 08:34 AM
10-07-2003 08:34 AM
Re: need help with scripting
how do I use that text file to umount all fileystems that i have in tthat text file..
bc we no longer needs these
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 09:02 AM
10-07-2003 09:02 AM
Re: need help with scripting
do
fuser -ku $MOUNT_PT_VAR (*
umount $MOUNT_PT_VAR
lvremove $LOG_VOL_VAR
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 09:20 AM
10-07-2003 09:20 AM
Re: need help with scripting
i had a file name test
cat test
/hello
/hi
/work
/etc....
now, i want to umount all of these mnt point that currently in test..
how can i do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 09:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 09:33 AM
10-07-2003 09:33 AM
Re: need help with scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 10:29 AM
10-07-2003 10:29 AM
Re: need help with scripting
if I hve something like this
hello#bye
and I want to remove # sign and add a space in between hello and bye ...
I tried the cut command but it is not working/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2003 01:14 PM
10-07-2003 01:14 PM
Re: need help with scripting
echo "hello#there" | sed 's/#/ /g'
gives "hello there"
and so does
echo "hello#there" | tr '#' ' '