CN102306128A - Disk management method and device and network equipment - Google Patents

Disk management method and device and network equipment Download PDF

Info

Publication number
CN102306128A
CN102306128A CN201110276182A CN201110276182A CN102306128A CN 102306128 A CN102306128 A CN 102306128A CN 201110276182 A CN201110276182 A CN 201110276182A CN 201110276182 A CN201110276182 A CN 201110276182A CN 102306128 A CN102306128 A CN 102306128A
Authority
CN
China
Prior art keywords
disk
sector
replacement
physical sector
disk management
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.)
Granted
Application number
CN201110276182A
Other languages
Chinese (zh)
Other versions
CN102306128B (en
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.)
Beijing Star Net Ruijie Networks Co Ltd
Original Assignee
Beijing Star Net Ruijie Networks 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 Beijing Star Net Ruijie Networks Co Ltd filed Critical Beijing Star Net Ruijie Networks Co Ltd
Priority to CN2011102761821A priority Critical patent/CN102306128B/en
Publication of CN102306128A publication Critical patent/CN102306128A/en
Application granted granted Critical
Publication of CN102306128B publication Critical patent/CN102306128B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention provides a disk management method, a disk management device and network equipment. The disk management method comprises the following steps that: the disk management device receives an input/output (I/O) request of a logical address of a sector carrying a disk; the disk management device searches a replacement identifier corresponding to the logical address from a preset replacement bitmap; the disk management device searches a physical sector mapped by the logical address from a logical mapping table if the disk management device knows that a physical sector corresponding to the logical address has been replaced according to the searched replacement identifier, wherein a corresponding relationship between the logical address and the physical sector for replacing the damaged sector is stored in the logical mapping table; and the disk management device performs I/O operation on the physical sector according to the I/O request. By the disk management method, the disk management device and the network equipment, the damaged sector in the disk can be dynamically managed.

Description

Disk management method, device and the network equipment
Technical field
The present invention relates to technical field of memory, relate in particular to a kind of disk management method, device and the network equipment.
Background technology
Along with development of science and technology, computing machine become all trades and professions one of indispensable basic tool, using the disk that in computing machine, is used for storage data also is the thing of indispensability.Because disk adopts magnetic medium to store data, thus experience use for a long time or improper use after, sudden power etc. for example, some sector of disk may be damaged.
In the prior art, adopt the static scanning shielding mode that the damage sector in the disk is handled usually.For example, the disk scanning function that is equipped with in user's operational system scans disk health status, the damage sector that scans is marked, and the circular document system no longer conducts interviews to these damage sectors.
Adopt above-mentioned static scanning shielding mode to handle when damaging the sector; Can not dynamically handle the damage sector in the disk; Cause and in time to shield, thereby cause problems such as visit failure or loss of data, reduced the reliability and the security of disk damaging the sector.
Summary of the invention
To above-mentioned defective, the present invention provides a kind of disk management method, device and the network equipment, to realize damaging the dynamic management of sector in the disk.
According to an aspect of the present invention, a kind of disk management method is provided, comprises:
The disk management device receives the I/O I/O request of the logical address of the sector that carries disk;
Said disk management device is searched the replacement sign corresponding with said logical address from the pre-set replaced bitmap;
Said disk management device is if know that based on the replacement sign of being searched replacement took place the pairing physical sector of said logical address; Then from the logical mappings table, search the physical sector that said logical address is shone upon, wherein said logical mappings table stores said logical address and the corresponding relation that is used to replace the physical sector that damages the sector;
Said disk management device carries out the I/O operation according to said I/O request to said physical sector.
According to a further aspect in the invention, a kind of disk management device is provided also, comprises:
I/O asks receiver module, is used to receive the I/O request of the logical address of the sector that carries disk;
The replacement sign is searched module, is used for searching the replacement sign corresponding with said logical address from the pre-set replaced bitmap;
Physical sector is searched module; Be used for if know that based on the replacement sign of being searched replacement took place the pairing physical sector of said logical address; Then from the logical mappings table, search the physical sector that said logical address is shone upon, wherein said logical mappings table stores said logical address and the corresponding relation that is used to replace the physical sector that damages the sector;
The I/O operational module is used for according to said I/O request said physical sector being carried out the I/O operation.
According to another aspect of the invention, a kind of network equipment is provided also, comprises disk management device of the present invention.
According to disk management method of the present invention, device and the network equipment; Because the disk management device is after receiving the I/O request; At first according to the replacement bitmap of disk detect this I/O request the LBA number corresponding physical sector that will visit whether replace; And when knowing the generation replacement; Physical sector after record logical address and the logical mappings table that is used for replacing the physical sector corresponding relation that damages the sector are searched replacement; Operate so that the not damage physical sector after the replacement is carried out corresponding I/O, thereby can realize damaging the dynamic management of sector in the disk by utilizing the reserved sectors replacement damage sector in the disk.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously; Accompanying drawing in describing below only is some embodiments of the present invention; For those of ordinary skills; Under the prerequisite of not paying creative work property, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of disk management method of the present invention.
Fig. 2 is the structural representation of disk.
Fig. 3 is the memory allocation synoptic diagram of disk.
Fig. 4 carries out the detail flowchart of disk management method of the present invention for the disk management device.
Fig. 5 is the structural representation of disk management device of the present invention.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Fig. 1 is the schematic flow sheet of disk management method of the present invention.As shown in Figure 1, this disk management method may further comprise the steps:
Step S101, disk management device receive I/O (I/O) request of the logical address of the sector that carries disk;
Step S102, said disk management device search the replacement sign corresponding with said logical address from the pre-set replaced bitmap;
Step S103; Said disk management device is if know that based on the replacement sign of being searched replacement took place the pairing physical sector of said logical address; Then from the logical mappings table, search the physical sector that said logical address is shone upon, wherein said logical mappings table stores logical address and the corresponding relation that is used to replace the physical sector that damages the sector;
Step S104, said disk management device carries out the I/O operation according to said I/O request to said physical sector.
Wherein, the disk management device can be with the integrated setting of disk or independently is provided with, and the management and the response I/O request that are used to carry out disk space are carried out corresponding I/O operation to disk.Be that (Logic Block Address LBA) describes for example LBA (Logical Block Addressing) commonly used at present below with the logical address.
Particularly, Fig. 2 is the structural representation of disk.As shown in Figure 2, disk is made up of a lot of discs, and each face of each disc all has a read-write head (Heads); It is a plurality of cylinders (Cylinders) of axle, i.e. magnetic track with the electric machine main shaft that each disc has formed again in logic; Each magnetic track on each disc is divided into tens sectors (Sector), so the data areas on the disk is unique definite by magnetic head, cylinder and the sector institute at its place.Early stage system directly uses magnetic head, cylinder and sector to come disk is carried out addressing, i.e. the CHS addressing mode.When adopting the CHS addressing mode that disk is carried out addressing, system need store three parameters in each zone respectively, reads three parameters during use more respectively.Because system comes the storage head address with 8 (bit) usually; Store cylinder address with 10bit; Come the memory sector address with 6bit; And the capacity of each sector is 512 bytes (Byte); Use like this CHS addressing mode can addressing the disk max cap. be 256bit*1024bit*63bit*512Byte, be about 8.4G.
For more jumbo disk is managed, need to use the LBA addressing mode that disk is carried out addressing.In the LBA addressing mode; The actual physical address that does not re-use disk is carried out addressing; But the three-dimensional actual physical address (cylinder/magnetic head/sector) of hard disk changed into the linear addressing of one dimension; Promptly change all physical sectors of disk into linear numbering, i.e. LBA number through certain rule.When the visit disk, be actual physical address, i.e. physical sector with the LBA number translated of carrying in the I/O request by the disk management device.The physical sector of corresponding one 512 byte of each LBA number, the transformational relation between LBA number and the actual physical address is:
LBA=NH×NS×C+NS×H+S-1
C=(LBA?div?NS)div?NH
H=(LBA?div?NS)mod?NH
S=(LBA?mod?NS)+1
Wherein, NS is every magnetic track sector number, and NH is the magnetic head number, and C, H, S represent cylinder, magnetic head and the sector number of disk respectively, LBA presentation logic sector number, and div is for dividing exactly calculating, and mod is that complementation is calculated.
For realizing the disk management method of the foregoing description, need define some reserved sectors in advance in the disk, for when occurring damaging the sector, using as the replacement sector.More particularly, if a certain or a plurality of LBA number corresponding physical sector is damaged, the reserved sectors of then choosing same quantity replaces with the pairing physical sector of this one or more LBA number.Wherein, 1% of disk space specified or be defaulted as to the size of reserved sectors can by the user.For example, for a disk that has 16 magnetic surfaces, 1024 magnetic tracks and each disk that 63 sectors are arranged, 645 sectors can be set on each magnetic surface as reserved sectors.
Fig. 3 is the memory allocation synoptic diagram of disk.As shown in Figure 3, except that the data memory block, also preset a logical mappings table and a replacement bitmap in the disk.
Particularly, this logical mappings table position in disk is for example shown in Figure 3, is positioned at the afterbody storage space of disk.The logical mappings table is used for the corresponding relation between the actual physics sector of LBA number and disk of sector of memory disk, and it is index search corresponding physical sector with the LBA number.The structure of logical mappings table is as shown in table 1:
Table 1
LBA The place physical sector number
M a
N x
…… ……
X z
As shown in table 1, in each 32 system, a LBA number occupation space is 4 bytes, and a physical sector number occupation space is 4 bytes, and then a pair of corresponding relation occupation space is 8 bytes.The disk that with the storage space is 500G is an example; The quantity of its LBA number is about 1,000,000,000; If all in the logical mappings table, write down its corresponding physical sector number for each LBA number; 1,000,000,000 pairs of corresponding relations will take about 8G space so; Greatly wasted disk space, and made that also in the logical mappings table, to carry out the required consumed time of query manipulation long.Therefore also be provided with a replacement bitmap in the disk; So that in the logical mappings table only to the pairing physical sector of LBA number took place replacement situation, write down the LBA number and replace after physical sector between corresponding relation, thereby the corresponding relation quantity of significantly reducing required preservation in the logical mappings table.For example the pairing physical sector of LBA number " 1000 " damages in the disk; Then the blank position of disk management device in the logical mappings table writes down and the corresponding clauses and subclauses of LBA number " 1000 "; Promptly write " 1000 " on " LBA " hurdle; And from reserved sectors, select a physical sector, this physical sector number is write " place physical sector number " hurdle in these clauses and subclauses.The space of this logical mappings table can be set according to the quantity of reserved sectors; The disk that with the storage space is 500G is an example; If reserved 1% sector as being used to replace the reservation physical sector that damages the sector; Headspace is 5G; When the physical sector size is 512 bytes, preserves the corresponding LBA quantity of 5G headspace and the corresponding relation of physical sector and only need the storage space about 10M.
Particularly; The position of replacement bitmap in disk is for example shown in Figure 3; Be positioned at the least significant end storage space of disk; Promptly tell the bit number consistent as the replacement mark with available LBA number quantity in the last space of disk; These bit numbers are corresponding one by one with the LBA number respectively, and are arranged in order according to the order of LBA number.Be the disk of 500G for storage space for example, the quantity of its LBA number is about 1,000,000,000, then replaces the shared space of bitmap and only is about 125M.More particularly; Each bit in the replacement bitmap is " 0 " or " 1 "; " 0 " representes that replacement did not take place the physical sector at the pairing LBA number of this bit place, and " 1 " representes that replacement took place the physical sector at the pairing LBA number of this bit place.When the disk management device receives the I/O request that carries the LBA number; The value of searching the pairing bit of LBA number in the bitmap at first in replacement; " if 0 "; Know that then replacement did not take place the pairing physical sector of this LBA number; Then, for example search the corresponding physical sector for the transformational relation between above-mentioned LBA number and the actual physical address according to the acquiescence mode; If " 1 " knows that then replacement took place the pairing physical sector of this LBA number, then searched and the pairing physical sector of this LBA number in the logical mappings table.For example; The entrained LBA number of I/O request is 1000; And be that the value of 1000 corresponding bits is 1 with the LBA number in the replacement bitmap; Illustrate that then replacement took place the pairing physical sector of this LBA number; Searching the LBA number from the logical mappings table then is 1000 pairing physical sectors; Afterwards, can carry out corresponding I/O operation to this physical sector in the disk.
Disk management method according to the foregoing description; Because the disk management device is after receiving the I/O request; At first according to the replacement bitmap of disk detect this I/O request the LBA number corresponding physical sector that will visit whether replace; And when knowing the generation replacement; Physical sector after record logical address and the logical mappings table that is used for replacing the physical sector corresponding relation that damages the sector are searched replacement; The not damage physical sector after the replacement is carried out corresponding I/O operation; Thereby can realize damaging the dynamic management of sector in the disk by utilizing the reserved sectors replacement damage sector in the disk; In the dynamic management process; The disk management device only need be revised the corresponding replacement sign in the replacement bitmap and in the logical mappings table, write and be used to replace the physical sector number of damaging the sector; Just can in time accomplish the replacement that damages the sector; Thereby significantly improve the reliability and the security of disk, and reduced the time cost that disk management consumed.And through this disk management method, even if occurred in the disk partly damaging the sector, but free disk space does not reduce for system, so still onesize disk space that system is seen has been realized the transparency of disk to system.
In the disk management method of the foregoing description; Though is that example is illustrated with the logical address for the LBA number; But it should be appreciated by those skilled in the art that adopting arbitrarily, other logical addresses that can identify the disk physical sector all can be used in the above-mentioned disk management method that realizes.
Further, in the disk management method of the foregoing description, said disk management device also comprises the step that said physical sector carries out the I/O operation according to said I/O request afterwards:
Said disk management device knows that said physical sector is the damage sector, then selects the replacement sector from the reserved sectors of said disk if judge;
Said disk management device will be updated to selected replacement sector with said logical address corresponding physical sector in the said logical mappings table, and the replacement that the replacement sign corresponding with said logical address is set to be used to indicate said logical address corresponding physical sector that replacement had taken place in the said replacement bitmap identifies.
Particularly, if the disk management device to the I/O operation failure that physical sector carried out, need judge then whether this physical sector damages.If not, then return the notice of I/O failure to system; If be to search free sector then, and the physical sector number of the free sector that finds write in the corresponding logical mappings table clause of the entrained LBA number of this I/O request from reserved sectors.In addition, the disk management device also need be revised the replacement sign of this LBA number in the replacement bitmap, is about to replace bit value corresponding with this LBA number in the bitmap and is revised as " 1 ".
Disk management method according to the foregoing description; The disk management device can exist in knowing disk when damaging the sector; Automatically from reserved sectors, distribute a normal sector to replace and damage the sector; This process does not need artificial participation and need not to depend on third party's instrument; And because replacement process only is the pairing physical sector of dynamic adjustments LBA number; File system is felt replacement process, so the business of file system can not interrupted.
Further, in the disk management method of the foregoing description, the reserved sectors of said disk is distributed in each magnetic track of said disk, correspondingly, from the reserved sectors of said disk, selects the step of replacement sector to comprise:
The reserved sectors that said disk management device is selected to be positioned at same track with said physical sector from the reserved sectors of said disk is as said replacement sector.
That is, be not that all reserved sectors are placed on an appointed positions, the trailing space of disk for example, but with these reserved sectors proportionally average mark fit in each magnetic track.For example, 6 reserved sectors can be set on each magnetic track for a disk that has 16 magnetic surfaces, 1024 magnetic tracks and each disk that 63 sectors are arranged.
Disk management method according to the foregoing description; Because mechanical disk is the positioning function through mechanical wall; The magnetic track of head position at the data place; Rotation through magnetic surface is to carry out the access of data to corresponding sector again; This process is the moving process of pure machinery; For the mechanical disk of present main flow, this process need expends 10ms.So for an I/O operation, the spent time is directly proportional with the distance that machinery moves.In the disk management method of the foregoing description; Through with the reserved sectors mean allocation in each magnetic track; And when having the damage sector in a certain magnetic track; The disk management assembly first selects for use the reserved sectors of same magnetic track to replace damaging the sector; So when the physical sector after the replacement is carried out the I/O operation; Move to the mechanical arm that damages the sector and need not again that generating mechanism moves, thereby reduced the mechanical displacement of mechanical arm, improved the I/O operating efficiency of carrying out after the replacement of sector.
Further, in the disk management method of the foregoing description, said disk management device also comprises before receiving the step of I/O request of logical address of the sector that carries disk:
Said disk management device reads and is stored to local random access memory (RAM) with said replacement bitmap and the said logical mappings table of storing in the said disk; Correspondingly, said disk management device also comprises the step that said physical sector carries out the I/O operation according to said I/O request afterwards:
Said disk management device upgrades replacement bitmap and the logical mappings table of storing in the said disk according to replacement bitmap of storing among the said RAM and logical mappings table.
Particularly, will to replace the start address that bitmap reads among the RAM be one section continuation address space of P to the disk management device.Because the corresponding bit of LBA number is continuous in the replacement bitmap; So when the disk management device need be searched LBA number during for the replacement of L sign; Only need check that the address gets final product for (P+L-1) pairing value among the RAM, the needed time of this process is O (1).The disk management device is one section continuation address space of P ' with the start address that the logical mappings table reads among the RAM; When the disk management device need be searched LBA number during for the physical space after the corresponding replacement of the logical address of L; Only need get final product by P ' beginning traversal queries from the address, the needed time of this process also is O (1).
Disk management method according to the foregoing description; Because will replace bitmap and logical mappings table in advance reads among the local RAM; So converting the read operation that needs in the I/O processing procedure replacement bitmap and logical mappings table are carried out and/or write operation into local RAM by disk operating operates; So greatly improved treatment effeciency, made that the performed query script to replacement bitmap and logical mappings table can not have influence on system performance after receiving the I/O request.
Further, in the disk management method of the foregoing description, said disk management device also comprises the step that said physical sector carries out the I/O operation according to said I/O request afterwards:
Said disk management device upgrades the backup mapping table of storing in the said disk based on the logical mappings table of storing among the said RAM.
Particularly; Because the real physical sector at the in store data of logical mappings table place; In order to improve the data in magnetic disk safety of access, also can in disk, preset a backup mapping table, this backup mapping table can leave storage space adjacent with the logical mappings epiphase in the disk in.When the disk management device is made amendment to the logical mappings table and is write back to amended logical mappings table in the disk; Simultaneously amended logical mappings table is write in the backup mapping table; Thereby when the logical mappings table in the disk goes wrong, can read the LBA number of generation replacement and the map information of physical sector from the backup mapping table.
Fig. 4 carries out the detail flowchart of disk management method of the present invention for the disk management device.As shown in Figure 4, the disk management method of disk management device execution the foregoing description can adopt following flow process:
Whether step S1 after the disk management device starts, detects and formats diskette; If, execution in step S2 then, if not, execution in step S3 then;
Step S2 is provided with headspace, the logical mappings table of disk and replaces bitmap; Particularly, obtain the headspace size of appointment, then disk is not carried out the headspace setting, and empty logical mappings table and replacement bitmap according to default value (for example being 1%) if specify; Afterwards, execution in step S3;
Step S3, the logical mappings table in the reading disk position P1 in the RAM, read the replacement bitmap to the position P2;
Step S4 receives I/O request, and extracting entrained LBA number of I/O request is M;
Step S5 searches the replacement bitmap among the RAM according to M;
Step S6, according to the replacement sign corresponding with M that from the replacement bitmap, finds, whether judgement is the damage sector that replacement took place with the pairing physical sector of M; If, execution in step S7 then, if not, execution in step S8 then;
Step S7 is that the logical mappings table of index in RAM searched and M corresponding physical sector with M; Afterwards, execution in step S9;
Step S8 searches and M corresponding physical sector according to the transformation rule of LBA and physical sector; Afterwards, execution in step S9;
Step S9 carries out the I/O operation to the physical sector that is found;
Step S10 judges whether the I/O operation fails; If not, then return the I/O success, finish this time I/O operation; If, execution in step S11 then;
Step S11 judges whether the physical sector that is found is to damage the sector; If not, execution in step S15 then, if, execution in step S12 then;
Step S12 searches idle reserved sectors on the magnetic track corresponding with M, and upgrades the logical mappings table; Particularly,, then search idle reserved sectors, by that analogy, the reserved sectors that finds is write position corresponding with M in the logical mappings table from next magnetic track of current track if the reserved sectors on the magnetic track corresponding with M all runs out of;
Step S13 upgrades the replacement bitmap; Particularly, replacement sign corresponding with M in the replacement bitmap is revised as 1;
Step S14 writes back disk with this lastest imformation; Particularly, the disk management device for example before each shutdown, is written to up-to-date logical mappings table among the RAM and replacement bitmap in the disk, so that the former logical mappings table in the disk, backup mapping table and replacement bitmap are upgraded; Afterwards, execution in step S15;
Step S15 returns the I/O failure, and finishes this I/O operation, so that upper procedure is initiated the I/O request again.
Fig. 5 is the structural representation of disk management device of the present invention.As shown in Figure 5, this disk management device comprises:
I/O asks receiver module, is used to receive the I/O request of the logical address of the sector that carries disk;
The replacement sign is searched module, is used for searching the replacement sign corresponding with said logical address from the pre-set replaced bitmap;
Physical sector is searched module; Be used for if know that based on the replacement sign of being searched replacement took place the pairing physical sector of said logical address; Then from the logical mappings table, search the physical sector that said logical address is shone upon, wherein said logical mappings table stores said logical address and the corresponding relation that is used to replace the physical sector that damages the sector;
The I/O operational module is used for according to said I/O request said physical sector being carried out the I/O operation.
The flow process that the disk management device of the foregoing description is carried out disk management is identical with the disk management method of previous embodiment, so locate to repeat no more.
Disk management device according to the foregoing description; Because after receiving the I/O request; At first according to the replacement bitmap of disk detect this I/O request the LBA number corresponding physical sector that will visit whether replace; And when knowing the generation replacement; Physical sector after record logical address and the logical mappings table that is used for replacing the physical sector corresponding relation that damages the sector are searched replacement; The not damage physical sector after the replacement is carried out corresponding I/O operation; Thereby can realize damaging the dynamic management of sector in the disk by utilizing the reserved sectors replacement damage sector in the disk; In the dynamic management process; The disk management device only need be revised the corresponding replacement sign in the replacement bitmap and in the logical mappings table, write and be used to replace the physical sector number of damaging the sector; Just can in time accomplish the replacement that damages the sector; Thereby significantly improve the reliability and the security of disk, and reduced the time cost that disk management consumed.And; Through utilizing this disk management device, even if occurred in the disk partly damaging the sector, but free disk space does not reduce for system; So still onesize disk space that system is seen has been realized the transparency of disk to system.
Further; In the disk management device of the foregoing description; Said physical sector is searched module and also is used for then searching and the pairing physical sector of said logical address according to default rule as if knowing that according to the replacement sign of being searched replacement did not take place the pairing physical sector of said logical address.
Further, in the disk management device of the foregoing description, also comprise:
Module is selected in the sector, is used for knowing that said physical sector is the damage sector, then selects to be used to replace the physical sector that damages the sector from the reserved sectors of said disk if judge;
Sector replacement module; Be used for said logical mappings table and said logical address corresponding physical sector are updated to selected physical sector, and the replacement that the replacement sign corresponding with said logical address is set to be used to indicate said logical address corresponding physical sector that replacement had taken place in the said replacement bitmap identifies.
Can in knowing disk, exist when damaging the sector according to the disk management device of the foregoing description; Automatically from reserved sectors, distribute a normal sector to replace and damage the sector; This process does not need artificial participation and need not to depend on third party's instrument; And because replacement process only is the pairing physical sector of dynamic adjustments LBA number; File system is felt replacement process, so the business of file system can not interrupted.
Further; In the disk management device of the foregoing description; The reserved sectors of said disk is distributed in each magnetic track of said disk; Correspondingly, said sector selects module also to be used for being used to replace the physical sector that damages the sector from the reserved sectors conduct that the reserved sectors of said disk is selected to be positioned at same track with said physical sector.
Based on the disk management device of the foregoing description, can effectively improve the I/O operating efficiency of carrying out after replace the sector.
Further, in the disk management device of the foregoing description, also comprise:
Read module, the said replacement bitmap and the said logical mappings table that are used for said disk is stored read and are stored to local random access memory ram;
Update module, the replacement bitmap and the logical mappings table that are used for storing based on said RAM upgrade replacement bitmap and the logical mappings table of storing in the said disk.
Disk management device according to the foregoing description; Because will replace bitmap and logical mappings table in advance reads among the local RAM; And replacement bitmap and the logical mappings table that after I/O finishes, will revise write back in the disk; So converting the read operation that needs in the I/O processing procedure replacement bitmap and logical mappings table are carried out and/or write operation into local RAM by disk operating operates; So greatly improved treatment effeciency, made that the performed query script to replacement bitmap and logical mappings table can not have influence on system performance after receiving the I/O request.
Further, in the disk management device of the foregoing description, the logical mappings table that said update module also is used for storing according to said RAM upgrades the backup mapping table of storing in the said disk.
According to the disk management device of the foregoing description, can effectively improve the data in magnetic disk safety of access.
The present invention also provides a kind of network equipment, comprises the disk management device of above-mentioned arbitrary embodiment.
Particularly, this network equipment can be the arbitrary network equipment that is arranged in the network, need carries out the I/O operation to disk, for example for needing a large amount of network operations informations is recorded the fire wall card in the disk and exports gateway etc.
What should illustrate at last is: above embodiment is only in order to illustrating technical scheme of the present invention, but not to its restriction; Although with reference to previous embodiment the present invention has been carried out detailed explanation, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these are revised or replacement, do not make the spirit and scope of the essence disengaging various embodiments of the present invention technical scheme of relevant art scheme.

Claims (13)

1. a disk management method is characterized in that, comprising:
The disk management device receives the I/O I/O request of the logical address of the sector that carries disk;
Said disk management device is searched the replacement sign corresponding with said logical address from the pre-set replaced bitmap;
Said disk management device is if know that based on the replacement sign of being searched replacement took place the pairing physical sector of said logical address; Then from the logical mappings table, search the physical sector that said logical address is shone upon, wherein said logical mappings table stores said logical address and the corresponding relation that is used to replace the physical sector that damages the sector;
Said disk management device carries out the I/O operation according to said I/O request to said physical sector.
2. disk management method according to claim 1 is characterized in that, said disk management device is searched the replacement sign corresponding with said logical address from the pre-set replaced bitmap step also comprises afterwards:
Said disk management device is then searched and the pairing physical sector of said logical address according to default rule if know that according to the replacement sign of being searched replacement did not take place the pairing physical sector of said logical address.
3. disk management method according to claim 1 and 2 is characterized in that, said disk management device also comprises the step that said physical sector carries out the I/O operation according to said I/O request afterwards:
Said disk management device knows that said physical sector is the damage sector, then selects to be used to replace the physical sector that damages the sector from the reserved sectors of said disk if judge;
Said disk management device will be updated to selected physical sector with said logical address corresponding physical sector in the said logical mappings table, and the replacement that the replacement sign corresponding with said logical address is set to be used to indicate said logical address corresponding physical sector that replacement had taken place in the said replacement bitmap identifies.
4. disk management method according to claim 3 is characterized in that, the reserved sectors of said disk is distributed in each magnetic track of said disk, correspondingly, from the reserved sectors of said disk, selects the step of replacement sector to comprise:
The reserved sectors that said disk management device is selected to be positioned at same track with said physical sector from the reserved sectors of said disk is as being used to replace the physical sector that damages the sector.
5. disk management method according to claim 3 is characterized in that, said disk management device also comprises before receiving the step of I/O request of logical address of the sector that carries disk:
Said disk management device reads and is stored to local random access memory ram with said replacement bitmap and the said logical mappings table of storing in the said disk; Correspondingly, said disk management device also comprises the step that said physical sector carries out the I/O operation according to said I/O request afterwards:
Said disk management device upgrades replacement bitmap and the logical mappings table of storing in the said disk according to replacement bitmap of storing among the said RAM and logical mappings table.
6. disk management method according to claim 5 is characterized in that, said disk management device also comprises the step that said physical sector carries out the I/O operation according to said I/O request afterwards:
Said disk management device upgrades the backup mapping table of storing in the said disk based on the logical mappings table of storing among the said RAM.
7. a disk management device is characterized in that, comprising:
I/O asks receiver module, is used to receive the I/O request of the logical address of the sector that carries disk;
The replacement sign is searched module, is used for searching the replacement sign corresponding with said logical address from the pre-set replaced bitmap;
Physical sector is searched module; Be used for if know that based on the replacement sign of being searched replacement took place the pairing physical sector of said logical address; Then from the logical mappings table, search the physical sector that said logical address is shone upon, wherein said logical mappings table stores said logical address and the corresponding relation that is used to replace the physical sector that damages the sector;
The I/O operational module is used for according to said I/O request said physical sector being carried out the I/O operation.
8. disk management device according to claim 7; It is characterized in that; Said physical sector is searched module and also is used for then searching and the pairing physical sector of said logical address according to default rule as if knowing that according to the replacement sign of being searched replacement did not take place the pairing physical sector of said logical address.
9. according to claim 7 or 8 described disk management devices, it is characterized in that, also comprise:
Module is selected in the sector, is used for knowing that said physical sector is the damage sector, then selects to be used to replace the physical sector that damages the sector from the reserved sectors of said disk if judge;
Sector replacement module; Be used for said logical mappings table and said logical address corresponding physical sector are updated to selected physical sector, and the replacement that the replacement sign corresponding with said logical address is set to be used to indicate said logical address corresponding physical sector that replacement had taken place in the said replacement bitmap identifies.
10. disk management device according to claim 9; It is characterized in that; The reserved sectors of said disk is distributed in each magnetic track of said disk; Correspondingly, said sector selects module also to be used for being used to replace the physical sector that damages the sector from the reserved sectors conduct that the reserved sectors of said disk is selected to be positioned at same track with said physical sector.
11. disk management device according to claim 9 is characterized in that, also comprises:
Read module, the said replacement bitmap and the said logical mappings table that are used for said disk is stored read and are stored to local random access memory ram;
Update module, the replacement bitmap and the logical mappings table that are used for storing based on said RAM upgrade replacement bitmap and the logical mappings table of storing in the said disk.
12. disk management device according to claim 11 is characterized in that, the logical mappings table that said update module also is used for storing according to said RAM upgrades the backup mapping table of storing in the said disk.
13. a network equipment is characterized in that, comprises like the arbitrary described disk management device of claim 7 to 12.
CN2011102761821A 2011-09-16 2011-09-16 Disk management method and device and network equipment Expired - Fee Related CN102306128B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011102761821A CN102306128B (en) 2011-09-16 2011-09-16 Disk management method and device and network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011102761821A CN102306128B (en) 2011-09-16 2011-09-16 Disk management method and device and network equipment

Publications (2)

Publication Number Publication Date
CN102306128A true CN102306128A (en) 2012-01-04
CN102306128B CN102306128B (en) 2013-11-20

Family

ID=45379993

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011102761821A Expired - Fee Related CN102306128B (en) 2011-09-16 2011-09-16 Disk management method and device and network equipment

Country Status (1)

Country Link
CN (1) CN102306128B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014019360A1 (en) * 2012-07-31 2014-02-06 华为技术有限公司 Method and device for remapping a disk
CN104615504A (en) * 2015-02-06 2015-05-13 浪潮(北京)电子信息产业有限公司 Method and device for achieving data protection
CN106055279A (en) * 2016-06-12 2016-10-26 浪潮(北京)电子信息产业有限公司 Method and device for managing address mapping table of solid state disk and solid state disk
CN107239233A (en) * 2017-05-10 2017-10-10 杭州宏杉科技股份有限公司 A kind of disk array and data reconstruction method and storage device based on it
CN107872486A (en) * 2016-09-28 2018-04-03 华为技术有限公司 Communication means and device
CN109582237A (en) * 2018-11-30 2019-04-05 上海工程技术大学 A kind of bad sector mapping method based on mechanical hard disk

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1143812A (en) * 1995-08-18 1997-02-26 三菱电机株式会社 Memory device
US20010018731A1 (en) * 2000-02-24 2001-08-30 Nec Corporation Memory management device and memory management method thereof
CN1862476A (en) * 2006-04-19 2006-11-15 华中科技大学 Super large capacity virtual magnetic disk storage system
CN101329641A (en) * 2008-06-11 2008-12-24 华中科技大学 Method for rebuilding data of magnetic disk array

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1143812A (en) * 1995-08-18 1997-02-26 三菱电机株式会社 Memory device
US20010018731A1 (en) * 2000-02-24 2001-08-30 Nec Corporation Memory management device and memory management method thereof
CN1862476A (en) * 2006-04-19 2006-11-15 华中科技大学 Super large capacity virtual magnetic disk storage system
CN101329641A (en) * 2008-06-11 2008-12-24 华中科技大学 Method for rebuilding data of magnetic disk array

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014019360A1 (en) * 2012-07-31 2014-02-06 华为技术有限公司 Method and device for remapping a disk
CN104615504A (en) * 2015-02-06 2015-05-13 浪潮(北京)电子信息产业有限公司 Method and device for achieving data protection
CN104615504B (en) * 2015-02-06 2017-11-10 浪潮(北京)电子信息产业有限公司 A kind of method and device for realizing data protection
CN106055279A (en) * 2016-06-12 2016-10-26 浪潮(北京)电子信息产业有限公司 Method and device for managing address mapping table of solid state disk and solid state disk
CN106055279B (en) * 2016-06-12 2019-05-10 浪潮(北京)电子信息产业有限公司 Manage the method, apparatus and solid state hard disk of the address mapping table of solid state hard disk
CN107872486A (en) * 2016-09-28 2018-04-03 华为技术有限公司 Communication means and device
CN107872486B (en) * 2016-09-28 2020-06-02 华为技术有限公司 Communication method and device
CN107239233A (en) * 2017-05-10 2017-10-10 杭州宏杉科技股份有限公司 A kind of disk array and data reconstruction method and storage device based on it
CN109582237A (en) * 2018-11-30 2019-04-05 上海工程技术大学 A kind of bad sector mapping method based on mechanical hard disk
CN109582237B (en) * 2018-11-30 2021-12-17 上海工程技术大学 Bad sector mapping method based on mechanical hard disk

Also Published As

Publication number Publication date
CN102306128B (en) 2013-11-20

Similar Documents

Publication Publication Date Title
CN102508784B (en) Data storage method of flash memory card in video monitoring equipment, and system thereof
CN102306128B (en) Disk management method and device and network equipment
US9817588B2 (en) Memory device and operating method of same
CN101504672B (en) Method and system for dynamically configuring physical data table
CN109783017B (en) Storage device bad block processing method and device and storage device
CN101840380B (en) Apparatus and method to protect metadata against unexpected power down
CN104461391A (en) Method and system for managing and processing metadata of storage equipment
JP6178859B2 (en) Database storage system based on optical disk and method of using the same
CN100426259C (en) Virtual access method of storage document data
CN102096561B (en) Hierarchical data storage processing method, device and storage equipment
CN104461390A (en) Method and device for writing data into imbricate magnetic recording SMR hard disk
CN101916290B (en) Managing method of internal memory database and device
CN104750565A (en) NAND bad block processing method and NAND flash memory device
CN101645043B (en) Methods for reading and writing data and memory device
CN104220991A (en) Architecture to allow efficient storage of data on nand flash memory
CN109144886A (en) Data storage device
CN102779096A (en) Page, block and face-based three-dimensional flash memory address mapping method
CN103049224B (en) By the methods, devices and systems of data importing physical tape
CN105446664B (en) A kind of pair of memory carries out file memory method and storage device
CN102959548B (en) Date storage method, lookup method and device
CN104598165A (en) Method and device for improving durability of storage on embedded equipment
CN103544124B (en) The access method of Nand flash storages
CN103430178A (en) Method, apparatus and product of data updating
CN111562882A (en) Data writing method, intelligent terminal and storage medium
CN101303667B (en) Method and device for establishing magnetic disk null cluster table and seeking magnetic disk null cluster

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20131120

Termination date: 20210916