CARVIEW |

- accept
- accton
- acpid
- addftinfo
- addpart
- addr2line
- adduser
- agetty
- alias
- alternatives
- amtu
- anacron
- animate
- anvil
- apachectl
- apm
- apmd
- apmsleep
- appletviewer
- apropos
- apt
- ar
- arbitron
- arch
- arp
- arping
- as
- aspell
- at
- atd
- atq
- atrm
- atrun
- attr
- audispd
- auditctl
- auditd
- aulast
- aulastlog
- aureport
- ausearch
- ausyscall
- authconfig
- autoconf
- autofs
- automount
- autoreconf
- autoscan
- autoupdate
- autrace
- avcstat
- avctrl
- awk
- B
- badblocks
- base64
- basename
- bash
- bashbug
- batch
- bc
- bccmd
- bg
- bind
- bison
- blkid
- blockdev
- bmp2tiff
- booleans
- bounce
- break
- builtin
- builtins
- bunzip2
- bzcat
- bzcmp
- bzdiff
- bzgrep
- bzip2
- bzless
- bzmore
- C
- c++filt
- cal
- callback
- cancel
- case
- cat
- cd
- chage
- chat
- chattr
- chcat
- chcon
- checkmodule
- checkpolicy
- chfn
- chgrp
- chkconfig
- chmod
- chown
- chpasswd
- chroot
- chrt
- chsh
- chvt
- ciphers
- ciptool
- cjpeg
- cksum
- cleanlinks
- cleanup
- clear
- clockdiff
- clusterdb
- cmp
- col
- colcrt
- colrm
- column
- combinediff
- comm
- command
- compare
- compgen
- compile_et
- complete
- composite
- conjure
- conman
- conmand
- continue
- convert
- convertquota
- cp
- cpan
- cpio
- cpp
- cpuspeed
- crash
- createdb
- createlang
- createuser
- cron
- crond
- crontab
- cryptsetup
- csh
- csplit
- ctags
- cupsctl
- cupsd
- curl
- cut
- cvs
- cvsbug
- cyradm
- cytune
- D
- date
- dc
- dd
- deallocvt
- debugfs
- declare
- defer
- deliver
- delpart
- depmod
- df
- dfutool
- dgst
- diff
- diffstat
- dig
- dir
- dircolors
- dirname
- dirs
- discard
- disown
- display
- distcache
- djpeg
- dmesg
- dmidecode
- dmraid
- dmsetup
- dnsdomainname
- dnsmasq
- doexec
- domainname
- dos2unix
- dosfsck
- doxygen
- doxytag
- dprofpp
- dropdb
- droplang
- dropuser
- dsa
- dsaparam
- du
- dump
- dund
- dvipdf
- E
- ec
- echo
- ecparam
- ed
- editdiff
- edquota
- egrep
- eject
- elinks
- emacs
- enable
- enc
- env
- envsubst
- eqn
- error
- errstr
- esd
- esdcat
- esdctl
- esddsp
- esdfilt
- esdloop
- esdmon
- esdplay
- esdrec
- esdsample
- espdiff
- etags
- ethtool
- eval
- eventlogadm
- ex
- exec
- execstack
- exit
- expand
- export
- exportfs
- expr
- extcheck
- F
- factor
- faillog
- false
- fancontrol
- fastjar
- fax2ps
- fax2tiff
- fbset
- fc
- fdformat
- fdisk
- fetchmail
- fg
- fgconsole
- fgrep
- file
- filefrag
- filterdiff
- find
- find2perl
- findchip
- findfs
- findsmb
- finger
- fixcvsdiff
- fixfiles
- flipdiff
- flock
- floppy
- flush
- fmt
- fold
- font2c
- fonttosfnt
- formail
- free
- fsadm
- fsck
- ftp
- fud
- funzip
- fuser
- G
- g++
- gawk
- gcc
- gccmakedep
- gcj
- gcjh
- gcov
- gctags
- gdb
- gdbserver
- gdbtui
- gendiff
- gendsa
- genhomedircon
- genhostid
- genrsa
- geqn
- getenforce
- getent
- getfacl
- getfattr
- getkey
- getkeycodes
- getopt
- getopts
- getsebool
- gettext
- gfdl
- ghostscript
- gif2tiff
- gij
- gindxbib
- gjnih
- glookbib
- gnroff
- gpasswd
- gpg
- gpg.ru
- gpgv
- gpic
- gpm
- gprof
- grefer
- grep
- grepdiff
- grepjar
- grmic
- grmiregistry
- grn
- grodvi
- groff
- groffer
- grohtml
- grolbp
- grolj4
- grops
- grotty
- groupadd
- groupdel
- groupmod
- groups
- grpck
- grpconv
- grpunconv
- grub
- grubby
- gs
- gtroff
- gunzip
- gzexe
- gzip
- H
- hald
- halt
- hash
- hcid
- hcitool
- hdparm
- head
- help
- hexdump
- history
- host
- hostid
- hostname
- htdbm
- htdigest
- htpasswd
- httpd
- hwclock
- I
- icclink
- iconv
- id
- identify
- idmapd
- ifconfig
- ifnames
- ifrename
- igawk
- imake
- imapd
- import
- imtest
- indxbib
- info
- infocmp
- infokey
- infotocap
- init
- initdb
- initlog
- innochecksum
- insmod
- install
- installsieve
- instmodsh
- interdiff
- intro
- ionice
- ip
- ip6tables
- ipcalc
- ipcclean
- ipcrm
- ipcs
- iptables-restore
- iptables-save
- iptables
- iptstate
- ipurge
- irattach
- irdadump
- irdaping
- irnetd
- irpsion5
- irqbalance
- isadump
- isaset
- isosize
- J
- jade
- jarsigner
- java
- javac
- javadoc
- javah
- javap
- javaws
- jconsole
- jdb
- jinfo
- jmap
- jobs
- join
- jpegicc
- jpegtran
- jps
- jsadebugd
- jstack
- jstat
- jstatd
- jwhois
- L
- last
- lastb
- lastcomm
- lastlog
- lchage
- lchfn
- lchsh
- ld
- ldconfig
- ldd
- less
- lessecho
- lesskey
- let
- lftp
- lftpget
- libnetcfg
- lid
- link
- links
- lkbib
- lmtp
- lmtpd
- lmtptest
- ln
- lndir
- lnewusers
- loadkeys
- loadunimap
- local
- locale
- localedef
- locate
- lockd
- lockfile
- logger
- login
- logname
- logout
- logresolve
- logrotate
- logsave
- logwatch
- look
- lookbib
- losetup
- lp
- lpadmin
- lpasswd
- lpc
- lpinfo
- lpmove
- lpoptions
- lppasswd
- lpq-cups
- lpq
- lpr
- lprm
- lpstat
- ls
- lsattr
- lsdiff
- lshal
- lsmod
- lsof
- lspci
- lspcmcia
- lsusb
- ltrace
- lwresd
- M
- m4
- mac2unix
- mailq
- make
- makedepend
- makeg
- makestrs
- makewhatis
- man
- man2html
- manpath
- map
- mapscrn
- master
- matchpathcon
- mattrib
- mbadblocks
- mbchk
- mbexamine
- mbpath
- mcat
- mcd
- mclasserase
- mcookie
- mcopy
- md5sum
- mdadm
- mdassemble
- mdeltree
- mdir
- mdmpd
- mdu
- mergelib
- mesg
- mev
- mformat
- mgetty
- minfo
- mingetty
- mkbootdisk
- mkdir
- mkdirhier
- mkdosfs
- mke2fs
- mkfifo
- mkfontdir
- mkfontscale
- mkfs.ext2
- mkfs.ext3
- mkfs
- mkhtmlindex
- mkinitrd
- mklost+found
- mkmanifest
- mkmapfile
- mknod
- mkswap
- mktemp
- mlabel
- mmd
- mmount
- mmove
- modinfo
- modprobe
- mogrify
- montage
- more
- mount
- mountd
- mountpoint
- mpartition
- mrd
- mren
- msgattrib
- msgcat
- msgcmp
- msgcomm
- msgconv
- msgen
- msgexec
- msgfilter
- msgfmt
- msggrep
- msginit
- msgmerge
- msgunfmt
- msguniq
- mshowfat
- msql2mysql
- mtools
- mtoolstest
- mtr
- mtype
- multipath
- multipathd
- mupdatetest
- mutt
- mv
- mysql
- mysqlaccess
- mysqladmin
- mysqlbinlog
- mysqlbug
- mysqlcheck
- mysqld
- mysqld_multi
- mysqld_safe
- mysqldump
- mysqldumpslow
- mysqlhotcopy
- mysqlimport
- mysqlman
- mysqlmanager
- mysqlshow
- mysqlslap
- mysqltest
- mzip
- N
- named
- namei
- nameif
- nano
- nash
- nc
- neqn
- net
- netplugd
- netreport
- netstat
- newaliases
- newgrp
- newusers
- nfsd
- nfsstat
- ngettext
- nhfsgraph
- nhfsnums
- nhfsrun
- nhfsstone
- nice
- nm
- nmbd
- nmblookup
- nntpd
- nntptest
- nohup
- nologin
- notifyd
- nroff
- nscd
- nseq
- nsgmls
- nslookup
- nsupdate
- ntlm_auth
- ntpd
- ntpdate
- ntpdc
- ntpq
- ntpstat
- ntptime
- ntptrace
- ntsysv
- numactl
- O
- objcopy
- objdump
- ocsp
- od
- oddjobd
- onsgmls
- openjade
- openssl
- openvt
- oqmgr
- orbd
- osgmlnorm
- ospam
- ospcat
- ospent
- ownership
- P
- pand
- paps
- parted
- partprobe
- partx
- passwd
- paste
- patch
- pathchk
- pax
- pccardctl
- pcregrep
- pcretest
- pcscd
- pdbedit
- pdf2dsc
- pdf2ps
- pdffonts
- pdfimages
- pdfinfo
- pdfopt
- pdftohtml
- pdftops
- pdftotext
- perror
- pf2afm
- pfbtopfa
- pfbtops
- pftp
- pgawk
- pgrep
- php-config
- php
- phpize
- pic
- pic2graph
- pickup
- piconv
- pidof
- pinfo
- ping
- ping6
- pinky
- pipe
- pkg-config
- pkill
- plipconfig
- pluginviewer
- pman
- pmap
- pod2html
- pod2latex
- pod2man
- pod2text
- pod2usage
- podchecker
- podselect
- policytool
- pop3d
- pop3test
- popd
- portmap
- postalias
- postcat
- postconf
- postdrop
- postfix
- postgres
- postkick
- postlock
- postlog
- postmap
- postmaster
- postqueue
- postsuper
- poweroff
- ppm2tiff
- pppd
- pppdump
- pppoe
- pppstats
- pr
- prelink
- printafm
- printenv
- printf
- procmail
- profiles
- protoize
- prove
- proxymap
- ps
- psed
- psql
- pstack
- pstree
- pstruct
- ptar
- ptardiff
- ptx
- pushd
- pvchange
- pvck
- pvcreate
- pvdisplay
- pvmove
- pvremove
- pvresize
- pvs
- pvscan
- pwck
- pwconv
- pwd
- pwdx
- pwmconfig
- pwunconv
- python
- R
- racoon
- racoonctl
- ramsize
- ranlib
- ras2tiff
- raw
- raw2tiff
- rawdevices
- rcp
- rdate
- rdev
- rdisc
- rdist
- rdjpgcom
- rdump
- read
- readelf
- readlink
- readonly
- readprofile
- reboot
- reconstruct
- recountdiff
- red
- rediff
- refer
- reindexdb
- reject
- rename
- renice
- replace
- repquota
- req
- reset
- resize2fs
- resizecons
- resolveip
- restore
- restorecon
- restorecond
- return
- rev
- revpath
- rexec
- rfcomm
- rgb2ycbcr
- rlogin
- rm
- rmdir
- rmid
- rmmod
- rmnews
- rmt
- rnano
- rootflags
- rotatelogs
- route
- rpcclient
- rpcdebug
- rpcgen
- rpcinfo
- rsa
- rsautl
- rsh
- rsvg
- rsync
- ruby
- runcon
- runlevel
- runuser
- rvi
- rview
- rvim
- S
- safe_mysqld
- saslauthd
- scache
- scp
- script
- sdiff
- sdpd
- sdptool
- sechecker
- secon
- sed
- sediff
- seinfo
- selinux
- selinuxenabled
- semanage
- sensors
- seq
- serialver
- servertool
- service
- sesearch
- sestatus
- set
- setarch
- setenforce
- setfacl
- setfattr
- setfiles
- setfont
- setkey
- setkeycodes
- setleds
- setmetamode
- setpci
- setquota
- setsebool
- setserial
- setsid
- setterm
- sfdisk
- sftp
- sg
- sgpio
- sh
- sha
- shift
- shopt
- showkey
- showmount
- showq
- shred
- shutdown
- sieveshell
- sivtest
- size
- skill
- slabtop
- slattach
- sleep
- sln
- slogin
- smartctl
- smartd
- smbcacls
- smbclient
- smbcontrol
- smbcquotas
- smbd
- smbget
- smbpasswd
- smbspool
- smbstatus
- smbtar
- smbtree
- smime
- smmapd
- smtp
- smtpd
- smtptest
- snice
- snmpd
- snmptrapd
- sntp
- soelim
- sort
- sosreport
- source
- spam
- spamassassin
- spamc
- spamd
- spawn
- speed
- spent
- spkac
- splain
- split
- splitdiff
- sprofa>
- sqlite3
- squatter
- ssh-add
- ssh-agent
- ssh-copy-id
- ssh-keygen
- ssh-keyscan
- ssh-keysign
- ssh
- sshd
- sslpasswd
- sslrand
- sslswamp
- stat
- statd
- strace
- strings
- strip
- stty
- stunnel
- su
- sudo
- sudoedit
- suexec
- sulogin
- sum
- suspend
- svcgssd
- swapoff
- swapon
- symlinks
- sync
- sysctl
- sysklogd
- syslogd
- systool
- T
- tac
- tack
- tail
- tailf
- talk
- tar
- taskset
- tbl
- tclsh
- tcpd
- tcpdump
- tcpslice
- tcsh
- tdbbackup
- tdbdump
- tdbtool
- tee
- telinit
- telnet
- test
- testparm
- tfmtodit
- tftp
- thumbnail
- tic
- tiff2bw
- tiff2pdf
- tiff2ps
- tiff2rgba
- tiffcmp
- tiffcp
- tiffdither
- tiffdump
- tifficc
- tiffinfo
- tiffmedian
- tiffset
- tiffsplit
- time
- times
- timsieved
- tload
- tls_prune
- tlsmgr
- tmpwatch
- tnameserv
- toe
- top
- touch
- tput
- tr
- trace
- tracepath
- traceroute
- trap
- tree
- troff
- TRUE
- tset
- tsort
- tty
- tune2fs
- tunelp
- type
- typeset
- tzselect
- U
- ucs2any
- udevcontrol
- udevd
- udevinfo
- udevmonitor
- udevsettle
- udevtest
- udevtrigger
- ul
- ulimit
- umap
- umask
- umount
- unalias
- uname
- unexpand
- unexpunge
- uniq
- unix2dos
- unlink
- unprotoize
- unset
- unwrapdiff
- unzip
- unzipsfx
- updatedb
- uptime
- urlview
- useradd
- userdel
- userhelper
- userinfo
- usermod
- usermount
- usernetctl
- userpasswd
- users
- usleep
- uuidgen
- V
- vacuumdb
- vbetool
- vconfig
- vdir
- verify
- version
- vfstest
- vi
- vidmode
- view
- vigr
- vim
- vimdiff
- vimtutor
- vipw
- virtual
- visudo
- vmstat
- vol_id
- volname
- vpddecode
- vsftpd
smartctl Command in Linux
The smartctl command is a powerful tool that comes with the smartmontools package, designed to interact with and manage the Self-Monitoring, Analysis, and Reporting Technology (SMART) system of your hard drives and solid-state drives.
SMART technology enables drives to monitor their own health, predict potential failures, and report any problems. Let's dive into the detailed explanation of the smartctl command along with various examples.
Table of Contents
Here is a comprehensive guide to the options available with the smartctl command −
- Understanding the smartctl Command
- Syntax of smartctl Command
- smartctl Command Options
- Examples of smartctl Command in Linux
Understanding the smartctl Command
Before using the smartctl command, you need to install the smartmontools package. The installation commands vary depending on your Linux distribution −
Debian / Ubuntu −
sudo apt-get install smartmontools
Red Hat / Fedora −
sudo yum install smartmontools
Arch Linux −
sudo pacman -S smartmontools
OpenSUSE −
sudo zypper install smartmontools
Syntax of smartctl Command
The basic syntax of the smartctl command is as follows −
sudo smartctl [options] [device]
Here, [options] refers to the various command-line options you can use with smartctl, and [device] refers to the specific storage device you want to interact with (e.g., /dev/sda).
smartctl Command Options
Let's explore some commonly used options with smartctl −
Check Overall Health Status
sudo smartctl -H /dev/sda

This command checks and reports the overall health status of the specified device. It returns "PASSED" if the device is healthy.
Retrieve Detailed SMART Information
sudo smartctl -a /dev/sda

This command retrieves and displays detailed SMART information, including health status, SMART attributes, error logs, and more.
Enable SMART on a Device
sudo smartctl -s on /dev/sda

This command enables SMART monitoring and data collection on the specified device.
Disable SMART on a Device
sudo smartctl -s off /dev/sda

This command disables SMART monitoring and data collection on the specified device.
Display SMART Capabilities
sudo smartctl -c /dev/sda

This command displays the SMART capabilities and settings of the specified device.
Run a Short Self-Test
sudo smartctl -t short /dev/sda

This command initiates a short self-test on the specified device. Short self-tests typically take a few minutes to complete.
Run a Long Self-Test
sudo smartctl -t long /dev/sda

This command initiates a long self-test on the specified device. Long self-tests can take several hours to complete.
Display Self-Test Results
sudo smartctl -l selftest /dev/sda

This command displays the results of previously run self-tests on the specified device.
Examples of smartctl Command in Linux
- Checking Overall Health Status
- Enabling SMART on a Device
- Retrieving Detailed SMART Information
- Running a Short Self-Test
- Running a Long Self-Test
- Displaying Self-Test Results
- Displaying SMART Attributes
- Displaying Error Logs
- Checking SMART Capabilities
- Displaying Device Information
- Saving SMART Data to a File
Checking Overall Health Status
To check the overall health status of the device /dev/sda, you can use the -H option −
sudo smartctl -H /dev/sda

This command will output a health status message, such as "PASSED" if the device is healthy or "FAILED" if there are issues. This is a quick way to determine the general condition of your drive.
Enabling SMART on a Device
Before you can use other smartctl commands, you need to ensure that SMART is enabled on the device. You can enable SMART using the -s on option −
sudo smartctl -s on /dev/sda

This command enables SMART monitoring and data collection, allowing you to access detailed health information and perform tests on the device.
Retrieving Detailed SMART Information
To get a comprehensive view of the SMART data for a device, you can use the -a option −
sudo smartctl -a /dev/sda
This command provides detailed information about the device, including −
- Overall health status
- SMART attributes (e.g., read error rate, temperature)
- Error logs
- Self-test logs
The output can help you diagnose and monitor the health of your drive.
Running a Short Self-Test
A short self-test is a quick diagnostic test that checks for issues without performing an exhaustive scan. You can initiate a short self-test using the -t short option −
sudo smartctl -t short /dev/sda

This command starts a short self-test, which typically completes in a few minutes. You can monitor the progress and results using the -a option −
sudo smartctl -a /dev/sda

Look for the "Self-test execution status" section in the output to see the test progress and results.
Running a Long Self-Test
A long self-test performs a thorough scan of the entire device, checking for potential issues. You can start a long self-test using the -t long option −
sudo smartctl -t long /dev/sda

Long self-tests can take several hours to complete, depending on the size and speed of the drive. You can monitor the progress and results using the -a option −
sudo smartctl -a /dev/sda

Look for the "Self-test execution status" section in the output to see the test progress and results.
Displaying Self-Test Results
To view the results of previously run self-tests, you can use the -l selftest option −
sudo smartctl -l selftest /dev/sda

This command displays a log of self-tests, including the test type, status, and any errors detected during the tests. Reviewing self-test logs can help you identify recurring issues and track the health of your drive over time.
Displaying SMART Attributes
SMART attributes are key metrics that provide insight into the health and performance of your drive. To display SMART attributes, you can use the -A option −
sudo smartctl -A /dev/sda

This command outputs a table of SMART attributes, including −
- ID − Attribute ID number
- ATTRIBUTE_NAME − Name of the attribute
- VALUE − Current normalized value
- WORST − Worst normalized value recorded
- THRESH − Threshold value
- TYPE − Attribute type (e.g., Pre-fail, Old_age)
- UPDATED − Frequency of attribute updates
- WHEN_FAILED − Status indicating if the attribute has failed
- RAW_VALUE − Raw data value
Each SMART attribute provides valuable information about the drive's health. For example, the "Reallocated_Sector_Ct" attribute indicates the number of bad sectors that have been reallocated.
Displaying Error Logs
Error logs contain records of errors encountered by the drive. To display error logs, you can use the -l error option −
sudo smartctl -l error /dev/sda
This command outputs a list of recent errors, including details about each error such as the error number, time, and description. Analyzing error logs can help you identify and troubleshoot issues with your drive.
Checking SMART Capabilities
To check the SMART capabilities and settings of a device, you can use the -c option −
sudo smartctl -c /dev/sda
Understanding the SMART capabilities of your drive can help you make informed decisions about monitoring and maintenance.
Displaying Device Information
To display detailed information about the device, including model number, serial number, and firmware version, you can use the -i option −
sudo smartctl -i /dev/sda
This command outputs device identification information, which can be useful for inventory and documentation purposes.
Saving SMART Data to a File
To save the SMART data to a file for later analysis, you can use the -x option along with redirection −
sudo smartctl -x /dev/sda > smart_data.txt
This command saves the detailed SMART data to the smart_data.txt file, allowing you to review and analyze it later.
Conclusion
The smartctl command allows you to retrieve detailed information about your drives, perform tests, and configure SMART features. It provides information about the device's SMART support, including: whether SMART is supported and enabled, available SMART features (e.g., self-tests, error logging), threshold values for various attributes