CN111694506A - Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium - Google Patents

Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium Download PDF

Info

Publication number
CN111694506A
CN111694506A CN201910199598.4A CN201910199598A CN111694506A CN 111694506 A CN111694506 A CN 111694506A CN 201910199598 A CN201910199598 A CN 201910199598A CN 111694506 A CN111694506 A CN 111694506A
Authority
CN
China
Prior art keywords
disk
capacity
block address
magnetic disk
physical storage
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
CN201910199598.4A
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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910199598.4A priority Critical patent/CN111694506A/en
Publication of CN111694506A publication Critical patent/CN111694506A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0632Configuration or reconfiguration of storage systems by initialisation or re-initialisation of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0615Address space extension
    • G06F12/0623Address space extension for memory modules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Abstract

The embodiment of the invention provides a method and a device for determining the total capacity of a disk, the disk and a machine-readable storage medium, wherein the method for determining the total capacity of the disk comprises the following steps: after obtaining a reading instruction of the actual physical storage total capacity of the disk, a control unit in the disk reads the maximum logical block address of the actual physical storage total capacity of the disk stored when the disk is formatted, and the actual physical storage total capacity of the disk is obtained through conversion according to the maximum logical block address. By the scheme, the actual physical storage total capacity of the disk can be fed back to the disk user, and more actual storage space is provided for the disk user compared with the nominal capacity.

Description

Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium
Technical Field
The invention relates to the technical field of computer data storage, in particular to a method and a device for determining the total capacity of a disk, the disk and a machine-readable storage medium.
Background
The external memory of the computer is generally a magnetic disk, and the round magnetic disk is contained in a sealed box to prevent the surface of the magnetic disk from being scratched to cause data loss. The magnetic disk mainly comprises a plurality of magnetic disks, and each magnetic disk is used for storing data.
In the production and manufacturing process of the magnetic disk, the capacity of each disk can be carried by different quantities due to various reasons such as quality, and assuming that the capacities carried by the disks in a disk are m1, m2, m3, … and mx respectively, the total capacity actually carried by the disk should theoretically be m1+ m2+ m3+ … + mx.
In a conventional magnetic disk, in order to unify the capacities of a certain type of magnetic disk, a unified basic capacity, that is, a capacity that each magnetic disk can bear is often set for the type of magnetic disk. However, different disks of the same model may have different actual capacities due to different disk capacities, so that the set basic capacity of the disk is often smaller than the actual total capacity of the disk, resulting in that the storage space provided for users by some disks of the model is smaller than the storage space actually available.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for determining the total capacity of a disk, the disk and a machine-readable storage medium, so as to provide more storage space for disk users. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for determining a total disk capacity, where the method includes:
acquiring a reading instruction of the actual physical storage total capacity of the disk;
reading the maximum logical block address of the actual physical storage total capacity of the magnetic disk stored when the magnetic disk is formatted;
and converting the maximum logical block address to obtain the actual physical storage total capacity of the magnetic disk.
Optionally, the formatting manner of the disk includes:
carrying out capacity division on all the magnetic disks in the magnetic disk, and carrying out formatting treatment on each magnetic disk;
and mapping the physical block address and the logical block address according to the physical block address of each magnetic disk to obtain the maximum logical block address of the magnetic disk.
Optionally, after the actual total physical storage capacity of the disk is obtained by scaling according to the maximum logical block address, the method further includes:
acquiring a capacity setting instruction, wherein the capacity setting instruction comprises a specified target capacity, and the target capacity is smaller than or equal to the actual physical storage total capacity;
and setting the nominal capacity of the disk as the target capacity, and storing the target capacity.
Optionally, after setting the nominal capacity of the disk to the target capacity and storing the target capacity, the method further includes:
acquiring a nominal capacity reading instruction;
reading the target capacity of storage.
In a second aspect, an embodiment of the present invention provides an apparatus for determining total disk capacity, where the apparatus includes:
the acquisition module is used for acquiring a reading instruction of the actual physical storage total capacity of the disk;
the reading module is used for reading the maximum logical block address of the actual physical storage total capacity of the stored magnetic disk when the magnetic disk is formatted;
and the conversion module is used for converting the maximum logical block address to obtain the actual physical storage total capacity of the magnetic disk.
Optionally, the apparatus further comprises:
the dividing module is used for carrying out capacity division on all the magnetic disks in the magnetic disks and carrying out formatting treatment on each magnetic disk;
and the mapping module is used for mapping the physical block address and the logical block address according to the physical block address of each magnetic disk to obtain the maximum logical block address of the magnetic disk.
Optionally, the obtaining module is further configured to obtain a capacity setting instruction, where the capacity setting instruction includes a specified target capacity, and the target capacity is smaller than or equal to the actual total physical storage capacity;
the device further comprises:
and the setting module is used for setting the nominal capacity of the disk to be the target capacity and storing the target capacity.
Optionally, the obtaining module is further configured to obtain a nominal capacity reading instruction;
the reading module is further configured to read the stored target capacity.
In a third aspect, an embodiment of the present invention provides a magnetic disk, where the magnetic disk includes: a plurality of magnetic disks, a control unit and a servo system; the control unit comprises a processor and a memory;
the magnetic disc is used for storing data;
the servo system is used for managing and serving the magnetic disk storage data;
the memory for storing machine executable instructions executable by the processor;
the processor is configured to be caused by machine executable instructions stored on the memory to perform a method according to the first aspect of an embodiment of the present invention.
In a fourth aspect, the present invention provides a machine-readable storage medium, in which machine-executable instructions are stored, and when the machine-executable instructions are executed by a processor, the method according to the first aspect of the present invention is performed.
In the method and the device for determining the total disk capacity, the disk and the machine-readable storage medium provided by the embodiments of the present invention, after obtaining the read instruction of the actual physical storage total capacity of the disk, the control unit in the disk reads the maximum logical block address of the actual physical storage total capacity of the disk stored when the disk is formatted, and converts the maximum logical block address to obtain the actual physical storage total capacity of the disk. When the disk is formatted, the control unit in the disk can record the maximum logical block address of the actual physical storage total capacity of the disk, and a certain conversion relation exists between the logical block address and the actual capacity, so that after a reading instruction of the actual physical storage total capacity of the disk, which is input by a disk user, is obtained, the control unit can directly obtain the actual physical storage total capacity of the disk through conversion, and then the actual physical storage total capacity of the disk is fed back to the disk user, so that the disk user can know the actual physical storage total capacity of the disk, and more actual storage space is provided for the disk user compared with the nominal capacity.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for determining total disk capacity according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for determining total disk capacity according to another embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an apparatus for determining total disk capacity according to an embodiment of the present invention;
FIG. 4 is a diagram of a magnetic disk according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to provide more storage space for a disk user, embodiments of the present invention provide a method and an apparatus for determining a total disk capacity, a disk, and a machine-readable storage medium.
Next, a method for determining the total disk capacity according to an embodiment of the present invention is described first.
The execution main body of the method for determining the total capacity of the disk provided by the embodiment of the invention can be the disk, and specifically, the capacity of the disk can be managed by a control unit in the disk. The method for determining the total disk capacity provided by the embodiment of the invention can be implemented in at least one of software, hardware circuit and logic circuit arranged in the control unit. The control unit mentioned here may be an executable hardware unit provided with FW (firmware).
As shown in fig. 1, a method for determining total disk capacity according to an embodiment of the present invention may include the following steps:
s101, obtaining a reading instruction of the actual physical storage total capacity of the magnetic disk.
When a user needs to read the actual physical storage total capacity of the disk, a corresponding reading instruction can be input on an interactive interface of the computer, and the reading instruction is acquired by a control unit in the disk. The read command generally includes the model number of the disk, the serial number of the disk, and other attribute information of the disk to specify which disk needs to be read.
The read command for the total actual physical storage capacity of the disk is different from the standard command READ CAPACITY (nominal capacity read command), and is a newly set command in which some specified fields are different from the corresponding fields in the standard command in content, or in command code, so as to distinguish the specified fields from the corresponding fields. In order to more intuitively distinguish the read command of the total actual physical storage capacity of the disk from the standard command, the name of the read command of the total actual physical storage capacity of the disk may be set to be different from that of the standard command, and may be named READ CAPACITY extension, for example. The control unit, upon recognizing the command named READCAPACITY EXTEND, determines that a read operation is required for the actual total physical storage capacity of the disk.
S102, reading the maximum logical block address of the actual physical storage total capacity of the magnetic disk stored when the magnetic disk is formatted.
In the production design process of the disk, namely before the disk is put into use formally, formatting is required, the formatting process can be executed by a disk manufacturer when the disk is produced, or a disk user initiates a formatting instruction, and the disk is formatted by the control unit. The formatting mainly includes capacity division of all disks and formatting of each disk. During formatting, the PBA (physical Block Address) of each part in the disk can be determined, and since the PBA and the LBA (Logical Block Address) have a corresponding relationship, the maximum LBA of the disk can be obtained.
Optionally, the formatting manner of the disk may include the following steps:
carrying out capacity division on all the magnetic disks in the magnetic disk, and carrying out formatting treatment on each magnetic disk;
and mapping the physical block address and the logical block address according to the physical block address of each magnetic disk to obtain the maximum logical block address of the magnetic disk.
When formatting a disk, it is first necessary to perform capacity division on all disks in the disk, that is, the disk is divided into a plurality of blocks, each block is a disk, and the capacities of the disks are not equal. When the magnetic disk is formatted, the PBA of each magnetic disk can be obtained, where the PBA is the specific physical location of each magnetic disk in the magnetic disk, and each PBA maps one LBA correspondingly, where the LBA refers to an address of a certain area block or an area block pointed at a certain address.
Because one PBA is mapped correspondingly, the LBA mapped by the first PBA is 0, and the LBA mapped by the last PBA is the maximum LBA, the maximum LBA obtained by mapping is stored in the storage medium of the PBA, so that when a reading instruction of the actual physical storage total capacity of the magnetic disk is obtained, the maximum LBA of the magnetic disk can be read from the storage medium of the magnetic disk.
And S103, converting the actual physical storage total capacity of the disk according to the maximum logical block address.
Since the actual size of 1 LBA is 512bytes, when the maximum LBA of the disk is read, the capacity of the disk may be determined, that is, the actual capacity of the disk is equal to the maximum LBA of the disk × 512 bytes. For example, if the maximum LBA of the disk is 7814037167, the number of the shared logical blocks is 7814037168, and therefore, the total capacity of the disk is 7814037168 × 512bytes is 3.638671875 TB.
By applying the embodiment of the invention, after the control unit in the disk obtains the reading instruction of the actual physical storage total capacity of the disk, the maximum logical block address of the actual physical storage total capacity of the disk stored in the disk during disk formatting is read, and the actual physical storage total capacity of the disk is obtained through conversion according to the maximum logical block address. When the disk is formatted, the control unit in the disk can record the maximum logical block address of the actual physical storage total capacity of the disk, and a certain conversion relation exists between the logical block address and the actual capacity, so that after a reading instruction of the actual physical storage total capacity of the disk, which is input by a disk user, is obtained, the control unit can directly obtain the actual physical storage total capacity of the disk through conversion, and then the actual physical storage total capacity of the disk is fed back to the disk user, so that the disk user can know the actual physical storage total capacity of the disk, and more actual storage space is provided for the disk user compared with the nominal capacity.
Based on the embodiment shown in fig. 1, an embodiment of the present invention further provides a method for determining a total disk capacity, as shown in fig. 2, the method for determining the total disk capacity may include the following steps:
s201, obtaining a reading instruction of the actual physical storage total capacity of the disk.
S202, reading the maximum logical block address of the actual physical storage total capacity of the magnetic disk stored when the magnetic disk is formatted.
And S203, converting the actual physical storage total capacity of the disk according to the maximum logical block address.
S201, S202, and S203 in this embodiment correspond to S101, S102, and S103 in the embodiment shown in fig. 1, respectively, and are the same or similar steps, which are not described herein again.
S204, acquiring a capacity setting instruction, wherein the capacity setting instruction comprises a specified target capacity, and the target capacity is smaller than or equal to the actual physical storage total capacity of the disk.
After acquiring the actual total physical storage capacity of the disk, the disk user may send a capacity setting instruction to the disk, so as to permanently set a target capacity that the user wants to set, so as to meet the requirement of the service mode of the user, where the target capacity may be less than or equal to the actual total physical storage capacity of the disk. The capacity setting instruction may be a SCSI (Small Computer system interface) command, specifically, a MODE SELECT instruction in the SCSI command may be used, and the setting OF the disk capacity may be completed by setting a General MODE parameter BLOCK description parameter, in particular, a NUMBER OF BLOCKS and a BLOCK LENGTH parameter in the command.
S205, setting the nominal capacity of the disk as the target capacity, and storing the target capacity.
After receiving the capacity setting instruction, the control unit analyzes the capacity setting instruction to obtain a target capacity set by a user, and then the target capacity can be set as the nominal capacity of the disk, and the target capacity is stored, and the previous nominal capacity can be covered by adopting an overlapping storage mode during storage. After receiving the nominal capacity obtaining command sent by the user, the latest stored target capacity can be sent to the disk user.
Optionally, after executing S205, the method for determining the total disk capacity according to the embodiment of the present invention may further include the following steps:
acquiring a nominal capacity reading instruction; the target capacity of the storage is read.
After setting the nominal capacity of the disk to the target capacity, if the disk user requests to read the nominal capacity, the newly stored target capacity can be directly read out, and after reading the target capacity, it is sent to the disk user. The nominal capacity read command may be the READ CAPACITY command.
By applying the embodiment of the invention, after the control unit in the disk obtains the reading instruction of the actual physical storage total capacity of the disk, the maximum logical block address of the actual physical storage total capacity of the disk stored in the disk during disk formatting is read, and the actual physical storage total capacity of the disk is obtained through conversion according to the maximum logical block address. When the disk is formatted, the control unit in the disk can record the maximum logical block address of the actual physical storage total capacity of the disk, and a certain conversion relation exists between the logical block address and the actual capacity, so that after a reading instruction of the actual physical storage total capacity of the disk, which is input by a disk user, is obtained, the control unit can directly obtain the actual physical storage total capacity of the disk through conversion, and then the actual physical storage total capacity of the disk is fed back to the disk user, so that the disk user can know the actual physical storage total capacity of the disk, and more actual storage space is provided for the disk user compared with the nominal capacity. And the user can set the target capacity according with the self service mode through the capacity setting instruction so as to fully utilize the storage space of the disk.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a device for determining total disk capacity, where as shown in fig. 3, the device for determining total disk capacity may include:
an obtaining module 310, configured to obtain a read instruction of the actual total physical storage capacity of the disk;
a reading module 320, configured to read a maximum logical block address of an actual physical storage total capacity of a disk stored when the disk is formatted;
and the conversion module 330 is configured to convert the actual total physical storage capacity of the disk according to the maximum logical block address.
Optionally, the apparatus may further include:
the dividing module is used for carrying out capacity division on all the magnetic disks in the magnetic disks and carrying out formatting treatment on each magnetic disk;
and the mapping module is used for mapping the physical block address and the logical block address according to the physical block address of each magnetic disk to obtain the maximum logical block address of the magnetic disk.
Optionally, the obtaining module 310 may be further configured to obtain a capacity setting instruction, where the capacity setting instruction includes a specified target capacity, and the target capacity is smaller than or equal to the actual total physical storage capacity;
the apparatus may further include:
and the setting module is used for setting the nominal capacity of the disk to be the target capacity and storing the target capacity.
Optionally, the obtaining module 310 may be further configured to obtain a nominal capacity reading instruction;
the reading module 320 is further configured to read the stored target capacity.
By applying the embodiment of the invention, after the control unit in the disk obtains the reading instruction of the actual physical storage total capacity of the disk, the maximum logical block address of the actual physical storage total capacity of the disk stored in the disk during disk formatting is read, and the actual physical storage total capacity of the disk is obtained through conversion according to the maximum logical block address. When the disk is formatted, the control unit in the disk can record the maximum logical block address of the actual physical storage total capacity of the disk, and a certain conversion relation exists between the logical block address and the actual capacity, so that after a reading instruction of the actual physical storage total capacity of the disk, which is input by a disk user, is obtained, the control unit can directly obtain the actual physical storage total capacity of the disk through conversion, and then the actual physical storage total capacity of the disk is fed back to the disk user, so that the disk user can know the actual physical storage total capacity of the disk, and more actual storage space is provided for the disk user compared with the nominal capacity.
An embodiment of the present invention further provides a magnetic disk, and as shown in fig. 4, the magnetic disk may include: a plurality of disks 410, a control unit 420 and a servo system 430; the control unit 420 includes a processor 421 and a memory 422;
the magnetic disk 410 is used for storing data;
the servo system 430 is used for managing and servicing the disk storage data;
the memory 422 for storing machine executable instructions executable by the processor 421;
the processor 421 is configured to be caused by machine executable instructions stored in the memory 422 to perform the steps of the method for determining total disk capacity according to the embodiment of the present invention.
The Memory may include a RAM (Random Access Memory) or an NVM (Non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In the embodiment of the present invention, the processor 421 is caused by the machine executable instructions to implement, by reading the machine executable instructions stored in the memory 422: after obtaining a reading instruction of the actual physical storage total capacity of the disk, a control unit in the disk reads the maximum logical block address of the actual physical storage total capacity of the disk stored when the disk is formatted, and the actual physical storage total capacity of the disk is obtained through conversion according to the maximum logical block address. When the disk is formatted, the control unit in the disk can record the maximum logical block address of the actual physical storage total capacity of the disk, and a certain conversion relation exists between the logical block address and the actual capacity, so that after a reading instruction of the actual physical storage total capacity of the disk, which is input by a disk user, is obtained, the control unit can directly obtain the actual physical storage total capacity of the disk through conversion, and then the actual physical storage total capacity of the disk is fed back to the disk user, so that the disk user can know the actual physical storage total capacity of the disk, and more actual storage space is provided for the disk user compared with the nominal capacity.
The disk provided by the embodiment of the invention can be used for a general computer and a storage server; the disk provided by the embodiment of the invention can be used in the data storage field of IOT (Internet of Things) storage and the like.
In addition, the embodiment of the present invention further provides a machine-readable storage medium, where machine-executable instructions are stored in the machine-readable storage medium, and when the machine-executable instructions are executed by a processor, the steps of the method for determining the total capacity of a disk provided by the embodiment of the present invention are executed.
In this embodiment of the present invention, when running, the machine-readable storage medium executes the machine-executable instruction of the method for determining total disk capacity provided in the embodiment of the present invention, so that it is possible to implement: after obtaining a reading instruction of the actual physical storage total capacity of the disk, a control unit in the disk reads the maximum logical block address of the actual physical storage total capacity of the disk stored when the disk is formatted, and the actual physical storage total capacity of the disk is obtained through conversion according to the maximum logical block address. When the disk is formatted, the control unit in the disk can record the maximum logical block address of the actual physical storage total capacity of the disk, and a certain conversion relation exists between the logical block address and the actual capacity, so that after a reading instruction of the actual physical storage total capacity of the disk, which is input by a disk user, is obtained, the control unit can directly obtain the actual physical storage total capacity of the disk through conversion, and then the actual physical storage total capacity of the disk is fed back to the disk user, so that the disk user can know the actual physical storage total capacity of the disk, and more actual storage space is provided for the disk user compared with the nominal capacity.
For the embodiments of the magnetic disk and the machine-readable storage medium, the contents of the related methods are substantially similar to those of the foregoing method embodiments, so that the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the device, disk, and machine-readable storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for determining total capacity of a disk, the method comprising:
acquiring a reading instruction of the actual physical storage total capacity of the disk;
reading the maximum logical block address of the actual physical storage total capacity of the magnetic disk stored when the magnetic disk is formatted;
and converting the maximum logical block address to obtain the actual physical storage total capacity of the magnetic disk.
2. The method of claim 1, wherein the formatting of the disk comprises:
carrying out capacity division on all the magnetic disks in the magnetic disk, and carrying out formatting treatment on each magnetic disk;
and mapping the physical block address and the logical block address according to the physical block address of each magnetic disk to obtain the maximum logical block address of the magnetic disk.
3. The method of claim 1, wherein after scaling the actual total physical storage capacity of the disk according to the maximum logical block address, the method further comprises:
acquiring a capacity setting instruction, wherein the capacity setting instruction comprises a specified target capacity, and the target capacity is smaller than or equal to the actual physical storage total capacity;
and setting the nominal capacity of the disk as the target capacity, and storing the target capacity.
4. The method of claim 3, wherein after setting the nominal capacity of the disk to the target capacity and storing the target capacity, the method further comprises:
acquiring a nominal capacity reading instruction;
reading the target capacity of storage.
5. An apparatus for determining a total capacity of a disk, the apparatus comprising:
the acquisition module is used for acquiring a reading instruction of the actual physical storage total capacity of the disk;
the reading module is used for reading the maximum logical block address of the actual physical storage total capacity of the stored magnetic disk when the magnetic disk is formatted;
and the conversion module is used for converting the maximum logical block address to obtain the actual physical storage total capacity of the magnetic disk.
6. The apparatus of claim 5, further comprising:
the dividing module is used for carrying out capacity division on all the magnetic disks in the magnetic disks and carrying out formatting treatment on each magnetic disk;
and the mapping module is used for mapping the physical block address and the logical block address according to the physical block address of each magnetic disk to obtain the maximum logical block address of the magnetic disk.
7. The apparatus of claim 5,
the obtaining module is further configured to obtain a capacity setting instruction, where the capacity setting instruction includes a specified target capacity, and the target capacity is smaller than or equal to the actual total physical storage capacity;
the device further comprises:
and the setting module is used for setting the nominal capacity of the disk to be the target capacity and storing the target capacity.
8. The apparatus of claim 7,
the acquisition module is further used for acquiring a nominal capacity reading instruction;
the reading module is further configured to read the stored target capacity.
9. A magnetic disk, comprising: a plurality of magnetic disks, a control unit and a servo system; the control unit comprises a processor and a memory;
the magnetic disc is used for storing data;
the servo system is used for managing and serving the magnetic disk storage data;
the memory for storing machine executable instructions executable by the processor;
the processor, for causing execution of the method of any one of claims 1-4 by machine-executable instructions stored on the memory.
10. A machine-readable storage medium having stored therein machine-executable instructions which, when executed by a processor, perform the method of any one of claims 1-4.
CN201910199598.4A 2019-03-15 2019-03-15 Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium Pending CN111694506A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910199598.4A CN111694506A (en) 2019-03-15 2019-03-15 Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910199598.4A CN111694506A (en) 2019-03-15 2019-03-15 Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium

Publications (1)

Publication Number Publication Date
CN111694506A true CN111694506A (en) 2020-09-22

Family

ID=72475500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910199598.4A Pending CN111694506A (en) 2019-03-15 2019-03-15 Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium

Country Status (1)

Country Link
CN (1) CN111694506A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461137A (en) * 2021-12-23 2022-05-10 天翼云科技有限公司 Writing method and device based on solid hard disk

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004213365A (en) * 2002-12-27 2004-07-29 Yec:Kk Hard disk drive unit, data recording device, backup device, restore device, backup method, and computer program executable in computer for making computer function as back up device
US20040255093A1 (en) * 2003-06-12 2004-12-16 International Business Machines Corporation Method and system for simultaneously supporting different block sizes on a single hard drive
US20100057976A1 (en) * 2008-08-26 2010-03-04 Menahem Lasser Multiple performance mode memory system
CN101770781A (en) * 2008-12-29 2010-07-07 深圳易拓科技有限公司 Method for optimizing disk memory capacity
US20140208058A1 (en) * 2013-01-23 2014-07-24 Sony Corporation Storage device, and method of controlling the same
US20150293705A1 (en) * 2014-04-11 2015-10-15 Seagate Technology Llc Formatting and capacity expansion in a data storage device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004213365A (en) * 2002-12-27 2004-07-29 Yec:Kk Hard disk drive unit, data recording device, backup device, restore device, backup method, and computer program executable in computer for making computer function as back up device
US20040255093A1 (en) * 2003-06-12 2004-12-16 International Business Machines Corporation Method and system for simultaneously supporting different block sizes on a single hard drive
US20100057976A1 (en) * 2008-08-26 2010-03-04 Menahem Lasser Multiple performance mode memory system
CN101770781A (en) * 2008-12-29 2010-07-07 深圳易拓科技有限公司 Method for optimizing disk memory capacity
US20140208058A1 (en) * 2013-01-23 2014-07-24 Sony Corporation Storage device, and method of controlling the same
US20150293705A1 (en) * 2014-04-11 2015-10-15 Seagate Technology Llc Formatting and capacity expansion in a data storage device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461137A (en) * 2021-12-23 2022-05-10 天翼云科技有限公司 Writing method and device based on solid hard disk
CN114461137B (en) * 2021-12-23 2024-01-02 天翼云科技有限公司 Writing method and device based on solid state disk

Similar Documents

Publication Publication Date Title
CN102693184B (en) Handling dynamic and static data for a system having a non-volatile memory
US10977171B2 (en) Method for creating multi-namespace and accessing data therein
US7788441B2 (en) Method for initializing and operating flash memory file system and computer-readable medium storing related program
US20080195833A1 (en) Systems, methods and computer program products for operating a data processing system in which a file system's unit of memory allocation is coordinated with a storage system's read/write operation unit
US20140189674A1 (en) Information processing apparatus and information processing method
TW201539187A (en) Flash memory compression
US7971022B2 (en) Apparatus and method of processing data of non-volatile memory using transaction block
CN104699417A (en) Data storage device and data access method thereof
CN111831215A (en) Apparatus for transferring mapping information in memory system
CN103842962A (en) Method for improving booting of a computing device
CN111694506A (en) Method and device for determining total capacity of magnetic disk, magnetic disk and machine-readable storage medium
KR20210012641A (en) Memory system, data processing system and method for operation the same
US9817837B2 (en) Method and system for file storage and access
CN112506918A (en) Data access method, terminal and computer readable storage medium
CN113641597A (en) Method and apparatus for managing data storage and computer readable storage medium
CN109508150B (en) Method and device for allocating storage space
JP2005108239A (en) Storage system for storing data in hierarchical data structure
CN107766385B (en) Method and equipment for converting file format of virtual disk
EP3819771B1 (en) Data processing method and device, apparatus, and system
CN113051105A (en) Data processing method, device, equipment and storage medium
CN113507529A (en) Method for realizing file downloading based on Web application
KR20210038096A (en) Memory system, data processing system and method for operation the same
CN110543434A (en) NAND flash device, memory table management method, device and storage medium
EP2613254A2 (en) Apparatus and method for partitioning memory area for application preloading in a wireless terminal
CN113050877B (en) Mapping table storage method and device, electronic equipment and storage medium

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: 20200922