Новый выделенный сервер: приемка и проверка
Содержание:
- Введение
- How to reproduce
- Navigation menu
- Sample smartctl output
- Related Links
- S.M.A.R.T. daemon
- Ставим Zabbix
- WWW
- Выводы
- Git in Sky
- DARWIN
- Installation of Smartmontools
- Test procedure with smartctl
- Distribution
- Update the drive database
- Install precompiled package
- Утилита smartctl
- Грузимся с флешки, работаем из памяти
Введение
В конце 2012 года у меня на проекте не хватало JS-программеров для изучения Node.js. И я решил восполнить пробел самостоятельно. Изучил фреймворк, написал «Hello world» и даже немножко больше, ведь на Node.js основан яндексовский инструментарий для работы по методологии БЭМ, который мы захотели использовать в том проекте. А когда что-то берешь для своего проекта, это почти всегда нужно патчить… Но речь пойдет о другом.
Посмотрев, кто основной спонсор развития Node.js, я узнал, что это компания Joyent, которая в том числе развивает проект SmartOS — облачной операционной системы. Сначала я подумал, что SmartOS — это какая-то специальная ОС, модифицированный линукс, под которой особенно хорошо живет Node.js. Но когда я почитал побольше, меня постиг культурный шок!
Оказалось, что SmartOS — это потомок ОС OpenSolaris, которая была похоронена компанией Oracle, купившей Sun Microsystems в 2010 году… Надо отметить, что я с девяностых годов был поклонником Sun. Еще до появления линухов весь роутинг в моей компании, которая продавала dial-up доступ в интернет, крутился на FreeBSD. А мечтой был какой-нибудь SparcStation под Solaris8. Тогда эти системы были несомненными лидерами на коммерческом рынке серверов и серверных ОС. И надо сказать, не зря. Система действительно была надежная, а инженеры в Sun работали одни из лучших в мире.
Когда в 2005-м Sun открыла код Solaris, я подумал, что наконец в мире может появиться что-то мощное, альтернативное линуксу. Я даже заказал на Амазоне книжку OpenSolaris Bible (зачем? Ведь есть интернет).
Но в силу организационных причин и невозможности преодолеть коммерческие лицензионные ограничения, к которым все привыкли, система развивалась плохо. И в конце концов Oracle ее закрыла. Я тогда подумал: жаль, опять в мире исчезло что-то хорошее.
Теперь вы поймете мои чувства, когда спустя более чем два года после закрытия OpenSolaris я узнал, что достаточно крупная фирма развивает этот код. Она наняла для этого бывших инженеров Sun, хоть и не всех. А такие технологии, как ZFS и DTrace, продолжают развиваться, в том числе их создателями, которые работают уже в не Oracle, а в других компаниях. Для меня это было сравнимо с радостью, которую испытываешь при возрождении из пепла чего-то хорошего и прекрасного!
Я погрузился в чтение про SmartOS и стал играться с ней.
Другие статьи в выпуске:
How to reproduce
Tested on an Intel based system with P35 chipset under Linux (grml 2010.04 Live CD) with NCQ and disk write cache enabled.
# uname -a Linux grml.somewhere 2.6.33-grml #1 SMP PREEMPT Fri Apr 2 10:16:25 UTC 2010 i686 GNU/Linux # smartctl -i -q noserial /dev/sda smartctl 5.40 2010-10-16 r3189 (local build) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Device Model: SAMSUNG HD204UI Firmware Version: 1AQ10001 User Capacity: 2,000,398,934,016 bytes ... # cat /sys/block/sda/device/queue_depth 31 # hdparm -W /dev/sda /dev/sda: write-caching = 1 (on)
First run one of these commands in another terminal window:
# watch -n 1 smartctl -i /dev/sda
or:
# watch -n 1 hdparm -I /dev/sda
With the above command running concurrently the problem can be reproduced as follows:
# dd if=/dev/zero of=/dev/sda count=1000000 1000000+0 records in 1000000+0 records out 512000000 bytes (512 MB) copied, 12.7394 s, 40.2 MB/s # badblocks -vw -b 512 -t 0x55 /dev/sda 1000000 Checking for bad blocks in read-write mode From block 0 to 1000000 Testing with pattern 0x55: done Reading and comparing: 36608 ... 36671 107200 ... 107263 169984 ... 170047 245824 ... 245887 321216 ... 343615 606336 ... 606399 875520 ... 875583 done Pass completed, 256 bad blocks found. # od -A x -x -N 100000b /dev/sda 000000 5555 5555 5555 5555 5555 5555 5555 5555 * 1180000 0000 0000 0000 0000 0000 0000 0000 0000 * 1188000 5555 5555 5555 5555 5555 5555 5555 5555 * a7c0000 0000 0000 0000 0000 0000 0000 0000 0000 * a7c8000 5555 5555 5555 5555 5555 5555 5555 5555 * 12810000 0000 0000 0000 0000 0000 0000 0000 0000 * 12818000 5555 5555 5555 5555 5555 5555 5555 5555 * 1ab80000 0000 0000 0000 0000 0000 0000 0000 0000 * 1ab88000 5555 5555 5555 5555 5555 5555 5555 5555 * 1e848000
The above suggests that the disk sometimes discards a pending 64 sector write command when a IDENTIFY DEVICE command is received. This data loss occurs silently. There is no error message in kernel log, SMART Error log, NCQ Command Error log page, or SATA Phy Event Counters log page.
Please note that the command reported «» in the above test because the data read differs from the data written before. None of the tests resulted in actual bad (unreadable) blocks on the disk. Testing did not damage the disk itself. The problem is that new data already sent to the disk may not be written. Previously written data is not affected.
The problem could not be reproduced with the above test if any of the following conditions are met:
Disk write cache is disabled.
NCQ is disabled. This may not always be true as the c’t lab also reported problems with NCQ disabled.
A modified test version of smartctl which does not issue IDENTIFY DEVICE commands is used. Then all other SMART and non-SMART commands used by smartctl work without any data loss.
The disk is replaced by another model (tested with Samsung HE103UJ and Seagate ST31000524NS).
2010-11-30, Christian Franke.
2010-12-09, Christian Franke.
Our experts are sharingtheir knowledge with you.
Categories
▼ Server Hardware
► Hard Disk Drives
no subcategories
► HBAs
no subcategories
► Intel
no subcategories
▼ Modular Server
► Modular Server Ethernet Switch
no subcategories
▼ Motherboards
► BIOS Settings
no subcategories
▼ RAID Controllers
► 3ware
no subcategories
▼ Adaptec
► Adaptec SmartRAID
no subcategories
► LSI
no subcategories
▼ Server
► Backplanes
no subcategories
► LES
no subcategories
▼ SSDs
► Intel SSDs
no subcategories
▼ Server Software
▼ Linux
► Debian
no subcategories
► Linux Basics
no subcategories
► Linux Networking
no subcategories
▼ Linux Performance
► Fio
no subcategories
► TKperf
no subcategories
► Linux Software RAID
no subcategories
▼ Linux-Storage
► LVM
no subcategories
► Smartmontools
no subcategories
► Ubuntu
no subcategories
▼ Windows
► Windows Server 2012
no subcategories
► Windows Server 2016
no subcategories
► Windows Server 2019
no subcategories
▼ Storage
► FreeNAS
no subcategories
▼ Virtualization
► Hyper-V
no subcategories
► Proxmox
no subcategories
► VirtualBox
no subcategories
▼ VMware
▼ VMware
▼ VMware
► VMware
► VMware vSphere 5
► VMware vSphere 5.1
► VMware vSphere 5.5
► VMware vSphere 6.0
► VMware vSphere 6.5
► VMware vSphere 6.7
► VMware vSphere 5
no subcategories
► VMware vSphere 5.1
no subcategories
► VMware vSphere 5.5
no subcategories
► VMware vSphere 6.0
no subcategories
► VMware vSphere 6.5
no subcategories
► VMware vSphere 6.7
no subcategories
► VMware vSphere 5
no subcategories
► VMware vSphere 5.1
no subcategories
► VMware vSphere 5.5
no subcategories
► VMware vSphere 6.0
no subcategories
► VMware vSphere 6.5
no subcategories
► VMware vSphere 6.7
no subcategories
▼ Focus Topics
► Git
no subcategories
► UEFI
no subcategories
▼ Network+Accessories
► Load Balancer
no subcategories
► Monitoring
no subcategories
▼ OPNsense
► OPNsense Business Edition
no subcategories
▼ Remote Management
► IPMI
no subcategories
► TKmon
no subcategories
▼ Archive
► AMD
no subcategories
► Areca
no subcategories
► Fusion-io
no subcategories
► News
no subcategories
► Server Hardware Archive
no subcategories
► STEC
no subcategories
Sample smartctl output
Sample output:
smartctl 6.5 2016-04-27 r4312 (daily-20160427) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Number: Samsung SSD 950 PRO 256GB Serial Number: ... Firmware Version: 1B0QBXX7 PCI Vendor/Subsystem ID: 0x144d IEEE OUI Identifier: 0x002538 Controller ID: 1 Number of Namespaces: 1 Namespace 1 Size/Capacity: 256,060,514,304 Namespace 1 Utilization: 117,410,267,136 Namespace 1 Formatted LBA Size: 512 Local Time is: Thu Apr 28 19:32:07 2016 CEST Firmware Updates (0x06): 3 Slots Optional Admin Commands (0x0007): Security Format Frmw_DL Optional NVM Commands (0x001f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Maximum Data Transfer Size: 32 Pages Supported Power States St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat 0 + 6.50W - - 0 0 0 0 5 5 1 + 5.80W - - 1 1 1 1 30 30 2 + 3.60W - - 2 2 2 2 100 100 3 - 0.0700W - - 3 3 3 3 500 5000 4 - 0.0050W - - 4 4 4 4 2000 22000 Supported LBA Sizes (NSID 0x1) Id Fmt Data Metadt Rel_Perf 0 + 512 0 0 === START OF SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff) Critical Warning: 0x00 Temperature: 40 Celsius Available Spare: 100% Available Spare Threshold: 10% Percentage Used: 0% Data Units Read: 1,769,281 Data Units Written: 1,384,224 Host Read Commands: 24,646,213 Host Write Commands: 19,105,374 Controller Busy Time: 38 Power Cycles: 32 Power On Hours: 129 Unsafe Shutdowns: 6 Media and Data Integrity Errors: 0 Error Information Log Entries: 44 Error Information (NVMe Log 0x01, max 64 entries) Num ErrCount SQId CmdId Status PELoc LBA NSID VS 0 44 0 0x002a 0x4016 0x000 0 255 - 1 43 0 0x0029 0x4016 0x000 0 255 - 2 42 0 0x0049 0x4016 0x000 0 255 - 3 41 0 0x0048 0x4016 0x000 0 255 - 4 40 0 0x001f 0x4004 0x000 0 0 - 5 39 0 0x001e 0x4004 0x000 0 0 - 6 38 0 0x001f 0x4004 0x000 0 0 - 7 37 0 0x001e 0x4004 0x000 0 0 - 8 36 0 0x001f 0x4004 0x000 0 0 - 9 35 0 0x001e 0x4004 0x000 0 0 - 10 34 0 0x001d 0x4004 0x000 0 0 - 11 33 0 0x001c 0x4004 0x000 0 0 - 12 32 0 0x001d 0x4004 0x000 0 0 - 13 31 0 0x001c 0x4004 0x000 0 0 - 14 30 0 0x001d 0x4004 0x000 0 0 - 15 29 0 0x001c 0x4004 0x000 0 0 - ... (28 entries not shown)
Related Links
Samsung HD204UI 2TB Error (D-Link Forum)Strange badblocks / possible firmware bug on Samsung F4 (Gentoo Forum)New drive badblocks (Hard|Forum)Samsung 2TB green drives defective firmware? (Hard|Forum)Potential Samsung F4 issues (Lime Technology Forum)Final Word on the Samsung HD204UI (Lime Technology Forum)WARNING: Samsung F4 owners / warning. Disable smartmontools (MythTV Mailing List)Samsung Spinpoint F4EG HD204UI 2TB compatibility? (Synology Forum)Data loss with Samsung 204UI and Smartmontools (Synology Forum)
SMART-Tool beschädigt Daten auf Samsung-Festplatte (Heise Online News, German)Firmware-Patch für Samsung-Festplatte EcoGreen F4 HD204UI (Heise Online News, German)
If you have additional info, please report it to the smartmontools-support mailing list.
S.M.A.R.T. daemon
smartd is a daemon that continuously monitors the S.M.A.R.T. information of drives. It can be configured via /etc/smartd.conf. See man smartd.conf for more information. smartd will log any errors to /var/log/messages.
FILE
/dev/disk/by-id/ata-ST3000DM001-000000_00000000 -m alerts@example.com -M test -H -l error -l selftest -f -s L/../../5/03 /dev/disk/by-id/ata-ST3000DM001-111111_11111111 -m alerts@example.com -M test -H -l error -l selftest -f -s L/../../5/03 /dev/disk/by-id/ata-WDC_WD20EARS-00MVWB0_WD-000000000000 -m alerts@example.com -M test -H -l error -l selftest -f -s L/../../5/03 /dev/disk/by-id/ata-WDC_WD20EARS-00MVWB0_WD-111111111111 -m alerts@example.com -M test -H -l error -l selftest -f -s L/../../5/03
FILE
# Add a net dependency for the smartd service rc_need="net"
To start smartd:
To start smartd at boot:
Ставим Zabbix
Конечно, если у тебя стоят виртуальные серверы и что-то делают, имеет смысл запустить на них мониторинг. Один из самых популярных пакетов мониторинга Zabbix прекрасно ставится на SmartOS. Качаем последнюю версию Zabbix в /opt/local/src:
Теперь надо скомпилировать исходники. Не забудь поставить GCC, если он еще у тебя не поставлен:
Затем нужно сконфигурировать пакет. Ты можешь сконфигурировать сервер и агент одновременно, а можешь скомпилировать только сервер или только агент. Выбор за тобой. Мы компилировали и то и другое.
Если не было ошибок, копируем скомпилированные бинарники в место их назначения:
Надеюсь, компиляция прошла успешно и ты можешь приступить к конфигурационным сайтам Zabbix (обратись к сайту Zabbix, если необходимо).
- Создай пользователя и группу:
-
Создай базу данных и загрузи схему (мы использовали MySQL, если ты используешь другую СУБД, обратись к Zabbix site):
- Отредактируй конфигурационные файлы. Мы предполагаем, что агент и сервер Zabbix находятся на одной виртуалке. Если это так, то конфигурация будет следующей. Содержание файла /opt/local/etc/zabbix_agentd.conf:LogFile=/var/log/zabbix/agentd.log Server=127.0.0.1 ServerActive=127.0.0.1
Оставь остальные параметры по умолчанию. А содержание /opt/local/etc/zabbix_server.conf будет таким:
Остальные параметры также оставь по умолчанию.
-
Стартуем демоны:
Переменные окружения LDLIBRARYPATH необходимы либо здесь, либо при компиляции (последнее предпочтительнее, конечно). Я компилировал без них, поэтому моя инсталляция не распознает библиотеку iconv, которая находится в папке /opt/local/lib. Вот почему я использую переменные окружения.
-
Теперь пришло время скопировать файлы интерфейса Zabbix (.php) в папку документов твоего веб-сервера:
Если твой веб-сервер был настроен на использование PHP и его document_root смотрит в папку htdocs, то ты можешь продолжить установку из браузера, введя в адресной строке http://<адрес твоего сервера>/zabbix. Дальнейшие инструкции можешь взять на сайте Zabbix.
Настройка через веб-интерфейс достаточно сложна. Тем не менее ты должен знать, что в Заббиксе есть несколько предустановок для хостов Солярис, которые довольно неплохо работают и для SmartOS. Все дополнительное тебе придется настроить самостоятельно.
WWW
- Официальная страница для скачивания SmartOS
- Инструкция по записыванию SmartOS на флешку
- Таблица соответствий команд Linux и SmartOS
Выводы
Уже в течение года мы используем SmartOS в качестве основы инфраструктуры, на которой мы размещаем коммерческие проекты. Можем отметить, что по сравнению со стандартными Linux-системами решения на SmartOS удается делать более производительными и устойчивыми. Конечно, есть и минусы. База совместимого железа у SmartOS намного меньше, чем у Linux. Поэтому нужно тщательно относиться к выбору аппаратных платформ. Кроме того, несмотря на целенаправленную работу Joyent по пакетированию самого распространенного софта и наличию более 10 тысяч пакетов в репозитории, некоторых нужных пакетов, скорее всего, под SmartOS не окажется. Их придется компилировать, что может вырасти в отдельный геморрой. Тем не менее пакетов в репозитории становится все больше, а спектр поддерживаемого оборудования — все шире.
Git in Sky
Компания Git in Sky предоставляет услуги по оптимизации, настройке и поддержке серверных систем, построенных на базе Open Source Software. Большой опыт и компетенция инженеров, которые собрались в Git in Sky, позволяет настроить работу ваших серверов на максимальном уровне соотношения эффективность/стоимость.
Мы любим решения на SmartOS, так как эта ОС позволяет добиться максимума производительности веб-приложений и сервисов, но работаем с любыми Open Source системами, построенными на любых дистрибутивах Linux.
DARWIN
PROBLEM | Can’t switch off SMART, can’t switch off auto-save, can’t run short tests. |
SYSTEM | Any system before Tiger |
REPORTER | Geoff Keating <geoffk@…> |
NOTE | There’s a bug in the system library: when you ask it to do any of these things, it does the inverse (switches on, runs extended tests). Radar 3727283. |
PROBLEM | When drive is asleep, SMART commands fail |
SYSTEM | All known systems |
REPORTER | Geoff Keating <geoffk@…> |
NOTE | You can prevent the drive from sleeping by saying pmset -a disksleep 0 or by unchecking the ‘Put the hard disk(s) to sleep when possible’ checkbox in the Energy Saver preferences. Radar 4094403. |
License
Published under .
Installation of Smartmontools
The Smartmontools can be installed on Ubuntu using the package sources:
sudo apt-get install smartmontools
To ensure the hard disk supports SMART and is enabled, use the following command (in this example for the hard disk /dev/sdc):
sudo smartctl -i /dev/sdc
Example Output:
smartctl 5.41 2011-06-09 r3365 (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF INFORMATION SECTION === Model Family: Western Digital RE4 Serial ATA Device Model: WDC WD5003ABYX-01WERA1 Serial Number: WD-WMAYP5453158 LU WWN Device Id: 5 0014ee 00385d526 Firmware Version: 01.01S02 User Capacity: 500,107,862,016 bytes Sector Size: 512 bytes logical/physical Device is: In smartctl database ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Mon Sep 2 14:06:57 2013 CEST SMART support is: Available - device has SMART capability. SMART support is: Enabled
The last two lines are the most important as these indicate whether SMART support is available and enabled.
Test procedure with smartctl
Before performing a test, an approximate indication of the time duration of the various tests are displayed using the following command:
sudo smartctl -c /dev/sdc
Example output:
Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 83) minutes. Conveyance self-test routine recommended polling time: ( 5) minutes.
The following command starts the desired test (in Background Mode):
sudo smartctl -t <short|long|conveyance|select> /dev/sdc
It is also possible to perform an «offline» test. However, only of the standard self test (Short Test) is performed.
Example output:
smartctl 5.41 2011-06-09 r3365 (local build) Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Short self-test routine immediately in off-line mode". Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 2 minutes for test to complete. Test will complete after Mon Sep 2 15:32:30 2013 Use smartctl -X to abort test.
To perform the tests in Foreground Mode a «-C» must be added to the command.
sudo smartctl -t <short|long|conveyance|select> -C /dev/sdc
Distribution
How can I check that the package hasn’t been tampered with?
Since the utilities run as root, you might
be concerned about something harmful being embedded within
them. Starting with release 5.19 of , the released
files have been GPG signed (except releases 5.37 to 5.39.1).
The fingerprint are given in a file on the release page with a name
like .
Please verify these using the
- Smartmontools GPG Signing Key (2019-2020)
- Smartmontools GPG Signing Key (2017-2018)
- Smartmontools GPG Signing Key (2015-2016)
- Smartmontools GPG Signing Key (2013-2014)
- Smartmontools GPG Signing Key (2010-2012)
- Smartmontools GPG Signing Key (2005-2006)
- Smartmontools GPG Signing Key (2003-2004)
Update the drive database
The drive database file can be updated separately with the following command:
sudo /usr/sbin/update-smart-drivedb
This command uses curl, wget or lynx for download. A proxy server can be specified by the environment variable (lower case only), see the man pages of the tools for details.
The downloaded file is verified with OpenPGP/GPG key ID (release 6.6: ).
The public key block is .
It is also available at Key Servers (release 6.6) but there is no need to import it into a local keyring.
The above update method does no longer work for smartmontools older than 6.5.
The tools from 5.40 to 6.1 use a download URL which is no longer valid since sourceforge platform upgrades.
Releases 6.2 to 6.4 of the script use a HTTP URL which does no longer work since sourceforge site changed to HTTPS-only.
The script from release 6.6 could also be used for older releases if the line is adjusted accordingly.
The Windows package provides . It reads the proxy configuration from IE registry key.
The file can be viewed or downloaded () using the Trac browser:
5.41,
5.42,
5.43,
6.0,
6.1,
6.2,
6.3,
6.4,
6.5,
6.6,
7.0-7.1,
trunk.
The following branches are no longer maintained:
5.39,
5.40.
Install precompiled package
Precompiled packages are available for many distributions, see the Packages page.
Install the Windows package
Download and run the latest smartmontools NSIS-installer () from here.
More recent Windows test releases build from SVN snapshots are available here.
The default install type «Full» creates start menu shortcuts including an uninstaller, and adds the install directory to the PATH variable.
The install type «Extract files only» is useful to unpack a «portable» version without affecting the Windows registry.
The files can also be unpacked by 7-Zip which is also available for Linux.
The 32-bit version of smartmontools usually works also on 64-bit versions of Windows.
Starting with smartmontools 5.43, the installer also provides 64-bit executables.
These may be useful if the 32-bit subsystem is not available (e.g. 64-bit Windows Recovery CD).
Virus scanners occasionally produce false positive virus reports for NSIS-installers, see the NSIS False Positives page. If this is the case for the smartmontools installer, please send a report to the smartmontools-support mailing list.
To use the smartd warning mail feature, download and install the Blat mail utility.
The Chocolatey package manager provides install scripts for
smartmontools,
GSmartControl and
Blat.
See the WPKG-Wiki for info about automated deployment of smartmontools and Blat.
Alternatively you could use the Smartmontools for Windows Package by Ozy de Jong.
This independent package provides user friendly support for smartd configuration and unattended setup.
Install the OSX/Darwin package
Download and run the latest smartmontools dmg image from here.
More recent OS X test releases build from the SVN snapshots are available here.
Package provides Mach-O universal binary with 2 architectures (i386 and x86_64) and should work on any Intel based Mac.
Утилита smartctl
Информация о диске /dev/sda
# smartctl -i /dev/sda
smartctl 6.5 2016-01-24 r4214 (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Family: Seagate Barracuda 7200.8 Device Model: ST3400832A Serial Number: 5NF14NZ3 Firmware Version: 3.03 User Capacity: 400 088 457 216 bytes Sector Size: 512 bytes logical/physical Device is: In smartctl database ATA Version is: ATA/ATAPI-7 (minor revision not indicated) Local Time is: Tue Oct 31 17:43:46 2017 MSK SMART support is: Available - device has SMART capability. SMART support is: Enabled
Если S.M.A.R.T. отключен (SMART support is: Disabled), то для включения нужно выполнить команду
# smartctl -s on /dev/sda
Но при этом нужно убедиться, что диск поддерживает технологию SMART:
SMART support is: Available - device has SMART capability.
Просмотр значений S.M.A.R.T. для устройства /dev/sda
# smartctl -A /dev/sda
smartctl 6.5 2016-01-24 r4214 (local build) Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Attributes Data Structure revision number: 10 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000f 047 045 006 Pre-fail Always - 215938486 3 Spin_Up_Time 0x0003 097 097 000 Pre-fail Always - 0 4 Start_Stop_Count 0x0032 099 099 020 Old_age Always - 1612 5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0 7 Seek_Error_Rate 0x000f 073 060 030 Pre-fail Always - 22295258 9 Power_On_Hours 0x0032 025 025 000 Old_age Always - 66274 10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 099 099 020 Old_age Always - 1651 194 Temperature_Celsius 0x0022 062 064 000 Old_age Always - 62 (0 17 0 0 0) 195 Hardware_ECC_Recovered 0x001a 047 045 000 Old_age Always - 215938486 197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0 198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0 199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0 200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline - 0 202 Data_Address_Mark_Errs 0x0032 100 253 000 Old_age Always - 0
Существует 2 типа атрибутов (колонка TYPE)
- критичные атрибуты (pre-fail);
- некритичные атрибуты (old_age);
Критичные атрибуты:
- Raw Read Error Rate — частота ошибок при чтении данных с диска;
- Reallocated Sector Count — число операций переназначения секторов;
- Spin Up Time — время раскрутки пакета дисков из состояния покоя до рабочей скорости;
- Spin Up Retry Count — число повторных попыток раскрутки дисков до рабочей скорости, в случае если первая попытка была неудачной;
- Seek Error Rate — частота ошибок при позиционировании блока головок;
Быстрый опрос диска на предмет живучести, с предсказанием отказа диска в ближайшие 24 часа
$sudo smartctl -H /dev/sda
Список поддерживаемых тестов и примерное время на каждый текст
$sudo smartctl -c /dev/sda
Запуск теста на проверку читаемости секторов
$sudo smartctl -t /dev/sda
Провести быстрый тест здоровья жесткого диска
# smartctl -H /dev/sda
Выполнить расширенные встроенные тесты для диска /dev/sda.
$sudo smartctl --test=long /dev/sda
Команду можно использовать на работающей системе. Для просмотра результатов выполнения тестов используется команда вывода внутреннего журнала после завершения теста
$sudo smartctl -l selftest /dev/sda
Для просмотра всех возможностей
$sudo smartctl -h
Грузимся с флешки, работаем из памяти
В чем же состоят основные отличия SmartOS от «обычных» операционных систем?
Наверное, первое, о чем стоит сказать, — это отсутствие системных файлов ОС на локальном диске. SmartOS загружается с флешки или по сети и затем целиком располагается в памяти сервера. На диске находятся только данные (обычно данные виртуальных машин). Такое свойство позволяет системе очень быстро работать в связи с отсутствием дисковых операций, но, конечно, ценой более длительного времени загрузки и усложненным механизмом «запоминания» пользовательских данных сервера — его адресов, конфигураций и прочего, что должно настраиваться при загрузке ОС.
Второе важное отличие — встроенный механизм виртуализации, основанный на контейнерной технологии. В других ОС для виртуализации требуется дополнительное ПО гипервизора
Контейнерная виртуализация позволяет избежать дополнительного слоя гипервизора. Широкая система разделения прав, присутствовавшая в Solaris10 и OpenSolaris, позволила создать технологию Zones, благодаря ей виртуальная машина управляется той же самой ОС, которая стоит на всем сервере. Это похоже на OpenVZ и Virtuozzo Containers, но имеет совершенно другие и более глубокие корни, уходящие в семейство SunOS, развивавшееся с восьмидесятых — девяностых годов.
Третье важное отличие — это файловая система ZFS, используемая как основная. Рассказ о ZFS требует отдельной большой статьи
Здесь я скажу лишь, что эта файловая система несет в себе большое количество высокоуровневых функций и позволяет с легкостью обращаться с образами виртуальных машин — копируя и резервируя их очень гибко. Кроме того, ZFS имеет в своей основе принцип copy-on-write, который позволяет очень эффективно хранить резервные копии данных, занимая минимум физического дискового пространства. Также можно делать очень быстро и много snapshots (моментальные «снимки» папок файловой системы), для разных целей.
Благодаря мощному уровню сетевой виртуализации можно создавать виртуальные порты практически в неограниченном количестве, виртуальные сети между виртуальными машинами, осуществлять роутинг, фильтрацию пакетов и многое другое на одном физическом интерфейсе. Эта технология позволяет создавать сложные сетевые архитектуры с разными ролями и правами виртуальных серверов внутри одного физического сервера!