CN107577581A - A kind of method of all SSD disks in quick detection Linux system - Google Patents

A kind of method of all SSD disks in quick detection Linux system Download PDF

Info

Publication number
CN107577581A
CN107577581A CN201710847089.9A CN201710847089A CN107577581A CN 107577581 A CN107577581 A CN 107577581A CN 201710847089 A CN201710847089 A CN 201710847089A CN 107577581 A CN107577581 A CN 107577581A
Authority
CN
China
Prior art keywords
disk
ssd
judge
linux system
quick detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710847089.9A
Other languages
Chinese (zh)
Inventor
段璐恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710847089.9A priority Critical patent/CN107577581A/en
Publication of CN107577581A publication Critical patent/CN107577581A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The method that the present invention discloses all SSD disks in a kind of quick detection Linux system, is related to SSD disk detection techniques, by being integrated to disc information in Linux system, can quickly obtain a SSD disk list.Disk list first in acquisition system, it is physical disk to judge disk, if not then ignoring;Then it is mobile disk to judge disk, if then ignoring, it is SSD finally to judge disk, if not then ignoring, if then adding SSD lists, has been detected until disk is whole, has finally returned that SSD lists.Quick search of the present invention reduces the workload of server attendant, improves the speed that SSD disks are detected in system to all SSD in system;This method is novel in design, implements simply, and easily operation, greatly improves server O&M efficiency, specific preferable popularizing value.

Description

A kind of method of all SSD disks in quick detection Linux system
Technical field
The present invention relates to SSD disk detection techniques, all SSD magnetic in specifically a kind of quick detection Linux system The method of disk.
Background technology
SSD(Solid State Drives, solid state hard disc)With read or write speed is fast, shockproof crash resistance is preferable, low-power consumption, Noiseless, operating temperature range is big, it is light the advantages that, increasingly faster with magnetic disc development, SSD takes in enterprise-level at present It is engaged in gradually popularizing in device.But in linux operating systems, due to SSD and mechanical hard disk the HDD interface used and agreement one Sample, the drive come out in systems to these Disk Mappings are not had any different, and this is resulted in use, can not quickly be known Other SSD and HDD.In server O&M, in order to confirm which disk is SSD, which disk is HDD, it is necessary to expend O&M people The substantial amounts of energy of member, in addition in coding, judges that disk type is also unrealistic simply by program, causes rapidly to identify Disk type has had a strong impact on server O&M efficiency.
The content of the invention
Demand and weak point of the present invention for the development of current technology, there is provided institute in a kind of quick detection Linux system There is the method for SSD disks.
The method of all SSD disks in a kind of quick detection Linux system of the present invention, solve above-mentioned technical problem and adopt Technical scheme is as follows:The method of all SSD disks in the quick detection Linux system, by integrating in Linux system Disc information, judge disk type, quick search goes out all SSD in system, and its specific implementation process includes:1)Obtain drive bar Table, 2)Judge that disk is physical disk, 3) judge that disk is mobile disk, 4)Judge that disk is SSD, 5)Return Return SSD lists.
Preferably, disk list first in acquisition system, it is physical disk to judge disk, if not then ignoring;So It is mobile disk to judge disk afterwards, if then ignoring, it is SSD finally to judge disk, if not then ignoring, if then SSD lists are added, has been detected until disk is whole, has finally returned that SSD lists.
Preferably, step 1), by checking that catalogue/sys/block obtains all disk drives, obtain disk list.
Preferably, step 2), logical device is filtered out, leaves behind physical disk.
Preferably, step 3), the driving type of disk is judged by udevadm orders, excludes mobile disk.
Preferably, step 4), the type of disk is judged by lsblk orders, SSD is added into SSD lists.
The method of all SSD disks, has compared with prior art in a kind of quick detection Linux system of the present invention Beneficial effect be:The present invention can quickly obtain a SSD disk by being integrated to disc information in Linux system List, so as to quick search to all SSD in system, reduce the workload of server attendant, improve in system and examine Survey the speed of SSD disks;Also, this method is novel in design, implement simply, easily operation, greatly improve server O&M effect Rate, therefore specific preferable popularizing value.
Brief description of the drawings
Accompanying drawing 1 is the flow chart of all SSD disks in quick detection Linux system.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with specific embodiment, to this hair The method of all SSD disks is further described in a kind of bright quick detection Linux system.
Embodiment 1:
The method that the present embodiment proposes all SSD disks in a kind of quick detection Linux system, by integrating Linux system Interior disc information, judge disk type, quick search goes out all SSD in system, and its specific implementation process includes:1)Obtain disk List, 2)Judge that disk is physical disk, 3) judge that disk is mobile disk, 4)Judge that disk is SSD, 5) Return to SSD lists.
As shown in Figure 1, the idiographic flow of all SSD disks is as follows in the present embodiment quick detection Linux system:First Disk list in acquisition system, it is physical disk to judge disk, if not then ignoring;Then judge whether disk moves Disk, if then ignoring, it is SSD finally to judge disk, if not then ignoring, if SSD lists are then added, until disk All detect, ultimately formed SSD lists and return.
Embodiment 2:
Described in the present embodiment in quick detection Linux system all SSD disks method, on the basis of embodiment 1, by right Disc information is integrated in Linux system, obtains a SSD disk list.
First by checking that catalogue/sys/block obtains all disk drives, disk list is obtained;And which is judged It is not physical disk, filters out logical device, leaves behind physical disk;Then, the drive of disk is judged by udevadm orders Dynamic type, excludes mobile disk;The type of disk is judged finally by lsblk orders, SSD is added into SSD lists, and return Return SSD lists.
Embodiment is only the specific case of the present invention, and scope of patent protection of the invention is including but not limited to above-mentioned Embodiment, any person of an ordinary skill in the technical field that meet claims of the present invention and any is to it The appropriate change or replacement done, it should all fall into the scope of patent protection of the present invention.

Claims (6)

1. a kind of method of all SSD disks in quick detection Linux system, it is characterised in that by integrating Linux system Interior disc information, judge disk type, quick search goes out all SSD in system, and its specific implementation process includes:1)Obtain disk List, 2)Judge that disk is physical disk, 3) judge that disk is mobile disk, 4)Judge that disk is SSD, 5) Return to SSD lists.
2. according to claim 1 in a kind of quick detection Linux system all SSD disks method, it is characterised in that Disk list first in acquisition system, it is physical disk to judge disk, if not then ignoring;Then judge that disk is Mobile disk, if then ignoring, it is SSD finally to judge disk, if not then ignore, if then adding SSD lists, until Disk has all detected, and finally returns that SSD lists.
3. the method for all SSD disks, its feature exist in a kind of quick detection Linux system according to claim 1 or claim 2 In step 1), by checking that catalogue/sys/block obtains all disk drives, obtain disk list.
4. according to claim 3 in a kind of quick detection Linux system all SSD disks method, it is characterised in that Step 2), logical device is filtered out, leaves behind physical disk.
5. according to claim 4 in a kind of quick detection Linux system all SSD disks method, it is characterised in that Step 3), the driving type of disk is judged by udevadm orders, excludes mobile disk.
6. according to claim 5 in a kind of quick detection Linux system all SSD disks method, it is characterised in that Step 4), the type of disk is judged by lsblk orders, SSD is added into SSD lists.
CN201710847089.9A 2017-09-19 2017-09-19 A kind of method of all SSD disks in quick detection Linux system Pending CN107577581A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710847089.9A CN107577581A (en) 2017-09-19 2017-09-19 A kind of method of all SSD disks in quick detection Linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710847089.9A CN107577581A (en) 2017-09-19 2017-09-19 A kind of method of all SSD disks in quick detection Linux system

Publications (1)

Publication Number Publication Date
CN107577581A true CN107577581A (en) 2018-01-12

Family

ID=61032750

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710847089.9A Pending CN107577581A (en) 2017-09-19 2017-09-19 A kind of method of all SSD disks in quick detection Linux system

Country Status (1)

Country Link
CN (1) CN107577581A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117091A (en) * 2018-07-27 2019-01-01 广东浪潮大数据研究有限公司 A kind of SSD equipment mount point acquisition methods and relevant apparatus

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120007981A1 (en) * 2010-07-09 2012-01-12 Guerrera Ernest L Passenger surveillance
CN103150126A (en) * 2013-02-28 2013-06-12 北京百度网讯科技有限公司 Disc character correct allocation method and device based on disc under Linux

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120007981A1 (en) * 2010-07-09 2012-01-12 Guerrera Ernest L Passenger surveillance
CN103150126A (en) * 2013-02-28 2013-06-12 北京百度网讯科技有限公司 Disc character correct allocation method and device based on disc under Linux

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
CSDN: "Linux下判断磁盘是SSD还是HDD的几种方法", 《HTTPS://BLOG.CSDN.NET/SCH0120/ARTICLE/DETAILS/77725658》 *
LINUX/UNIX SYSTEM PROGRAMMING TRAINING: "Linux manual page", 《HTTPS://WWW.BAIDU.COM/LINK?URL=KZOYODGHC2GYAFBQ80ANQUBLABC2FR9NFOB6HEYOYIE_GNATPR_GN7K0BLMRCKUN18R-0PGDMPDSMV2KDUFXR_&WD=&EQID=85782534001497B0000000035CB97686》 *
开源中国: "udev(八):实战:使用udevadm修改usb优盘在_dev下的名字", 《HTTPS://WWW.OSCHINA.NET/QUESTION/565065_87348》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117091A (en) * 2018-07-27 2019-01-01 广东浪潮大数据研究有限公司 A kind of SSD equipment mount point acquisition methods and relevant apparatus

Similar Documents

Publication Publication Date Title
US10008010B2 (en) Techniques for providing an augmented reality view
WO2012154658A3 (en) Methods, systems, and computer readable media for efficient computer forensic analysis and data access control
WO2011116296A3 (en) Systems and methods to enhance search data with transaction based data
WO2014150250A3 (en) Method and apparatus for substitution scheme for anonymizing personally identifiable information
WO2012118756A3 (en) Compressed journaling in event tracking files for metadata recovery and replication
US20120137068A1 (en) Computing device and method for identifying hard disks
JP2013545207A5 (en)
WO2012166664A3 (en) Golf ball tracking system and methods therefor
WO2007128005A3 (en) Filesystem-aware block storage system, apparatus, and method
WO2007013961A3 (en) Architecture and method for configuring a simplified cluster over a network with fencing and quorum
WO2010141270A3 (en) Systems and methods to summarize transaction data
WO2012138504A3 (en) Data deduplication
WO2013170162A3 (en) System and method for the classification of storage
JP2011134260A5 (en)
WO2012083263A3 (en) Partial recall of deduplicated files
CN103218173A (en) Method and device for storage control
CN103324274A (en) Method and device for man-machine interaction
JP2016504675A5 (en)
WO2012050795A3 (en) Item level recovery
JP2013045364A5 (en)
CN107577581A (en) A kind of method of all SSD disks in quick detection Linux system
US20170329553A1 (en) Storage control device, storage system, and computer-readable recording medium
JP2014179095A5 (en)
WO2011139134A3 (en) Method for authenticating a storage device, machine-readable storage medium, and host device
CN106599236A (en) Metadata storage method and apparatus for file system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180112