RE: Scripting /etc/fstab changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx on behalf of Danda, Richard SFC
Sent:	Tue 12/05/2006 04:42 PM
To:	'redhat-list@xxxxxxxxxx'
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@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux