Network and Storage Protocols

Accessing a lun with NFS

onforceinc
12,159 Views

I used the following command on filer as specified in Netapp's docs:

lun share /vol/vol1/qtree1/lun2 all

what is the next thing to do on the host (linux) to mount it as NFS? and be able to access it and see the data

Thank you

9 REPLIES 9

adamfox
12,159 Views

You will see the LUN via NFS, but not the data inside the LUN.  This is most useful for things like backing up a LUN via NFS.

scottgelb
12,159 Views

I saw a post about someone who used "losetup" on Linux and "lofiadm" on Solaris to do a loopback mount... mount a volume with a shared lun over nfs.  Then use the loopback mount to the lun in the nfs mount.  It is pretty slick, but I'd wonder why you wouldn't use iSCSI instead to mount the lun directly to get block i/o to the device.  Or like Adam mentioned, a way to backup a lun over nfs by mounting the volume.

onforceinc
12,159 Views

Any example on how to use losetup on linux?, the lun is using FCP not iSCSI.

I wanna be to see the data before recovering.

Darkstar
12,159 Views

You can still export the LUN via iSCSI even if it's already mapped to an FCP initiator.

It's not an "either ... or" relationship, both iSCSI and FCP can be active on the same LUN at the same time.

Just create an iSCSI igroup and map the LUN to it. Make sure you only mount it read-only though!

-Michael

wmccormick
12,159 Views

Has anyone successfully done this?

I'm going to be giving it a go in the next few days.  I'll let you know what steps I used and whether or not it works.

wmccormick
12,159 Views

LOL.  Seek and ye shall find.

It's explained quite well right here:

http://en.wikipedia.org/wiki/Loop_device

zawik
12,159 Views

Hi,

A little old topic but i was just wondering what the command lun share <path> actually does? You can see the LUN as a file wether you share it or not, so what is that for ; regarding that you cannot get access to the lun over NAS and :

Note
A LUN cannot be extended or truncated using NFS or CIFS protocols.

If you want to write to a LUN over NAS protocols, you must take the LUN offline or unmap it to prevent overwriting data in the LUN using the SAN protocol. To make a LUN accessible to a host using a NAS protocol, complete the following steps.

Step

Action

1

Determine whether you want to read, write, or do both to the LUN over the NAS protocol and take the appropriate action:


  • If you want read access, the LUN can remain online.
  • If you want write access, ensure that the LUN is offline or unmapped.
2

Enter the following command:

lun share lun-path {none|read|write|all}

Example

lun share /vol/vol1/qtree1/lun2 read

Result

The LUN is now readable over NAS.

freeb
12,159 Views

if i would copy the lun with the share options read with cifs or nfs, how it is possible to restore it.

if i copy it back to another volume, the lun doesn't appear with lun show etc.

thanks

freeb
12,159 Views

i could answer myself:

lun create -f <file_path> -t <ostype> [ -o noreserve ] [ -e space_alloc ] <lun_path>

Public