NetApp ONTAP CLI Cheat Sheet: Essential Storage Commands - 夜莺博客

NetApp ONTAP CLI Cheat Sheet: Essential Storage Commands

NetApp clustered ONTAP (formerly Data ONTAP) manages everything from the CLI, and most daily storage operations - checking hardware, inspecting aggregates, monitoring performance, configuring network interfaces - boil down to a handful of command families. This cheat sheet collects the essential ONTAP commands for storage administrators, from the boot menu to stats collection.

NetApp clustered ONTAP CLI cheat sheet

Boot Menu and Startup Modes

1) Normal Boot
2) Boot without /etc/rc
3) Change password
4) Clean configuration and initialize all disks
5) Maintenance mode boot
6) Update flash from backup config
7) Install new software first
8) Reboot node

Option 4 resets the filer to factory defaults; option 5 enters maintenance mode with a limited command set.

System Information

version -b                    ! software version incl. diagnostic kernels
sysconfig                      ! general system info
sysconfig -v                   ! detailed
sysconfig -c                   ! configuration errors
sysconfig -d                   ! disk devices
sysconfig -V                   ! RAID group information
sysconfig -r                   ! aggregates and plexes
priv set advanced              ! enable advanced commands
systemshell                    ! access the system shell (diag user)

Storage and Disk Commands

storage show disk
storage show shelf
storage show port
storage show fault
storage show initiators
sasstat shelf
sasstat expander
sasstat dev_stats
storage enable adapter
storage disable adapter

Aggregate Management

aggr status
aggr status -s                    ! check for spare disks
aggr create newaggr -r 8 -d 8a.16 8a.17 8a.18 8a.19
aggr create newfastaggr -R 15000 20
aggr create newFCALaggr -T FCAL 15
aggr offline <aggregate>
aggr destroy <aggregate>

Key flags for aggr create: -r RAID group size, -T disk type (ATA/SATA/SAS/BSAS/FCAL/LUN), -R RPM, -m SyncMirror, -n dry run.

Monitoring with stats show

stats show system
stats show processor
stats show disk
stats show volume
stats show lun
stats show aggregate
stats show iscsi
stats show cifs
stats show ifnet

Network Interface Configuration

ifconfig -a
ifconfig e0a netmask 255.255.255.0
ifconfig e8 mtusize 9000
ifconfig e0 alias 192.0.2.30
ifconfig e0 -alias 192.0.2.30
ifconfig e8 flowcontrol full
ifconfig e8 partner <IP Address>     ! HA pair failover IP
route add default 192.168.0.254 1
netstat -rn

Environment and Health

environment status
environment shelf
environment chassis all
environment chassis Temperature
environment chassis Power

Related articles: NetApp ONTAP SnapMirror setup and troubleshooting, FC vs iSCSI SAN comparison, and Brocade SAN switch CLI commands.

原文链接:https://www.quickstart.com/blog/netapp/netapp-clustered-ontap-cli-cheat-sheet/