Recreating the Hosts file on a Netapp filer from the host backup file host.bak and wrfile

Hi All,

I recently did a Data Ontap upgrade to my Netapp filers and after I was complete everything seemed to be working normally except that one of the filers was showing up as its IP Address in System Manager. When connected via telnet, the command prompt did not show the filer name. After further investigation, I realized the host file was only 0 KB and the contact looked irregular when compared with the host file of our other filers. The fix was to recreate the host file using the host.bak file. To do this you can follow the instructions below.

Note: The filer name used in the following example is “filer01”. You should substitute your own filer name wherever necessary.

Login to the filer having the issue as root.

Type the following command to view the host file:

“rdfile /etc/hosts.bak”

The output should look something similar to as follows depending on your environment:

#Auto-generated by setup Thu Dec 2 17:38:01 GMT 2010

127.0.0.1 localhost

10.10.0.20 filer01 filer01-VIF_NFS

# 0.0.0.0 filer01-VIF_iSCSI

# 0.0.0.0 filer01-e0P

Now Type:

“wrfile /etc/hosts” and press enter

Now copy and paste the output that we received from the rdfile command and paste it into file and press enter. So your screen should look similar to what is illustrated below.

> wrfile /etc/hosts

#Auto-generated by setup Thu Dec 2 17:38:01 GMT 2010

127.0.0.1 localhost

10.10.10.20 filer01 filer01-VIF_NFS

# 0.0.0.0 filer01-VIF_iSCSI

# 0.0.0.0 filer01-e0P

You may receive the following error after pressing enter. It can be safely ignored.

read: error reading standard input: Interrupted system call”

Now type:

“rdfile /etc/hosts”

to check the host file to see if the new information is there. Should look as follows:

127.0.0.1 localhost

10.10.0.20 filer01 filer01-VIF_NFS

# 0.0.0.0 filer01-VIF_iSCSI

# 0.0.0.0 filer01-e0P

Now type:

“hostname filer01”

In my case, the filer name was no longer showing at the prompt when the issue occurred. When I typed “hostname filer01” the prompt went back to normal as show below.

filer01>

Your host file is now recreated with the proper information. Hope this helps. As always, if you have any questions or feedback please leave a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *