Microsoft Virtualization Discussions

Remove-NaNfsExport vs CMD exportfs -z

scheckel
2,937 Views

Hi,

is Remove-NaNfsExport similar to exportfs -z

I want to make sure that entries in the exports file are only commented out not removed:

Here is the man page from exportfs:

-z

    Unexports a file system path and removes its export entry from the /etc/exports file. Use the -z option to remove a file system path from the /etc/exports file without manually editing the /etc/exports file. Note: By default entries are actually commented out and not removed from the /etc/exports file. To change the behavior to actually remove entries switch off the nfs.export.exportfs_comment_on_delete option. For more information see na_options(1).

Would be nice to get clarification.

Best wishes

Markus,

2 REPLIES 2

vinith
2,937 Views

Hi Markus,

You can get more help about a powershell cmdlet using

Get-Nahelp Remove-NaNfsExport - Detailed

Here's what the description says about this  cmdlet.

PS C:\Windows\system32> Get-Help Remove-NaNfsExport -Detailed

NAME

    Remove-NaNfsExport

SYNOPSIS

    Removes the rules for a set of pathnames.

SYNTAX

    Remove-NaNfsExport [-Paths] <String[]> [-Persistent] [-Controller <NaController>] [-WhatIf] [-Confirm]

    [<CommonParameters>]

    Remove-NaNfsExport [-AllPaths] [-Persistent] [-Controller <NaController>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

    Removes the rules for a set of pathnames. This returns an error if any of the pathnames don't have a rule. Set the

    Persistent option to modify the etc/exports file and keep this change persistent upon reboots.

PARAMETERS

    -Paths <String[]>

        Pathnames to be deleted from the exports table.

    -Persistent

        Default value is false.  Modify the etc/exports file to delete the rules permanently.  CAUTION: If AllPaths

        and Persistent are both specified, all exports are removed permanently.

    -Controller <NaController>

        The Data ONTAP controller object, embodied by an NaController object.  This parameter is returned by the

        Connect-NaController cmdlet.  If not specified, the value in the global variable CurrentNaController is used.

    -WhatIf

    -Confirm

    -AllPaths

        Default value is false. Specify to delete all rules. Paths must be left empty if this option is true.

    <CommonParameters>

        This cmdlet supports the common parameters: Verbose, Debug,

        ErrorAction, ErrorVariable, WarningAction, WarningVariable,

        OutBuffer and OutVariable. For more information, see

        about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

    --------------  Example 1 --------------

    C:\PS>Remove-NaNfsExport -Persistent /vol/testvol

    Remove the export for volume 'testvol'.

    DeletedPathnames                                            UnexportedPathnames

    ----------------                                            -------------------

    {/vol/testvol}                                              {/vol/testvol}

scheckel
2,937 Views

Hi Vinith,

this i checked by my self, but there is no information if its commeted out or not. I think i need to test it. Would be fine if it is documented.

Best wishes,

Markus.

Public