While setting up a Network Appliance storage system today for a customer, I ran into a situation that was a bit puzzling for a moment. I needed to change the IP address on the storage system’s clustered controllers, but in order to do that I needed to edit some files in the /etc directory on the root volume. Normally, that wouldn’t be a big deal; I’d just mount the root volume (vol0) via CIFS or NFS from my MacBook Pro and go from there.
However, in this particular instance, the customer hadn’t licensed the CIFS and NFS protocols because this storage system would be used strictly as an iSCSI target for a VMware ESX Server deployment. That meant there would be no mounting the root volume this time. So how does one go about editing files in the Data ONTAP CLI?
Excellent question. The answer is the â€œpriv set advancedâ€ command. Rightly so, NetApp warns you that running â€œpriv set advancedâ€ exposes functionality that can be dangerous; don’t muck around in there or you’re likely to find yourself with a non-functional NetApp storage system. However, with a bit of caution, the advanced commands are just what we need in this situation.
The advanced command set includes useful commands like â€œlsâ€ (to list the files in the /etc directory, for example), â€œrdfileâ€ (think of â€œcatâ€ or â€œmoreâ€ from a Linux/UNIX system), and â€œwrfileâ€ (for redirecting standard input to a text file). While there’s no text editor per se, these three tools can get us most of the way there.
So here’s how I used the advanced command set to change the IP addresses of the storage system:
- Enabled the advanced command set with â€œpriv set advanced.â€
- Displayed the current contents of the /etc/hosts file with â€œrdfile /etc/hostsâ€.
- Created /etc/hosts.new (containing the contents of /etc/hosts with the changes I needed) using â€œwrfile /etc/hosts.newâ€.
- Verified the contents of /etc/hosts.new using rdfile.
- Renamed /etc/hosts to /etc/hosts.setup using â€œmvâ€.
- Renamed /etc/hosts.new to /etc/hosts using â€œmvâ€.
- Rebooted the storage system for the change to take effect.
Upon the reboot, the storage system was now using the new IP addresses requested by the customer. Problem solved!