- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: fstab
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
03-22-2002 02:47 AM
03-22-2002 02:47 AM
fstab
I would like to do a script to comment out some mount point in the fstab as below :
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /home vxfs delaylog 0 2
/dev/vg00/lvol5 /opt vxfs delaylog 0 2
/dev/vg00/lvol6 /tmp vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg06/lvol9 /app vxfs rw,suid,delaylog,datainlog 0 2
/dev/vg06/lvol1 /oradata vxfs rw,suid,delaylog,datainlog 0 2
/dev/vg06/lvol1 /oradata1 vxfs rw,suid,delaylog,datainlog 0 2
to be as below :
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /home vxfs delaylog 0 2
/dev/vg00/lvol5 /opt vxfs delaylog 0 2
/dev/vg00/lvol6 /tmp vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
#/dev/vg06/lvol9 /app vxfs rw,suid,delaylog,datainlog 0 2
#/dev/vg06/lvol1 /oradata vxfs rw,suid,delaylog,datainlog 0 2
#/dev/vg06/lvol1 /oradata1 vxfs rw,suid,delaylog,datainlog 0 2
and the script could create additional mount point as below :
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /home vxfs delaylog 0 2
/dev/vg00/lvol5 /opt vxfs delaylog 0 2
/dev/vg00/lvol6 /tmp vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
#/dev/vg06/lvol9 /app vxfs rw,suid,delaylog,datainlog 0 2
#/dev/vg06/lvol1 /oradata vxfs rw,suid,delaylog,datainlog 0 2
#/dev/vg06/lvol1 /oradata1 vxfs rw,suid,delaylog,datainlog 0 2
/dev/vg07/lvol9 /app1 vxfs rw,suid,delaylog,datainlog 0 2
/dev/vg07/lvol1 /oradata2 vxfs rw,suid,delaylog,datainlog 0 2
/dev/vg07/lvol1 /oradata3 vxfs rw,suid,delaylog,datainlog 0 2
Thks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 02:53 AM
03-22-2002 02:53 AM
Re: fstab
Why script it, just do it by hand with vi.
C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 02:56 AM
03-22-2002 02:56 AM
Re: fstab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 03:00 AM
03-22-2002 03:00 AM
Re: fstab
Sorry I am not a script kiddie, so no further suggestions.
C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 03:06 AM
03-22-2002 03:06 AM
Re: fstab
comments are not officially supported in the fstab file.
if you have to this its easiest to have several versions of the file and copy them in as appropiate.
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 03:20 AM
03-22-2002 03:20 AM
Re: fstab
I have just had another look at the fstab file and this is really not a good idea. It would be more sensible to have all the entries in one file then automate mounting and unmounting the file systems using cron or at or a script.
good luck
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 03:31 AM
03-22-2002 03:31 AM
Re: fstab
vi /etc/fstab << EOF
:g/vg06/s//vg07/
:wq!
EOF
Regards,
Trond
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 03:40 AM
03-22-2002 03:40 AM
Re: fstab
I agree with the others that you are better to make 2 copies of the fstab file. It is silly to write a script to make the same 3 changes to fstab every time it's run.
Here are a few pointers for scripting.
Use ksh or sh, because what you are doing is not really complex.
To check for directories in a script (see "man test").
if [ -d /somedir ] ; then
echo "I have /somedir"
else
mkdir /somedir
fi
To see if something is mounted..
TESTDIR=`/etc/mount|grep somedir|awk '{print $1}'`
if [ -n $TESTDIR ] ; then
echo "/somedir is mounted"
#stick umount here...
else
echo "/somedir is not mounted"
#stick mount here.
fi
I would recommend that you get a book published by O'Reilly and Associates called "Unix System Administration". It will give you scripting pointers, as well as what NOT to do (like put comments in fstab). This book covers HP-UX, Solaris, Irix, Aix, and Linux as well as a bit of SCO. It is not very complex on any specific system, but gives good practical advice for the basics on each major brand of UNIX.
Regards,
Shannon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 03:44 AM
03-22-2002 03:44 AM
Re: fstab
for commenting out special vgs, try this:
#!/bin/sh
#
#
# set -x
echo "Enter pattern: \c"
read mod_pattern
ed /etc/fstab <
w
q
EOF
HTH,
RGDS, Holger