ONTAP Discussions

Access to LUN through NFS on ONTAP 9

Sebastien_BLANCHET
4,760 Views

On ONTAP 9.10,  I would like to backup/restore a LUN through NFS.

 

In 7-mode there was the command lun share to allow accessing a LUN through NFS

https://library.netapp.com/ecmdocs/ECMP1196995/html/GUID-F134DB5A-60F2-47EE-9A92-228351549BF6.html

 

What is the equivalent command for ONTAP 9.10 ?

 

1 ACCEPTED SOLUTION

Sebastien_BLANCHET
4,623 Views

Apparently there is no way anymore to access LUN over NFS with ONTAP 9,

therefore I will resign myself to backup my LUNs with iSCSI from Linux.

View solution in original post

10 REPLIES 10

Ontapforrum
4,739 Views

Interesting query, b'cos I don't remember trying this (lun share) feature even when I was dealing with 7-mode filers.  Looks like it did exist in 7-mode.

 

I checked the document for '7-mode cmds to Ontap map', it says -lun share Not supported in cdot/OTNAP.

https://docs.netapp.com/us-en/ontap-7mode-transition/command-map/reference_how_7_mode_commands_map_to_clustered_ontap_commands.html#k-o

 

If you want to backup/restore lun (as whole) without block protocols, then NDMP can do the job.

TMACMD
4,711 Views

So obviously not a best practice or recommended. But…

You could add nfs to the vserver. You could add a data lif. You could give the volume that has the lun a junction path. I’d probably set a default export policy rule to 100% read only. 
You might be able to backup the “lun file” over nfs

 

 of course you could go a few steps further and clone the volume and the Mount/access/backup from the clone without fear of damaging the active lun

 

NOTE: I have not tried this before but I believe in theory it should work. I think the only difference is the lun serial number may change on the clone

Sebastien_BLANCHET
4,704 Views

I have already added

  • NFS to the vserver
  • data LIF
  • junction path
  • setup export policy

I can mount the volume with NFS,

I see the underlying LUN files

but when I try to read the file, for example with md5sum, I got Input/Output error.

 

In 7-mode, there was an additional step to allow NFS access to the file

lun share <lun_path> read

 

 

 

 

aladd
4,674 Views

There was a post on this years ago, I can't think of a use case for this as NFS is a NAS protocol for file access whereas LUNs are accessed over SAN protocols. Is there an end goal you're trying to achieve by mounting a LUN over NFS?

 

Reference post: https://community.netapp.com/t5/Network-and-Storage-Protocols/Sharing-a-CIFS-or-NFS-LUN/m-p/47119

Sebastien_BLANCHET
4,649 Views

Thank you @aladd for finding this previous post.

 

I use LUN to boot physical computers, and I used NFS access to backup the LUN.

 

To backup the LUN

  • I shutdown the physical computer
  • I mount the volume that hosts the LUN on the backup server with NFS
  • I copy directly the file

If the physical computer does not boot

  • I shutdown the physical computer
  • I mount the volume that hosts the LUN on the backup server with NFS
  • I mount the LUN on the loopback, and I can see inside that is wrong.

 

Of course I can use a iSCSI Linux client do achieve the same goal, but it was more convenient with NFS.

 

elementx
4,646 Views

That's cool!

 

> Of course I can use a iSCSI Linux client do achieve the same goal, but it was more convenient with NFS.

 

For cold backup, it is more convenient this way. A slightly more complicated way would be to shutdown the block client, snapshot the LUN, and boot the client. Then the snapshot could be cloned for backup and presented to an NFS client for backup.

I wrote a similar script for iSCSI, and it worked well, but once you get to dozens of volumes or LUN configuration change a lot, this becomes a little bit complicated to manage and the risk of mistakes more pronounced (e.g. you could forget to backup a volume, or backup a wrong volume, etc.).

Sebastien_BLANCHET
4,624 Views

Apparently there is no way anymore to access LUN over NFS with ONTAP 9,

therefore I will resign myself to backup my LUNs with iSCSI from Linux.

elementx
4,614 Views

That sounds like a "security enhancement". It'd be nice if NFS access was a configurable option.

TMACMD
4,489 Views

I just did a quick and dirty test.

  1. create LUN
  2. Make volume NFS capable.
  3. mount volume on Linux
  4.  Tried to read LUN -> input/output error
  5. Took a VOLUME SNAPSHOT
  6. On the linux side: cd /mount/.snapshot/test
  7. Tried the read the LUN....no problem
  8. Just remember to delete the Snapshot when done

Not sure if that will help you or not.

Sebastien_BLANCHET
4,471 Views

@TMACMD I did not succeed to repeat your setup to read the LUN through NFS.

 

Even if I read the LUN content through a snapshot, I am still getting Input/output error

I have tried with a LUN which is mapped and and also with a new unmapped LUN 

I run ONTAP 9.10.1p7

 

  • Which ONTAP version do you use ?
  • Which options do you use to mount the NFS share ?

 

Public