CN102789371A - Method for distributing disk identifier of hard disk - Google Patents

Method for distributing disk identifier of hard disk Download PDF

Info

Publication number
CN102789371A
CN102789371A CN2012102655278A CN201210265527A CN102789371A CN 102789371 A CN102789371 A CN 102789371A CN 2012102655278 A CN2012102655278 A CN 2012102655278A CN 201210265527 A CN201210265527 A CN 201210265527A CN 102789371 A CN102789371 A CN 102789371A
Authority
CN
China
Prior art keywords
hard disk
phy address
drive
dev
phy
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
CN2012102655278A
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.)
Dawning Information Industry Beijing Co Ltd
Original Assignee
Dawning Information Industry Beijing 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 Dawning Information Industry Beijing Co Ltd filed Critical Dawning Information Industry Beijing Co Ltd
Priority to CN2012102655278A priority Critical patent/CN102789371A/en
Publication of CN102789371A publication Critical patent/CN102789371A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a method for distributing a disk identifier of a hard disk, which comprises the following steps: identifying that the hard disk is inserted into a hard disk slot; obtaining a PHY (Physical Layer) address of a physical port of the hard disk slot; and distributing the disk identifier corresponding to the PHY address to the hard disk according to the PHY address. According to the method for distributing the disk identifier of the hard disk provided by the invention, the disk identifier is quickly and accurately distributed to the hard disk, the inconvenience in disk identifier distribution caused by the hard disk driving is avoided, and the system resources are saved.

Description

Hard disk drive distribution method
Technical field
The present invention relates to computer realm basically, more specifically, relates to a kind of hard disk drive distribution method.
Background technology
In server operational process of today, need the storage mass data, therefore, the polylith hard disk often has been installed on server master board.Usually, in (SuSE) Linux OS, to the allocation scheme of drive be to the less drive of the hard disk distribution ratio that recognizes earlier as (/dev/sda), and to after the hard disk that recognizes distribute bigger drive (/dev/sdb).This just causes can not inferring it is which opens hard disk according to drive to hard disk operation at every turn.And in fact plurality of applications all depends on drive and locatees hard disk.
Prior art provides a kind of method of assignment logic drive, and this method comprises: after system start-up, confirm the corresponding logical DOS drives of hard disc physical sign according to the corresponding relation between hard disc physical sign of preserving and the logical DOS drives; The logical DOS drives of confirming is distributed to corresponding hard disc physical sign.Adopt this method that corresponding relation between hard disc physical sign and the logical DOS drives is consistent before and after restarting in system, thereby can find the corresponding physical hard disk, further improve and search the efficient that faulty hard disk is arranged through logical DOS drives.
Above-mentioned prior art has kept the consistance between hard disk and the drive to a certain extent, yet what this prior art was used is the information of hard disk itself, for device drives certain requirement is arranged, and exists the hard disk sequence number problem such as can't discern.Even can discern, whenever change a hard disk or increase, reducing by a hard disk will be corresponding with drive with the information such as sequence number of new hard disk again, process is comparatively loaded down with trivial details, has wasted more system resources.
Summary of the invention
In order to overcome the defective of above-mentioned prior art, the invention provides a kind of hard disk drive distribution method.Through hard disk drive distribution method provided by the present invention, how to have solved under the situation that need not customize the driving of hard disk, just can drive be distributed to the technical matters of hard disk.
According to an aspect of the present invention, a kind of hard disk drive distribution method is provided, has comprised: step S1: recognized hard disk and inserted in the hard disk slot; Step S2: the physical port PHY address that obtains said hard disk slot; And step S3: according to said PHY address, the drive that said PHY address is corresponding is distributed to said hard disk.
Preferably, the PHY address of each hard disk slot is corresponding with a drive respectively.
Preferably, after said step S1, before the said step S2, said method also comprises: judge that through obtaining the hard disk domain information whether said hard disk is a kind of in SCSI hard disk and the SAS hard disk, if then carry out said step S2.
Preferably, if judge said hard disk neither the SCSI hard disk, neither the SAS hard disk, then will except that with the corresponding drive in PHY address of said each hard disk slot other drives distribute to said hard disk.
Preferably; Said PHY address is a PHY address, the 2nd PHY address, the 3rd PHY address, the 4th PHY address, the 5th PHY address, the 6th PHY address, the 7th PHY address or the 8th PHY address; Wherein, the corresponding drive in a said PHY address is/dev/sda that the corresponding drive in said the 2nd PHY address is/dev/sdb; The corresponding drive in said the 3rd PHY address is/dev/sdc; The corresponding drive in said the 4th PHY address is/dev/sdd that the corresponding drive in said the 5th PHY address is/dev/sde that the corresponding drive in said the 6th PHY address is/dev/sdf; The corresponding drive in said the 7th PHY address is/dev/sdg that the corresponding drive in said the 8th PHY address is/dev/sdh.
Preferably, said other drives are/dev/sdi.
Preferably, said step S1 comprises: behind os starting, when having recognized hard disk when being inserted into the hard disk slot, send event signal to the drive distribution module.
Preferably, said step S2 comprises: said drive distribution module is in response to said event signal, obtains the PHY address of said hard disk slot through obtaining the hard disk domain information.
Preferably, said step S3 comprises: said drive distribution module is according to resulting said PHY address, and the drive that said PHY address is corresponding is distributed to said hard disk.
Preferably, said operating system is (SuSE) Linux OS.
Through hard disk drive distribution method described in the invention, can quickly and accurately drive be distributed to hard disk, avoided hard drive to distribute the inconvenience that brings to drive, saved system resource.
Description of drawings
Accompanying drawing is used to provide further understanding of the present invention, and constitutes the part of instructions, is used to explain the present invention with embodiments of the invention, is not construed as limiting the invention.In the accompanying drawings:
Fig. 1 is the process flow diagram according to the overall embodiment of hard disk drive distribution method of the present invention;
Fig. 2 is the process flow diagram according to the specific embodiment of hard disk drive distribution method of the present invention.
Embodiment
Below in conjunction with accompanying drawing the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein only is used for explanation and explains the present invention, and be not used in qualification the present invention.
Fig. 1 is the process flow diagram according to the overall embodiment of hard disk drive distribution method of the present invention.In Fig. 1:
Step S100: recognized hard disk and inserted in the hard disk slot.Preferably, behind os starting,, send event signal to the drive distribution module when having recognized hard disk when being inserted into the hard disk slot.Wherein, this operating system can be (SuSE) Linux OS.
Step S102: the physical port PHY address that obtains the hard disk slot.Preferably, the drive distribution module is in response to event signal, obtains the PHY address of hard disk slot through obtaining the hard disk domain information.Wherein, this hard disk domain information is stored in the mainboard internal memory, is writing down the various information of hard disk.
Step S104: according to the PHY address, the drive that the PHY address is corresponding is distributed to hard disk.Preferably, the drive distribution module is according to resulting PHY address, and the drive that the PHY address is corresponding is distributed to hard disk.
Through hard disk drive distribution method described in the invention, can quickly and accurately drive be distributed to hard disk, avoided hard drive to distribute the inconvenience that brings to drive, saved system resource.
Fig. 2 is the process flow diagram according to the specific embodiment of hard disk drive distribution method of the present invention.In Fig. 2, step S200 is identical with step S100, and step S204 is identical with step S102, and step S206 is identical with step S104, repeats no more at this.In addition, in Fig. 2:
Step S202: judge that through obtaining the hard disk domain information whether hard disk is a kind of in SCSI hard disk and the SAS hard disk.If judge the hard disk formula SCSI hard disk or the SAS hard disk of the new insertion that recognizes, execution in step S204 then, the physical port PHY address that promptly obtains the hard disk slot at this hard disk place.If judge this hard disk neither the SCSI hard disk, neither the SAS hard disk, then will except that with the corresponding drive in PHY address of said each hard disk slot other drives distribute to this hard disk.
Specifically, the PHY address of each hard disk slot is corresponding with a drive respectively.For example, eight hard disk slots are arranged on the server master board, these eight the pairing PHY of hard disk slot addresses are respectively a PHY address, the 2nd PHY address, the 3rd PHY address, the 4th PHY address, the 5th PHY address, the 6th PHY address, the 7th PHY address and the 8th PHY address; Wherein, The PHY address of these eight hard disk slots is corresponding one by one with eight drives, and promptly the corresponding drive in a PHY address is/dev/sda, and the corresponding drive in the 2nd PHY address is/dev/sdb; The corresponding drive in the 3rd PHY address is/dev/sdc; The corresponding drive in the 4th PHY address is/dev/sdd that the corresponding drive in the 5th PHY address is/dev/sde that the corresponding drive in the 6th PHY address is/dev/sdf; The corresponding drive in the 7th PHY address is/dev/sdg that the corresponding drive in the 8th PHY address is/dev/sdh.Except these eight drives, also have several drives not corresponding in the system with the PHY address of hard disk slot, such as/dev/sdi ,/dev/sdj or the like.Thus, if judge the new hard disk that inserted neither the SCSI hard disk, neither the SAS hard disk, so can be with distribute to this hard disk (such as being the SATA hard disk) except one of above-mentioned eight other drives the drive, for example general/dev/sdi distributes to this hard disk.
Through hard disk drive distribution method described in the invention, can quickly and accurately drive be distributed to hard disk, avoided hard drive to distribute the inconvenience that brings to drive, saved system resource.
Below will the present invention be described through an instance.
After the (SuSE) Linux OS of server starts,, send event signal to the drive distribution module when recognizing new hard disk when being inserted in the hard disk slot.This drive distribution module is sent out and is received after this event signal; Obtain the hard disk domain information in the mainboard internal memory; According in this hard disk domain information about the information of hard disk type; Judging the hard disk that is inserted is the SCSI hard disk, be the 3rd PHY address through obtaining physical port (PHY) address that corresponding information in the hard disk domain information obtains the hard disk slot that this SCSI hard disk inserted then, and the corresponding drive in the 3rd PHY address is/dev/sdc.Next, this drive/dev/sdc is distributed to the hard disk of new insertion.
Through hard disk drive distribution method described in the invention, can quickly and accurately drive be distributed to hard disk, avoided hard drive to distribute the inconvenience that brings to drive, saved system resource.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. hard disk drive distribution method comprises:
Step S1: recognized hard disk and inserted in the hard disk slot;
Step S2: the physical port PHY address that obtains said hard disk slot; And
Step S3: according to said PHY address, the drive that said PHY address is corresponding is distributed to said hard disk.
2. hard disk drive distribution method according to claim 1 is characterized in that, the PHY address of each hard disk slot is corresponding with a drive respectively.
3. hard disk drive distribution method according to claim 2; It is characterized in that; After said step S1, before the said step S2, said method also comprises: judge that through obtaining the hard disk domain information whether said hard disk is a kind of in SCSI hard disk and the SAS hard disk; If then carry out said step S2.
4. hard disk drive distribution method according to claim 3; It is characterized in that; If judge said hard disk neither the SCSI hard disk, neither the SAS hard disk, then will except that with the corresponding drive in PHY address of said each hard disk slot other drives distribute to said hard disk.
5. hard disk drive distribution method according to claim 4; It is characterized in that; Said PHY address is a PHY address, the 2nd PHY address, the 3rd PHY address, the 4th PHY address, the 5th PHY address, the 6th PHY address, the 7th PHY address or the 8th PHY address
Wherein, the corresponding drive in a said PHY address is/dev/sda that the corresponding drive in said the 2nd PHY address is/dev/sdb; The corresponding drive in said the 3rd PHY address is/dev/sdc; The corresponding drive in said the 4th PHY address is/dev/sdd that the corresponding drive in said the 5th PHY address is/dev/sde that the corresponding drive in said the 6th PHY address is/dev/sdf; The corresponding drive in said the 7th PHY address is/dev/sdg that the corresponding drive in said the 8th PHY address is/dev/sdh.
6. hard disk drive distribution method according to claim 5 is characterized in that said other drives are/dev/sdi.
7. hard disk drive distribution method according to claim 1 is characterized in that said step S1 comprises: behind os starting, when having recognized hard disk when being inserted into the hard disk slot, send event signal to the drive distribution module.
8. hard disk drive distribution method according to claim 7 is characterized in that said step S2 comprises: said drive distribution module is in response to said event signal, obtains the PHY address of said hard disk slot through obtaining the hard disk domain information.
9. hard disk drive distribution method according to claim 8 is characterized in that said step S3 comprises: said drive distribution module is according to resulting said PHY address, and the drive that said PHY address is corresponding is distributed to said hard disk.
10. hard disk drive distribution method according to claim 7 is characterized in that said operating system is (SuSE) Linux OS.
CN2012102655278A 2012-07-27 2012-07-27 Method for distributing disk identifier of hard disk Pending CN102789371A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012102655278A CN102789371A (en) 2012-07-27 2012-07-27 Method for distributing disk identifier of hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012102655278A CN102789371A (en) 2012-07-27 2012-07-27 Method for distributing disk identifier of hard disk

Publications (1)

Publication Number Publication Date
CN102789371A true CN102789371A (en) 2012-11-21

Family

ID=47154779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012102655278A Pending CN102789371A (en) 2012-07-27 2012-07-27 Method for distributing disk identifier of hard disk

Country Status (1)

Country Link
CN (1) CN102789371A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150126A (en) * 2013-02-28 2013-06-12 北京百度网讯科技有限公司 Disc character correct allocation method and device based on disc under Linux
CN103823730A (en) * 2014-02-27 2014-05-28 山东超越数控电子有限公司 Drive detecting method based on domestic disc array
CN104461402A (en) * 2014-12-29 2015-03-25 浪潮电子信息产业股份有限公司 Method for adjusting disk sequence among multiple controllers under linux system
CN104699423A (en) * 2015-03-13 2015-06-10 华为技术有限公司 Method and device for binding disk drive in Linux system
CN106815154A (en) * 2017-01-16 2017-06-09 联想(北京)有限公司 A kind of method and device of the mark for recognizing hard disk
CN107402721A (en) * 2017-06-30 2017-11-28 郑州云海信息技术有限公司 A kind of control method of hard disk, device and server
CN107423184A (en) * 2017-07-28 2017-12-01 郑州云海信息技术有限公司 The method of automatic test server hard-disk interface speed when a kind of hot-swappable
CN107450846A (en) * 2016-04-18 2017-12-08 美超微电脑股份有限公司 Storage device, stocking system and the method for starting report for resequencing
CN107547673A (en) * 2017-05-10 2018-01-05 新华三信息安全技术有限公司 A kind of distribution method of the network equipment and physical layer address
CN107943723A (en) * 2017-11-23 2018-04-20 郑州云海信息技术有限公司 A kind of hard disc of computer recognition methods and system
WO2020087955A1 (en) * 2018-11-01 2020-05-07 郑州云海信息技术有限公司 Method, apparatus and system for processing hard disk identifier duplication
CN113721860A (en) * 2021-09-13 2021-11-30 上海顺诠科技有限公司 Disc character binding system and method thereof
CN114063920A (en) * 2021-11-12 2022-02-18 四川华鲲振宇智能科技有限责任公司 Method and system for fixing drive letter under Linux

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101876885A (en) * 2010-06-18 2010-11-03 中兴通讯股份有限公司 Method and device for allocating logical DOS drives
US7958299B2 (en) * 2008-11-21 2011-06-07 Inventec Corporation Hard disk system state monitoring method
CN102355568A (en) * 2011-09-22 2012-02-15 杭州海康威视数字技术股份有限公司 Method and device for carrying out charged uninstallation and installation of hard disk for digital video recorder
CN102479163A (en) * 2010-11-25 2012-05-30 鸿富锦精密工业(深圳)有限公司 Multi-hard-disk automatic identification system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7958299B2 (en) * 2008-11-21 2011-06-07 Inventec Corporation Hard disk system state monitoring method
CN101876885A (en) * 2010-06-18 2010-11-03 中兴通讯股份有限公司 Method and device for allocating logical DOS drives
CN102479163A (en) * 2010-11-25 2012-05-30 鸿富锦精密工业(深圳)有限公司 Multi-hard-disk automatic identification system and method
CN102355568A (en) * 2011-09-22 2012-02-15 杭州海康威视数字技术股份有限公司 Method and device for carrying out charged uninstallation and installation of hard disk for digital video recorder

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103150126A (en) * 2013-02-28 2013-06-12 北京百度网讯科技有限公司 Disc character correct allocation method and device based on disc under Linux
CN103150126B (en) * 2013-02-28 2016-02-10 北京百度网讯科技有限公司 Based on character correct allocation method and the device of the disk under Linux
CN103823730A (en) * 2014-02-27 2014-05-28 山东超越数控电子有限公司 Drive detecting method based on domestic disc array
CN104461402B (en) * 2014-12-29 2018-04-06 浪潮电子信息产业股份有限公司 A kind of method for adjusting disk order under Linux system between multi-controller
CN104461402A (en) * 2014-12-29 2015-03-25 浪潮电子信息产业股份有限公司 Method for adjusting disk sequence among multiple controllers under linux system
CN104699423B (en) * 2015-03-13 2018-08-21 华为技术有限公司 The method and apparatus that drive is bound in linux system
CN104699423A (en) * 2015-03-13 2015-06-10 华为技术有限公司 Method and device for binding disk drive in Linux system
CN107450846A (en) * 2016-04-18 2017-12-08 美超微电脑股份有限公司 Storage device, stocking system and the method for starting report for resequencing
CN107450846B (en) * 2016-04-18 2020-08-07 美超微电脑股份有限公司 Storage device, storage system and method for reordering start reports
CN106815154A (en) * 2017-01-16 2017-06-09 联想(北京)有限公司 A kind of method and device of the mark for recognizing hard disk
CN107547673A (en) * 2017-05-10 2018-01-05 新华三信息安全技术有限公司 A kind of distribution method of the network equipment and physical layer address
CN107547673B (en) * 2017-05-10 2021-04-16 新华三信息安全技术有限公司 Network equipment and physical layer address allocation method
CN107402721A (en) * 2017-06-30 2017-11-28 郑州云海信息技术有限公司 A kind of control method of hard disk, device and server
CN107423184A (en) * 2017-07-28 2017-12-01 郑州云海信息技术有限公司 The method of automatic test server hard-disk interface speed when a kind of hot-swappable
CN107943723A (en) * 2017-11-23 2018-04-20 郑州云海信息技术有限公司 A kind of hard disc of computer recognition methods and system
WO2020087955A1 (en) * 2018-11-01 2020-05-07 郑州云海信息技术有限公司 Method, apparatus and system for processing hard disk identifier duplication
CN113721860A (en) * 2021-09-13 2021-11-30 上海顺诠科技有限公司 Disc character binding system and method thereof
CN114063920A (en) * 2021-11-12 2022-02-18 四川华鲲振宇智能科技有限责任公司 Method and system for fixing drive letter under Linux

Similar Documents

Publication Publication Date Title
CN102789371A (en) Method for distributing disk identifier of hard disk
US7970974B2 (en) Method and system for adding or removing a logical unit of a USB mass storage device
WO2019144553A1 (en) Data storage method and apparatus, and storage medium
CN103412769A (en) External card parameter configuration method, equipment and system
US9063655B2 (en) Multi-level port expansion for port multipliers
CN109324991B (en) Hot plug device, method, medium and system of PCIE (peripheral component interface express) equipment
US20180226137A1 (en) Verification of storage media upon deployment
CN102479163A (en) Multi-hard-disk automatic identification system and method
CN109033804B (en) Virtual machine software authorization method and device
CN113032105A (en) Kubernetes cluster access control method, system and related equipment
EP3018585A1 (en) Machine provision method, machine provision system, and machine provision program
CN102262589B (en) Application server for realizing copying of hard disc driver and method
CN102801575A (en) Loopback detecting method and device
CN109144586A (en) A kind of driving adaptation method, device, computer equipment and storage medium
CN100449472C (en) Method and apparatus for treating disc hot insert
CN104598243A (en) Multi-user application program management method and device applied to intelligent terminal
CN105100901A (en) Virtual storage card configuration method and system
WO2023123896A1 (en) Disc loading control method, apparatus, and device, and readable storage medium
US9058264B2 (en) Method for repairing communication abnormality between data card and host and data card
CN104866385A (en) Mobile terminal and method for hot plug of memory card thereof
CN102111446B (en) Device connection handling method, combination equipment and host equipment
CN103702193A (en) Method and device for identifying and recognizing type of intelligent television
TW202111518A (en) Application presence monitoring and reinstallation
CN105005451A (en) Solid state hard disk based user information storage method
US10042769B2 (en) System and method for managing cache space and electronic device employing same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100193 Beijing, Haidian District, northeast Wang West Road, building 8, No. 36

Applicant after: Dawning Information Industry (Beijing) Co., Ltd.

Address before: 100193 Shuguang building, Zhongguancun Software Park, Haidian District, Beijing

Applicant before: Dawning Information Industry (Beijing) Co., Ltd.

C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20121121