Scripting /etc/fstab changes
Miner, Jonathan W (CSC) (US SSA)
jonathan.w.miner at baesystems.com
Tue Dec 5 21:55:22 UTC 2006
Hi -
Your script is going to be something like this:
cp /etc/fstab /etc/fstab.orig
sed 's/^hostA/hostB/' /etc/fstab.orig > /etc/fstab.new
-----Original Message-----
From: redhat-list-bounces at redhat.com on behalf of Danda, Richard SFC
Sent: Tue 12/05/2006 04:42 PM
To: 'redhat-list at redhat.com'
Cc:
Subject: Scripting /etc/fstab changes
Greetings all,
I have a NetApp FAS270 filer that I have migrated NFS data directories too.
I need to make changes to all my RHEL machines to point to the new device
for mounts. Is there an easy way to script the change?
Example:
Current /etc/fstab
hostA:/user/bin /user/bin nfs defaults 0 0
hostA:/user/lib /user/lib nfs defaults 0 0
hostA:/home/common/storage /home/common/storage nfs defaults 0 0
Need to change it to this:
hostB:/user/bin /user/bin nfs defaults 0 0
hostB:/user/lib /user/lib nfs defaults 0 0
hostB:/home/common/storage /home/common/storage nfs defaults 0 0
I believe you can use sed or awk, to do that????
Thanks for any assistance.
V/R
Richard J. Danda II
SFC, USA
BLCSE Network Manager/IASO
Maneuver Support Battle Lab
Fort Leonard Wood, MO
We trained very hard -- but it seemed that every time we were beginning to
form up into teams, we would be reorganized. I was to learn later in life we
tend to meet new situations by reorganizing, and a wonderful method it can
be for creating the illusion of progress while producing confusion,
inefficiency, and demoralization. Petronius Arbiter, 66 A.D.
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
More information about the redhat-list
mailing list