Here are a few Data Ontap CLI commands that I’ve put together for reference.
I will continuously
add to this list
General Commands
setup (Re-Run initial setup)
halt (Reboots controller into bootrom)
reboot (Reboots controller back to Data Ontap)
sysconfig -a (System configuration and information)
java netapp.cmds.jsh (limited freebsd cli)
storage show disk (show physical information about disks)
passwd (Change password for logged in user)
sasadmin shelf (shows a graphical layout of your shelves with occupied disk slots)
options trusted.hosts x.x.x.x or x.x.x.x/nn (hosts that are allowed telnet, http, https and ssh
admin access. x.x.x.x = ip address, /nn is network bits)
options trusted.hosts * (Allows all hosts to the above command)
sysstat -s 5 (Displays operating statistics every 5 seconds i.e. CPU, NFS, CIFS, NET, DISK, etc)
Diagnostics
Press DEL at boot up during memory test followed by boot_diags and select all (Diagnostic tests
for a new install)
priv set diags (Enter diagnostics CLI mode from the Ontap CLI)
priv set (Return to normal CLI mode from diagnostics mode)
Software
software list (Lists software in the /etc/software directory)
software get http://x.x.x.x/8.0_e_image.zip 8.0_e_image.zip (Copy software from http to
software directory)
software delete (Deletes software in the /etc/software directory)
software update 8.0_e_image.zip -r (Install software. The -r prevents it rebooting afterwards)
ACP (Alternate Control Path)
options acp.enabled on (Turns on ACP)
storage show acp -a (show ACP status)
Root Volume
The Root Volume can only be on a 32 bit aggregate if you want to create a 64 bit aggregate you
must create a seperate aggregate.
Aggregates
aggr create aggregate_name (Creates an Aggregate)
aggr destroy aggregate_name (removes an Aggregate)
aggr offline aggregate_name (takes an Aggregate offline)
aggr online aggregate_name (bring an Aggregate online)
aggr options aggregate_name root (makes an Aggregate root|Only use if your Root Aggregate is
damanged)
aggr status (shows status of all aggregates)
aggr status aggregate_name (show status of a specific Aggregate)
aggr show_space aggregate_name (shows specific aggregate space information)
aggr options aggregate_name nosnap=on (Disable snapshot autocreation)
aggr options aggregate_name raidsize=x (x being the number of drives in the RAID)
snap reserve -A aggregate_name 0 (Set Aggregate snap reserve to 0% or any number you enter)
Volumes
vol create volume_name (Creates a volume)
vol autosize volume_name (Shows autosize settings for a given volume)
vol autosize volume_name on|off (Turns Volume autosize on or off)
vol options volume_name (Lists volume options)
vol size volume_name + size k|m|g|t (increase volume size by KB, MB, GB or TB)
vol status -f (lists broken or failed disks)
Qtree’s
qtree create /vol/volume_name/qtree_name (Create a qtree within a volume)
qtree security /vol/volume_name/qtree_name unix|ntfs|mixed (Change security settings of a
qtree)
qtree stats qtree_name (Shows CIFS or NFS ops/sec for a given qtree)
Snapshots
snap create volume_name snapshot_name (create a snapshot)
snap list volume_name (List snapshots for a volume)
snap delete volume_name snapshot_name (delete a snapshot on a volume)
snap delete -a volume_name (Deletes all snapshots for a volume)
snap autodelete volume_name show (Shows snapshot autodelete settings for a volume)
snap restore -s snapshot_name volume_name (Restores a snapshot on the specified volume
name)
snap sched volume_name weeks days hours@time (Creates a snapshot schedule on a volume i.e.
snap sched volume 4 5 1@07)
snap delta volume_name (Shows delta changes between snapshots for a given volume)
snap reserve volume_name (Shows the snap reserve for a given volume)
snap reclaimable volume_name snapshot_name (Shows the amount of space reclaimable if you
remove this snapshot from the volume)
options cifs.show_snapshot on (Allows snapshot directory to be browse-able via CIFS)
options nfs.hide_snapshot off (Allows snapshot directory to visible via NFS)
SnapMirror
options snapmirror.enable on (turns on SnapMirror. Replace on with off to toggle)
rdfile /etc/snapmirror.allow (Performed on the Source Filer. You should see you destination filers in
this file.)
wrfile /etc/snapmirror.allow (Performed on the Source Filer. Overwrites the file with the specified
destination filer name and ip address)
vol restrict volume_name (Performed on the Destination. Makes the destination volume read only
which must be done for volume based replication. Don’t use for Qtree based replication)
snapmirror initialize -S srcfiler:source_volume dstfiler:destination_volume (Performed on the
destination. This is for full volume mirror. For example snapmirror initialize -S filer1:vol1
filer2:vol2)
snapmirror initialize -S srcfiler:/vol/vol1/qtree dstfiler:/vol/vol1/qtree (Performed on the
destination. Performans the same as the command above but for Qtree’s only)
snapmirror status (Shows the status of snapmirror and replicated volumes or qtree’s)
snapmirror quiesce volume_name (Performed on Destination. Pauses the SnapMirror Replication)
snapmirror break volume_name (Performed on Destination. Breaks or disengages the SnapMirror
Replication)
snapmirror resync volume_name (Performed on Destination. When data is out of date, for example
working off DR site and wanting to resync back to primary, only performed when SnapMirror
relationship is broken)
snapmirror update -S srcfiler:volume_name dstfiler:volume_name (Performed on Destination.
Forces a new snapshot on the source and performs a replication, only if an initial replication
baseline has been already done)
snapmirror release volume_name dstfiler:volume_name (Performed on Destination. Removes a
snapmirror destination)
/etc/snapmirror.conf (edit or wrfile this file to enter in a snapmirror schedule. i.e. srcfiler:vol1
dstfiler:vol1 – 15 * * * * This will replicate every 15 minutes. Each * represents a value. Starting
from right to left you have day of week, month, day of month, hour minute. Each value can only
be a number. i.e. for month enter in 5 for May)
Cluster
cf enable (enable cluster)
cf disable (disable cluster)
cf takeover (take over resources from other controller)
cf giveback (give back controller resources after a take over)
vFiler – Multistore
vfiler status (Displays the status of the vfiler i.e. running or stopped)
vfiler run vfiler_name setup (Runs the vfiler setup wizard)
vfiler run vfiler_name cifs setup (Runs the cifs setup wizard for a vfiler)
vfiler create vfiler_name -i x.x.x.x /vol/volume_name or qtree_name (Creates a vfiler name with
ip address x.x.x.x and assigns the volume or qtree to the vfiler)
vfiler add vfiler_name -i x.x.x.x /vol/volume_name (Adds an ip address and additional volume to
an existing vfiler name)
vfiler remove vfiler_name -i x.x.x.x /vol/volume_name (Removes an IP address and volume from
an existing vfiler)
vfiler rename vfiler_name_old vfiler_name_new (Renames a vfiler from old name to new name)
vfiler stop vfiler_name (Stops a vfiler instance)
vfiler start vfiler_name (Starts a vfiler instance)
Autosupport
options autosupport.support.enable on (Turns Autosupport on)
options autosupport.support.enable off (Turns Autosupport off)
autosupport.doit “description” (creates an autosupport alert with a user defined description)
Hot Spares
Any functioning disk that is not assigned to an aggregate but is assigned to a controller functions
as a hot spare disk
disk show
vol status -r (displays which disks are allocated as spare)
Disks
disk show (Show disk information)
disk show -n (Show unowned disks)
disk assign 0d.02.0 -s unowned (Changes ownership from owned to unowned or to other cluster
member)
disk assign 0d.02.0 (assigns the disk to the controller you perform the command on)
options disk.auto_assign off (turns auto assign of unowned disks to controllers to off)
options disk.auto_assign on (turns auto assign of unowned disks to controllers to on)
storage show disk -p (displays primary, secondary port, shelf and bay in a metro cluster)
Luns
lun setup (runs the cli lun setup wizard)
lun offline lun_path (takes a lun offline)
lun online lun_path (brings a lun online)
lun show -v (Verbose listing of luns)
lun move /lun_path_source /lun_path_destination (Move lun from source to destination)
lun resize -f lun_path +|- new_size k|m|g|t (Resizes a lun by adding space (+) or subtracting
space (-) Note: a lun can only ever grow 10x it’s original size)
Fiber FCP
fcadmin config -t taget 0a (Changes adapter from initiator to target)
fcadmin config (lists adapter state)
fcadmin start (Start the FCP service)
fcadmin stop (Stop the FCP service)
fcp show adapters (Displays adapter type, status, FC Nodename, FC Portname and slot number)
fcp nodename (Displays fiber channel nodename)
fcp show initiators (Show fiber channel initiators)
fcp wwpn-alias set alias_name (Set a fiber channel alias name for the controller)
fcp wwpn-alias remove -a alias_name (Remove a fiber channel alias name for the controller)
igroup show (Displays initiator groups with WWN’s)
iSCSI
iscsi start (Start the iscsi service)
iscsi stop (Stop the iscsi server)
iscsi status (Show whether iscsi server is running or not running)
iscsi interface show (Show which interfaces are enabled or disabled for iscsi)
iscsi interface enable interface_name (Enable an interface for iscsi)
iscsi interface disableinterface_name (Disable an interface for iscsi)
iscsi nodename (Display the controllers iscsi nodename)
igroup show (Displays iSCSI initiators)
Cifs
cifs setup (cifs setup wizard)
cifs terminate (terminate the cifs service)
cifs restart (restarts cifs)
cifs shares (displays cifs shares)
cifs status (show status of cifs)
cifs lookup SID|name (Either displays the SID if you type in the name or name if you type in the
SID)
cifs sessions (Show you current cifs sessions)
cifs sessions -s username (Shows the current session for a user)
cifs broadbast -v volume_name “message” (Broadcast a message to all users connected to
volume_name)
cifs shares -add share_name /vol/volume_name/qtree_name (Create a cifs share on a specific
volume or qtree)
cifs shares -delete share_name (Deletes a share name)
cifs shares share_name (Displays full path and permissions of the share)
cifs access share_name -g user_rights (Grants specific user rights to the share)
cifs access share_name user_name permission (Grants a specific permission to a user for a share.
Permissions = Full Control, Change, Read, No Access)
cifs domain info (Lists information about the filers connected Windows Domain)
cifs testdc ip_address (Test a specific Windows Domain Controller for connectivity)
cifs prefdc (Displays configured preferred Windows Domain Controllers)
cifs prefdc add domain address_list (Adds a preferred dc for a specific domain i.e. cifs prefdc
addnetapplab.local 10.10.10.1)
cifs prefdc delete domain (Delete a preferred Windows Domain Controllers)
cifs gpresult (Displays which Windows Group Policies apply to this filer)
cifs gpupdate (Forces an update of Windows Group Policy)
cifs top (Performance data for cifs. cifs.per_client_stats.enable option must be on to use this
feature)
vscan on (Turns virus scanning on)
vscan off (Turns virus scanning off)
vscan reset (Resets virus scanning)
NFS
nfs setup (Runs the NFS setup wizard)
exportfs (Displays current exports)
exportfs -p path (Adds exports to the /etc/exports file)
exportfs -uav (Unexports all current exports)
exportfs -u path (Unexports a specific export from memory)
exportfs -z path (Unexports a specific export and also removes it from /etc/exports)
exportfs -a (Updates memory buffer with contents in /etc/exports)
nfsstat -d (Displays NFS statistics)
HTTP Admin
options httpd.admin.enable on (Turns on http web admin, na_admin)
options httpd.admin.access host=x.x.x.x,x.x.x.x (Allows admin access for specific hosts separated
by a comma)
SIS (Deduplication)
sis status (Show SIS status)
sis config (Show SIS config)
sis on /vol/vol1 (Turn on deduplication on vol1)
sis config -s mon-fri@23 /vol/vol1 (Configure deduplication to run every monday – Friday at 11pm
on vol1)
sis start -s /vol/vol1 (Run deduplication manually on vol1)
sis status -l /vol/vol1 (Display deduplication status on vol1)
df -s vol1 (View space savings with deduplication)
sis stop /vol/vol1 (Stop deduplication on vol1)
sis off /vol/vol1 (Disables deduplication on vol1)
User Accounts
useradmin user add user_name -g group_name (Adds a user to a group)
useradmin user list (Lists current users)
useradmin user list user_name (List specific user information)
useradmin group list (Lists current groups)
useradmin group delete group_name (Deletes a specific group name)
useradmin group modify group_name -g new_group_name (Modify group name)
useradmin user delete user_name (Delete a specific user)
useradmin user modify user_name -g group_name (Adds a user to a group)
useradmin domain user add user_name -g group_name (Adds a Windows Domain user to a local
group)
useradmin domain user list -g group_name (List Windows Domain users in a specific group)
DNS
dns flush (Flushes the DNS cache)
Reading and Writing Files (Deduplication)
rdfile path/file (Reads a file)
wrfile path/file (Writes to a file. Warning this method overwrites the file. Make sure you copy out
original contents if you wish to keep it. If you haven’t used this before try on the simulator.)
wrfile -a path/file (Writes to a file by appending the changes)
Logging
/etc/messages (All logging is for the system is stored here)
Network
if config vif0 -addr=x.x.x.x -mask=x.x.x.x -gw=x.x.x.x -dns-x.x.x.x (Sets IP information on the
interface named vif0
This post contains the list of commands that will be most used
and will come handy when managing or monitoring or troubleshooting a Netapp
filer.
sysconfig -a : shows hardware
configuration with more verbose information
sysconfig -d :
shows information of the disk attached to the filer
version : shows the
netapp Ontap OS version.
uptime : shows the
filer uptime
dns info : this
shows the dns resolvers, the no of hits and misses and other info
nis info : this
shows the nis domain name, yp servers etc.
rdfile : Like
"cat" in Linux, used to read contents of text files/
wrfile :
Creates/Overwrites a file. Similar to "cat > filename" in Linux
aggr status : Shows
the aggregate status
aggr status -r :
Shows the raid configuration, reconstruction information of the disks in filer
aggr show_space :
Shows the disk usage of the aggreate, WAFL reserve, overheads etc.
vol status : Shows
the volume information
vol status -s :
Displays the spare disks on the filer
vol status -f :
Displays the failed disks on the filer
vol status -r :
Shows the raid configuration, reconstruction information of the disks
df -h : Displays
volume disk usage
df -i : Shows the inode
counts of all the volumes
df -Ah : Shows
"df" information of the aggregate
license :
Displays/add/removes license on a netapp filer
maxfiles : Displays
and adds more inodes to a volume
aggr create :
Creates aggregate
vol create
<volname> <aggrname> <size> : Creates volume in an aggregate
vol offline
<volname> : Offlines a volume
vol online
<volname> : Onlines a volume
vol destroy
<volname> : Destroys and removes an volume
vol size
<volname> [+|-]<size> : Resize a volume in netapp filer
vol options : Displays/Changes
volume options in a netapp filer
qtree create
<qtree-path> : Creates qtree
qtree status :
Displays the status of qtrees
quota on : Enables
quota on a netapp filer
quota off :
Disables quota
quota resize :
Resizes quota
quota report :
Reports the quota and usage
snap list :
Displays all snapshots on a volume
snap create
<volname> <snapname> : Create snapshot
snap sched
<volname> <schedule> : Schedule snapshot creation
snap reserve
<volname> <percentage> : Display/set snapshot reserve space in volume
/etc/exports : File
that manages the NFS exports
rdfile /etc/exports
: Read the NFS exports file
wrfile /etc/exports
: Write to NFS exports file
exportfs -a :
Exports all the filesystems listed in /etc/exports
cifs setup : Setup
cifs
cifs shares : Create/displays
cifs shares
cifs access :
Changes access of cifs shares
lun create :
Creates iscsi or fcp luns on a netapp filer
lun map : Maps lun
to an igroup
lun show : Show all
the luns on a filer
igroup create :
Creates netapp igroup
lun stats : Show lun
I/O statistics
disk show : Shows
all the disk on the filer
disk zero spares :
Zeros the spare disks
disk_fw_update :
Upgrades the disk firmware on all disks
options :
Display/Set options on netapp filer
options nfs :
Display/Set NFS options
options timed :
Display/Set NTP options on netapp.
options autosupport
: Display/Set autosupport options
options cifs :
Display/Set cifs options
options tcp :
Display/Set TCP options
options net :
Display/Set network options
ndmpcopy
<src-path> <dst-path> : Initiates ndmpcopy
ndmpd status :
Displays status of ndmpd
ndmpd killall :
Terminates all the ndmpd processes.
ifconfig :
Displays/Sets IP address on a network/vif interface
vif create :
Creates a VIF (bonding/trunking/teaming)
vif status :
Displays status of a vif
netstat : Displays
network statistics
sysstat -us 1 : begins a 1
second sample of the filer's current utilization (crtl - c to end)
nfsstat : Shows nfs
statistics
nfsstat -l :
Displays nfs stats per client
nfs_hist : Displays
nfs historgram
statit : beings/ends a
performance workload sampling [-b starts / -e ends]
stats : Displays
stats for every counter on netapp. Read stats man page for more info
ifstat : Displays
Network interface stats
qtree stats :
displays I/O stats of qtree
environment : display
environment status on shelves and chassis of the filer
storage show
<disk|shelf|adapter> : Shows storage component details
snapmirror
intialize : Initialize a snapmirror relation
snapmirror update :
Manually Update snapmirror relation
snapmirror resync :
Resyns a broken snapmirror
snapmirror quiesce
: Quiesces a snapmirror bond
snapmirror break :
Breakes a snapmirror relation
snapmirror abort :
Abort a running snapmirror
snapmirror status :
Shows snapmirror status
lock status -h :
Displays locks held by filer
sm_mon : Manage the
locks
storage download
shelf : Installs the shelf firmware
software get :
Download the Netapp OS software
software install :
Installs OS
download : Updates
the installed OS
cf status :
Displays cluster status
cf takeover : Takes
over the cluster partner
cf giveback : Gives
back control to the cluster partner
reboot : Reboots a
filer
Pocket guide for netapp commands
This post contains the list of commands that will be most used
and will come handy when managing or monitoring or troubleshooting a Netapp
filer.
sysconfig -a : shows hardware
configuration with more verbose information
sysconfig -d :
shows information of the disk attached to the filer
version : shows the
netapp Ontap OS version.
uptime : shows the
filer uptime
dns info : this
shows the dns resolvers, the no of hits and misses and other info
nis info : this
shows the nis domain name, yp servers etc.
rdfile : Like
"cat" in Linux, used to read contents of text files/
wrfile :
Creates/Overwrites a file. Similar to "cat > filename" in Linux
aggr status : Shows
the aggregate status
aggr status -r :
Shows the raid configuration, reconstruction information of the disks in filer
aggr show_space :
Shows the disk usage of the aggreate, WAFL reserve, overheads etc.
vol status : Shows
the volume information
vol status -s :
Displays the spare disks on the filer
vol status -f :
Displays the failed disks on the filer
vol status -r :
Shows the raid configuration, reconstruction information of the disks
df -h : Displays
volume disk usage
df -i : Shows the inode
counts of all the volumes
df -Ah : Shows
"df" information of the aggregate
license :
Displays/add/removes license on a netapp filer
maxfiles : Displays
and adds more inodes to a volume
aggr create :
Creates aggregate
vol create
<volname> <aggrname> <size> : Creates volume in an aggregate
vol offline
<volname> : Offlines a volume
vol online
<volname> : Onlines a volume
vol destroy
<volname> : Destroys and removes an volume
vol size
<volname> [+|-]<size> : Resize a volume in netapp filer
vol options : Displays/Changes
volume options in a netapp filer
qtree create
<qtree-path> : Creates qtree
qtree status :
Displays the status of qtrees
quota on : Enables
quota on a netapp filer
quota off :
Disables quota
quota resize :
Resizes quota
quota report :
Reports the quota and usage
snap list :
Displays all snapshots on a volume
snap create
<volname> <snapname> : Create snapshot
snap sched
<volname> <schedule> : Schedule snapshot creation
snap reserve
<volname> <percentage> : Display/set snapshot reserve space in volume
/etc/exports : File
that manages the NFS exports
rdfile /etc/exports
: Read the NFS exports file
wrfile /etc/exports
: Write to NFS exports file
exportfs -a :
Exports all the filesystems listed in /etc/exports
cifs setup : Setup
cifs
cifs shares : Create/displays
cifs shares
cifs access :
Changes access of cifs shares
lun create :
Creates iscsi or fcp luns on a netapp filer
lun map : Maps lun
to an igroup
lun show : Show all
the luns on a filer
igroup create :
Creates netapp igroup
lun stats : Show lun
I/O statistics
disk show : Shows
all the disk on the filer
disk zero spares :
Zeros the spare disks
disk_fw_update :
Upgrades the disk firmware on all disks
options :
Display/Set options on netapp filer
options nfs :
Display/Set NFS options
options timed :
Display/Set NTP options on netapp.
options autosupport
: Display/Set autosupport options
options cifs :
Display/Set cifs options
options tcp :
Display/Set TCP options
options net :
Display/Set network options
ndmpcopy
<src-path> <dst-path> : Initiates ndmpcopy
ndmpd status :
Displays status of ndmpd
ndmpd killall :
Terminates all the ndmpd processes.
ifconfig :
Displays/Sets IP address on a network/vif interface
vif create :
Creates a VIF (bonding/trunking/teaming)
vif status :
Displays status of a vif
netstat : Displays
network statistics
sysstat -us 1 : begins a 1
second sample of the filer's current utilization (crtl - c to end)
nfsstat : Shows nfs
statistics
nfsstat -l :
Displays nfs stats per client
nfs_hist : Displays
nfs historgram
statit : beings/ends a
performance workload sampling [-b starts / -e ends]
stats : Displays
stats for every counter on netapp. Read stats man page for more info
ifstat : Displays
Network interface stats
qtree stats :
displays I/O stats of qtree
environment : display
environment status on shelves and chassis of the filer
storage show
<disk|shelf|adapter> : Shows storage component details
snapmirror
intialize : Initialize a snapmirror relation
snapmirror update :
Manually Update snapmirror relation
snapmirror resync :
Resyns a broken snapmirror
snapmirror quiesce
: Quiesces a snapmirror bond
snapmirror break :
Breakes a snapmirror relation
snapmirror abort :
Abort a running snapmirror
snapmirror status :
Shows snapmirror status
lock status -h :
Displays locks held by filer
sm_mon : Manage the
locks
storage download
shelf : Installs the shelf firmware
software get :
Download the Netapp OS software
software install :
Installs OS
download : Updates
the installed OS
cf status :
Displays cluster status
cf takeover : Takes
over the cluster partner
cf giveback : Gives
back control to the cluster partner
reboot : Reboots a
filer