WO2015196820A1 - Method and apparatus for creating jbod file system - Google Patents

Method and apparatus for creating jbod file system Download PDF

Info

Publication number
WO2015196820A1
WO2015196820A1 PCT/CN2015/072932 CN2015072932W WO2015196820A1 WO 2015196820 A1 WO2015196820 A1 WO 2015196820A1 CN 2015072932 W CN2015072932 W CN 2015072932W WO 2015196820 A1 WO2015196820 A1 WO 2015196820A1
Authority
WO
WIPO (PCT)
Prior art keywords
jbod
file
file system
path
data
Prior art date
Application number
PCT/CN2015/072932
Other languages
French (fr)
Chinese (zh)
Inventor
王魏强
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2015196820A1 publication Critical patent/WO2015196820A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/80Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in storage media based on magnetic or optical technology, e.g. disks with sectors

Definitions

  • the present invention relates to the field of computer applications, and in particular, to a method and an apparatus for creating a JBOD file system.
  • JBOD Just a Bunch Of Disks
  • JBOD has the advantage of low cost and can combine multiple disks into a shared power and fan box, which is economical. Space-saving configuration storage. With higher-capacity disk drives on the market, it is possible to build JBODs with disks of several terabytes. Since JBOD generally contains multiple disks in use, the total storage capacity is enormous.
  • the embodiment of the invention provides a method and a device for creating a JBOD file system, so as to achieve the purpose of creating a JBOD file system and improving the reliability of JBOD use.
  • an embodiment of the present invention provides a method for creating a JBOD file system, where the method includes:
  • a path file of the JBOD file system is created in the metadata file to store the path information of the data file of the JBOD file system on the data disk of the JBOD.
  • the creating a configuration file to configure a path information, a format type, and a mount point path of the JBOD file system includes:
  • the formatting the JBOD file system according to the path information and the format type of the JBOD file system includes:
  • the metadata file is formatted according to the path information and formatting type of the metadata file
  • the data disk is formatted according to the path information and formatting type of the data disk.
  • the initializing the JBOD file system according to the path information and the mount point path of the JBOD file system includes:
  • the metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
  • the path file of the JBOD file system is created in the metadata file according to the mount point path of the JBOD file system, to store the data file of the JBOD file system on the data disk.
  • the path information includes:
  • mount point path of the JBOD file system create a path file of the JBOD file system in the mount point path of the JBOD file system, and store the path file of the JBOD file system in the metadata file;
  • the path information of the data file of the JBOD file system is stored in the path file of the JBOD file system.
  • an embodiment of the present invention further provides an apparatus for creating a disk cluster JBOD file system, where the apparatus includes:
  • the configuration module is configured to create a configuration file to configure path information, format type, and mount point path of the JBOD file system;
  • the formatting processing module is configured to format the JBOD file system according to the path information and the formatting type of the JBOD file system;
  • the initialization processing module is configured to initialize the JBOD file system according to the path information of the JBOD file system and the mount point path;
  • the system disk is configured to create a metadata file to store the path file of the JBOD file system when the JBOD file system creation instruction is detected; and create a JBOD file system in the metadata file according to the mount point path of the JBOD file system.
  • Path file to store the path information of the JBOD file system data file on the JBOD data disk.
  • the configuration module is configured to:
  • the formatting processing module is configured to:
  • the metadata file is formatted according to the path information and formatting type of the metadata file
  • the data disk is formatted according to the path information and formatting type of the data disk.
  • the initialization processing module is configured to:
  • the metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
  • system disk includes:
  • the metadata file creation unit is configured to create a metadata file to store the path file of the JBOD file system when the JBOD file system creation instruction is detected;
  • the path file creation unit is configured to create a path file of the JBOD file system in the mount point path of the JBOD file system according to the mount point path of the JBOD file system, and store the path file of the JBOD file system in the metadata file. ;
  • the data disk selection unit is configured to select a data disk to be stored in the data file of the JBOD file system according to a preset policy
  • the data file creation unit is configured to create a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determine the data file of the JBOD file system in the data. Path information on the disk;
  • the file association unit is configured to store the path information of the data file of the JBOD file system in the path file of the JBOD file system.
  • an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method.
  • the system disk is When the JBOD file system creation instruction is detected, a metadata file is created to store the path file of the JBOD file system, and the configuration module creates a configuration file to configure the path information, format type, and mount point path of the JBOD file system;
  • the processing module formats the JBOD file system according to the path information and formatting type of the JBOD file system;
  • the initialization processing module initializes the JBOD file system according to the path information of the JBOD file system and the mount point path; then the system disk is based on JBOD
  • the mount point path of the file system creates a path file of the JBOD file system in the metadata file to store the path information of the JBOD file system data file on the JBOD data disk.
  • the path information of the data file of the JBOD file system on the data disk is stored in the path file of the JBOD file system, so that the path file of the JBOD file system is associated with the data file, so that multiple data can be included.
  • FIG. 1 is a schematic flowchart of a method for creating a JBOD file system according to an embodiment of the present invention
  • step S50 in FIG. 1 is a schematic flow chart of step S50 in FIG. 1;
  • FIG. 3 is a schematic structural diagram of an apparatus for creating a JBOD file system according to an embodiment of the present invention
  • FIG. 4 is a schematic structural view of the system disk of FIG. 3.
  • Embodiments of the present invention provide a method for creating a JBOD file system.
  • FIG. 1 is a schematic flowchart of a method for creating a JBOD file system according to an embodiment of the present invention.
  • Step S10 When the JBOD file system creation instruction is detected, a metadata file is created to store the path file of the JBOD file system.
  • this embodiment connects the JBOD to a device (such as a server host) that creates a JBOD file system, and the device that creates the JBOD file system detects the JBOD file system.
  • a device such as a server host
  • the JBOD file system creation instruction is initiated when the JBOD first connects to the device that creates the JBOD file system, create a metadata file on the system disk, and use the metadata file to store the path file of the JBOD file system to establish the JBOD.
  • the path file of the file system corresponds to the association of the data file.
  • Step S20 Create a configuration file to configure path information, format type, and mount point path of the JBOD file system.
  • the device for creating the JBOD file system After creating a metadata file for storing the path file of the JBOD file system, the device for creating the JBOD file system creates a configuration file, and configures the path information, format type, and mount point path of the JBOD file system through the configuration file, so as to be created.
  • the JBOD file system is formatted and initialized during the JBOD file system process, ready to create a JBOD file system.
  • Step S30 Format the JBOD file system according to the path information and formatting type of the JBOD file system.
  • the device that creates the JBOD file system After configuring the path information, format type, and mount point path of the JBOD file system to determine the path information, format type, and mount point path of the JBOD file system, the device that creates the JBOD file system is configured according to the configured JBOD file.
  • the path information of the system is formatted according to the formatted type of the configured JBOD file system.
  • Step S40 Initialize the JBOD file system according to the path information of the JBOD file system and the mount point path.
  • the device that creates the JBOD file system After formatting the JBOD file system, the device that creates the JBOD file system initializes the JBOD file system according to the path information of the configured JBOD file system and the mount point path of the configured JBOD file system, thereby giving the application
  • the layer provides a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
  • Step S50 Create a path file of the JBOD file system in the metadata file according to the mount point path of the JBOD file system, so as to store the path information of the data file of the JBOD file system on the data disk of the JBOD.
  • the device that creates the JBOD file system When the device that creates the JBOD file system detects the JBOD file system creation instruction, it creates a metadata file in the root directory through the system disk, formats the JBOD file system, and initializes the JBOD file system to create a JBOD file.
  • the device of the system establishes a path file of the JBOD file system and associates with the data file of the JBOD file system, including: the device for creating the JBOD file system creates a JBOD file in the metadata file according to the mount point path of the configured JBOD file system.
  • the path file of the system stores the path information of the data file of the JBOD file system on the data disk of the JBOD in the path file of the JBOD file system, so that the data file of the JBOD file system is stored in the JBOD data file through the path file of the JBOD file system.
  • the path information on the disk is used to implement the association between the path file of the JBOD file system and the data file of the JBOD file system, and the creation of the JBOD file system is completed. Since the JBOD contains multiple data disks, the data files stored on each data disk have corresponding path information in the path file, that is, the path file stores the path information of the data files in each data disk.
  • the path file of the JBOD file system not only contains the path information of the data file of the JBOD file system on each data disk of the JBOD, but also the file directory and file name of each data disk in the JBOD.
  • the method for creating a JBOD file system in the embodiment of the present invention stores the path information of the data file of the JBOD file system on the data disk in the path file of the JBOD file system, so as to implement the association between the path file and the data file of the JBOD file system. Therefore, a multi-disk JBOD file system can be created on a JBOD containing multiple data disks. When one or more data disks on the JBOD are damaged, only the data on the damaged data disk is lost, without affecting the normal use of the JBOD file system. Improve the reliability of JBOD use.
  • step S20 includes:
  • the path information of the above JBOD file system includes the path information of the metadata file and the data disk.
  • Path information, the formatting type of the above JBOD file system includes the formatting type of the metadata file and the formatting type of the data disk.
  • the path information and formatting type of the device configuration metadata file of the JBOD file system In the case where JBOD access is detected, the path information and formatting type of the data disk, and the mount point path of the JBOD file system are created.
  • Metadata file For example, to create a metadata file named jbodfs.meta (indicated by metafile) under the root directory /home of the system disk of the device that creates the JBOD file system, to build the ext file system in the metadata file, you can
  • the path information of the data file is configured as "/home/jbodfs.meta”
  • the format type of the metadata file is configured as "ext”.
  • the JBOD contains 16 data disks, and the device names of the data disks (represented by datadev) are sdb, ..., sdq.
  • the path information of the data disk as " /dev/sdb, /dev/sdc, ..., /dev/sdq”
  • configures the format type of the data disk as "xfs”.
  • Metafile /home/jbodfs.meta
  • step S30 includes:
  • the metadata file is formatted according to the path information and formatting type of the metadata file
  • the data disk is formatted according to the path information and formatting type of the data disk.
  • Path information, formatting type, and path information of the data disk in the metadata file The configuration type is configured to determine the path information of the metadata file, the format type, and the path information and format type of the data disk.
  • the device that creates the JBOD file system is configured according to the path information of the configured metadata file. Formatting the metadata file, formatting the metadata file; formatting the data disk according to the formatted type of the configured data disk according to the configured path information of the data disk.
  • the metadata file can be performed according to the command format as illustrated below. format:
  • the command may be as follows: Format formats the data disk:
  • step S40 includes:
  • the metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
  • the device for creating the JBOD file system according to the path information of the configured metadata file and the mount point path of the configured JBOD file system are in the metadata file.
  • the metadata information (including the path file, and the file directory of each data disk included in the path file, the file name, and the path information of the data file) are initialized, that is, the metadata information in the metadata file is mounted; Reading the serial number of the data disk according to the configured path information of the data disk, and obtaining data according to the serial number of the data disk
  • the mount point path of the disk initializes the data disk, that is, mounts the data disk. Therefore, the application layer is provided with a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
  • the metadata can be formatted according to the command format as shown below.
  • the metadata information in the file is mounted:
  • the sequence of the data disk in the path of /dev/sdb in JBOD can be read and read out.
  • the serial number of the data disk in the /dev/sdc path ..., the serial number of the data disk in the /dev/sdq path, assuming the serial number of the data disk in the /dev/sdb path is SNB, /dev/sdc path
  • the serial number of the data disk is SNC, ..., /dev/sdq
  • the serial number of the data disk is SNQ
  • the data disk can be mounted according to the directory format shown below:
  • FIG. 2 is a schematic flow chart of step S50 in FIG.
  • step S50 includes the following steps:
  • Step S51 According to the mount point path of the JBOD file system, create a path file of the JBOD file system in the mount point path of the JBOD file system, and set a path file of the JBOD file system. Stored in the metadata file.
  • Step S52 Select a data disk to be stored in the data file of the JBOD file system according to a preset policy.
  • Step S53 Create a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determine the path of the data file of the JBOD file system on the data disk. information.
  • Step S54 The path information of the data file of the JBOD file system is stored in the path file of the JBOD file system.
  • the device that creates the JBOD file system When the device that creates the JBOD file system detects the JBOD file system creation instruction, it creates a metadata file in the root directory through the system disk, formats the metadata file and the data disk, and performs metadata file and data disk. After the initialization, the device that creates the JBOD file system establishes the association between the path file of the JBOD file system and the data file of the JBOD file system, including: the system disk hangs in the JBOD file system according to the mount point path of the configured JBOD file system. Create a path file of the JBOD file system in the load path, and store the path file of the JBOD file system in the metadata file.
  • test.txt create a test named named named test.txt in the mount path of the JBOD file system/jbodfs/path.
  • the path file, the path information of the path file is /jbodfs/path/test.txt; and the data disk to be stored in the data file of the JBOD file system is selected according to a preset policy, for example, one of the most idle data disks in the JBOD is selected for storage.
  • the data file of the JBOD file system, and the serial number of the most idle data disk is SNB, the mount point of the most idle data disk Is / mnt / SNB.
  • the serial number of the selected data disk is SNB and the mount point path is /mnt/SNB
  • a data file named test.txt is created under /mnt/SNB/path, thereby determining the The path information of the data file is /mnt/SNB/path/test.txt.
  • the path information of the data file is determined to be /mnt/SNB/path/test.txt
  • the path information of the data file "/mnt/SNB/path/test.txt" is stored in the path file test under the /jbodfs/path path.
  • the path file stored in the metadata file and the data file stored in the data disk are implemented.
  • Correspondence of the association complete the creation of the JBOD file system. Therefore, when the application layer needs to operate on the path file test.txt in the /jbodfs/path path, just open the data file test.txt under /mnt/SNB/path.
  • the data file of the JBOD file system is stored in the data disk with the serial number SNB.
  • the application layer needs to read and write the path file test.txt in the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then read and write the serial number as the data file in the SNB data disk according to the path information /mnt/SNB/path/test.txt. Then, the read and write operations of the path file test.txt in the /jbodfs/path path are completed.
  • the data file of the JBOD file system is stored in the data disk with the serial number SNB.
  • the application layer needs to delete the path file test.txt under the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then use the path information /mnt/SNB/path/test.txt to set the data file in the data disk with the serial number SNB. Delete the .txt file, and then delete the path file test.txt in the /jbodfs/path path to complete the deletion of the path file test.txt in the /jbodfs/path path.
  • the embodiment of the invention further provides an apparatus for creating a JBOD file system.
  • FIG. 3 is a schematic structural diagram of an apparatus for creating a JBOD file system according to an embodiment of the present invention.
  • an apparatus for creating a JBOD file system includes a configuration module 100, a formatting processing module 200, an initialization processing module 300, and a system disk 400.
  • the configuration module 100 is configured to configure path information, a format type, and a mount point path of the JBOD file system when a JBOD (not shown) is detected.
  • the formatting processing module 200 is configured to format the JBOD file system according to the path information and formatting type of the JBOD file system.
  • the initialization processing module 300 is configured to initialize the JBOD file system according to the path information of the JBOD file system and the mount point path.
  • the system disk 400 is set to create a metadata file when a JBOD file system creation instruction is detected.
  • this embodiment connects the JBOD to a device (such as a server host) that creates a JBOD file system, and the device that creates the JBOD file system detects the JBOD file system.
  • a device such as a server host
  • the JBOD file system creation instruction is initiated when the JBOD first connects to the device that creates the JBOD file system.
  • the device that creates the JBOD file system creates a metadata file through the system disk 400, and uses the metadata file to store the path of the JBOD file system.
  • the file corresponds to the association between the path file of the JBOD file system and the data file.
  • the configuration file is created by the configuration module 100, and the path information, the format type, and the mount point path of the JBOD file system are configured through the configuration file, so that the JBOD file is created.
  • the JBOD file system is formatted and initialized during the system process, ready to create a JBOD file system.
  • the configuration module 100 configures the path information, the format type, and the mount point path of the JBOD file system, and determines the path information, the format type, and the mount point path of the JBOD file system, the device is created in the JBOD file system.
  • the processing module 200 formats the JBOD file system according to the format information of the configured JBOD file system according to the configured path information of the JBOD file system.
  • the initialization processing module 300 in the device for creating the JBOD file system according to the path information of the configured JBOD file system and the mount point path of the configured JBOD file system.
  • the JBOD file system is initialized to provide the application layer with a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
  • the device for creating the JBOD file system creates a metadata file in the root directory through the system disk when the JBOD file system creation instruction is detected, formats the JBOD file system in the formatting processing module 200, and initializes the processing module 300 to the JBOD.
  • the device that creates the JBOD file system establishes the association between the path file of the JBOD file system and the data file of the JBOD file system, including: the system disk 400 in the device that creates the JBOD file system.
  • the mount point path of the configured JBOD file system create a path file of the JBOD file system in the metadata file, and store the path information of the data file of the JBOD file system on the JBOD data disk in the path file of the JBOD file system. Therefore, the path file of the JBOD file system is stored in the path file of the JBOD file system on the data disk of the JBOD file system, and the path file of the JBOD file system is associated with the data file of the JBOD file system, and the JBOD file system is completed. create. Since the JBOD contains multiple data disks, the data files stored on each data disk have corresponding path information in the path file, that is, the path file stores the path information of the data files in each data disk.
  • the path file of the JBOD file system not only contains the path information of the data file of the JBOD file system on each data disk of the JBOD, but also the file directory and file name of each data disk in the JBOD.
  • the device for creating a JBOD file system in the embodiment of the present invention stores the path information of the data file of the JBOD file system on the data disk in the path file of the JBOD file system, so as to implement the association between the path file and the data file of the JBOD file system. Therefore, a multi-disk JBOD file system can be created on a JBOD containing multiple data disks. When one or more data disks on the JBOD are damaged, only the data on the damaged data disk is lost, without affecting the normal use of the JBOD file system. Improve the reliability of JBOD use.
  • the configuration module 100 is configured to:
  • the path information of the JBOD file system includes path information of the metadata file and path information of the data disk.
  • the format type of the JBOD file system includes a format type of the metadata file and a format type of the data disk.
  • the configuration module 100 in the device for creating the JBOD file system configures the path information and formatting type of the metadata file, and the path information and format of the data disk. The type, as well as the mount point path of the JBOD file system.
  • the configuration module 100 For example, to create a metadata file named jbodfs.meta (indicated by metafile) under the root directory /home of the system disk of the device that creates the JBOD file system, to build the ext file system in the metadata file, the configuration module 100
  • the path information of the metadata file can be configured as "/home/jbodfs.meta", and the format type of the metadata file (indicated by metaformat) can be configured as "ext”.
  • the JBOD contains 16 data disks, and the device names of the data disks (represented by datadev) are sdb, ..., sdq.
  • the configuration module 100 can set the path information of the data disk. Configured as "/dev/sdb, /dev/sdc, ..., /dev/sdq", configure the format type of the data disk (indicated by dateformat) as "xfs".
  • the configuration module 100 can configure the mount path of the JBOD file system (represented by mountpath) as "/jbodfs".
  • Metafile /home/jbodfs.meta
  • the formatting processing module 200 is configured to:
  • the metadata file is formatted according to the path information and formatting type of the metadata file
  • the data disk is formatted according to the path information and formatting type of the data disk.
  • the configuration module 100 configures the path information of the metadata file, the format type, and the path information and format type of the data disk, determines the path information of the metadata file, the format type, and the path information and formatting of the data disk.
  • the formatting processing module 200 in the device that creates the JBOD file system formats the metadata file according to the format information of the configured metadata file according to the configured path information of the metadata file; Number According to the path information of the disk, the data disk is formatted according to the formatted type of the configured data disk.
  • the formatting processing module 200 can be in accordance with the command format as illustrated below. Format the metadata file:
  • the formatting processing module 200 may Format the data disk according to the command format as shown below:
  • the initialization processing module 300 is configured to:
  • the metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
  • the initialization processing module 300 in the device for creating the JBOD file system is configured according to the path information of the configured metadata file and the configured JBOD file system.
  • the carry point path which initializes the metadata information in the metadata file, that is, the metadata information in the metadata file (including the path file, and the file directory, file name, and data of each data disk included in the path file)
  • the path information of the file is mounted; at the same time, according to the path information of the configured data disk, the serial number of the data disk is read, and the mount point path of the data disk is obtained according to the serial number of the data disk, and the data disk is performed.
  • Initialization that is, mounting the data disk. Therefore, the application layer is provided with a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
  • the metadata can be formatted according to the command format as shown below.
  • the metadata information in the file is mounted:
  • the sequence of the data disk in the path of /dev/sdb in JBOD can be read and read out.
  • the serial number of the data disk in the /dev/sdc path ..., the serial number of the data disk in the /dev/sdq path, assuming the serial number of the data disk in the /dev/sdb path is SNB, /dev/sdc path
  • the serial number of the data disk is SNC, ..., /dev/sdq
  • the serial number of the data disk is SNQ
  • the data disk can be mounted according to the directory format shown below:
  • FIG. 4 is a schematic structural view of the system disk of FIG.
  • the system disk 400 includes a metadata file creating unit 410, a path file creating unit 420, a data disk selecting unit 430, a data file creating unit 440, and a file associating unit 450.
  • the metadata file creation unit 410 is configured to create a metadata file to store a path file of the JBOD file system when the JBOD file system creation instruction is detected.
  • the path file creation unit 420 is configured to create a path file of the JBOD file system in the mount point path of the JBOD file system according to the mount point path of the JBOD file system, and the JBOD The path file of the file system is stored in the metadata file.
  • the data disk selection unit 430 is configured to select a data disk to be stored in the data file of the JBOD file system according to a preset policy.
  • the data file creating unit 440 is configured to create a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determine the data file of the JBOD file system in the data. Path information on the disk.
  • the file association unit 450 is arranged to store the path information of the data file of the JBOD file system in the path file of the JBOD file system.
  • the metadata file creation unit 410 in the system disk 400 creates a metadata file in the root directory of the system disk 400, and the format processing module 200 pairs the element.
  • the device that creates the JBOD file system establishes the association between the path file of the JBOD file system and the data file of the JBOD file system, including
  • the path file creation unit 420 creates a path file of the JBOD file system in the mount point path of the JBOD file system according to the mount point path of the configured JBOD file system, and stores the path file of the JBOD file system in the metadata file.
  • a path file named test.txt is created under the mount point path /jbodfs/path of the JBOD file system, and the path information of the path file is /jbodfs/path/test.txt; and the data disk selection unit 430 Select the data disk to be stored in the data file of the JBOD file system according to the preset policy, for example, select the most idle in JBOD A data storage disk JBOD file system data files, data and the most idle SNB disk serial number, the least busy disk mount point path data for / mnt / SNB.
  • the data file creation unit 440 creates the JBOD file system in the mount point path of the selected data disk according to the serial number of the selected data disk and the mount point path.
  • the data file and determine the path information of the JBOD file system data file on the data disk. For example, if the serial number of the selected data disk is SNB and the mount point path is /mnt/SNB, a data file named test.txt is created under /mnt/SNB/path, thereby determining the The path information of the data file is /mnt/SNB/path/test.txt.
  • the file association unit 450 will path information of the data file. "/mnt/SNB/path/test.txt" is stored in the path file test.txt in the path of /jbodfs/path. At this point, the association between the path file stored in the metadata file and the data file stored in the data disk is implemented. Correspondingly, the creation of the JBOD file system is completed. Therefore, when the application layer needs to operate on the path file test.txt in the /jbodfs/path path, just open the data file test.txt under /mnt/SNB/path.
  • the data file of the JBOD file system is stored in the data disk with the serial number SNB.
  • the application layer needs to read and write the path file test.txt in the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then read and write the serial number as the data file in the SNB data disk according to the path information /mnt/SNB/path/test.txt. Then, the read and write operations of the path file test.txt in the /jbodfs/path path are completed.
  • the data file of the JBOD file system is stored in the data disk with the serial number SNB.
  • the application layer needs to delete the path file test.txt under the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then use the path information /mnt/SNB/path/test.txt to set the data file in the data disk with the serial number SNB. Delete the .txt file, and then delete the path file test.txt in the /jbodfs/path path to complete the deletion of the path file test.txt in the /jbodfs/path path.
  • the above technical solution realizes that when one or more data disks on the JBOD are damaged, only the data on the damaged data disk is lost, and the normal use of the JBOD file system is not affected, thereby improving the reliability of the JBOD use.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method and apparatus for creating a JBOD file system. The method for creating a JBOD file system comprises: upon detecting a JBOD file system creation instruction, creating a metadata file; creating a configuration file to configure path information, a formatting type, and a mount point path of a JBOD file system; formatting and initializing the JBOD file system according to the path information, the formatting type, and the mount point path of the JBOD file system; and creating, according to the mount point path of the JBOD file system, a path file of the JBOD file system in the metadata file, so as to store path information of a data file of the JBOD file system in a data disk of a JBOD. By means of the technical solution, a multi-disk JBOD file system can be created in a JBOD containing multiple data disks, and reliability in using the JBOD is improved.

Description

创建JBOD文件系统的方法及装置Method and device for creating JBOD file system 技术领域Technical field
本发明涉及计算机应用领域,尤其涉及一种创建JBOD文件系统的方法及装置。The present invention relates to the field of computer applications, and in particular, to a method and an apparatus for creating a JBOD file system.
背景技术Background technique
JBOD(Just a Bunch Of Disks,简单磁盘捆绑,也称磁盘簇)是在一个底板上安装的带有多个磁盘驱动器的存储设备,JBOD上的每个磁盘(即数据盘)都是单独寻址,作为分开的存储资源使用和管理。与传统的RAID(Redundant Array of Inexpensive Disks,廉价磁盘冗余)阵列相比,JBOD的优势在于它的低成本,可以将多个磁盘合并到共享电源和风扇的盒子里,是一种经济的、节省空间的配置存储方式。随着更高容量的磁盘驱动器投入市场,采用具有几TB的磁盘建立JBOD成为可能。由于JBOD一般在使用中都包含多个磁盘,因此总的存储容量十分巨大。JBOD (Just a Bunch Of Disks) is a storage device with multiple disk drives installed on a backplane. Each disk on the JBOD (that is, a data disk) is individually addressed. , used and managed as separate storage resources. Compared with the traditional RAID (Redundant Array of Inexpensive Disks) array, JBOD has the advantage of low cost and can combine multiple disks into a shared power and fan box, which is economical. Space-saving configuration storage. With higher-capacity disk drives on the market, it is possible to build JBODs with disks of several terabytes. Since JBOD generally contains multiple disks in use, the total storage capacity is enormous.
目前常常通过虚拟卷管理器或者软件RAID的方式来管理多个磁盘,将多个磁盘虚拟成为一个硬盘,然后在所虚拟的硬盘上面创建文件系统,提供统一的应用方式给应用层使用。采用上述方案,当有两块磁盘同时损坏的情况下,整个文件系统将无法运行,而且磁盘中损坏的数据也将无法修复。究其原因,虽然虚拟卷管理器或者软件RAID能够在一定程度上保障存储的安全性,但是构建在上面的文件系统,仍然是基于单盘来设计实现的,不能满足JBOD的应用场景。Currently, multiple disks are managed by a virtual volume manager or software RAID, and multiple disks are virtualized into one hard disk, and then a file system is created on the virtual hard disk to provide a unified application mode for the application layer. With the above scheme, when two disks are damaged at the same time, the entire file system will not run, and the corrupted data on the disk will not be repaired. The reason is that although the virtual volume manager or software RAID can guarantee the security of storage to a certain extent, the file system built on the above is still designed and implemented based on a single disk, and cannot satisfy the application scenario of JBOD.
发明内容Summary of the invention
本发明实施例提供了一种创建JBOD文件系统的方法及装置,以实现创建JBOD文件系统,提高JBOD使用的可靠性的目的。The embodiment of the invention provides a method and a device for creating a JBOD file system, so as to achieve the purpose of creating a JBOD file system and improving the reliability of JBOD use.
为了达到上述目的,本发明实施例提供一种创建JBOD文件系统的方法,该方法包括: In order to achieve the above objective, an embodiment of the present invention provides a method for creating a JBOD file system, where the method includes:
当侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件;When the JBOD file system creation instruction is detected, a metadata file is created to store the path file of the JBOD file system;
创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径;Create a configuration file to configure the path information, format type, and mount point path of the JBOD file system.
根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化;Format the JBOD file system according to the path information and formatting type of the JBOD file system;
根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化;Initializing the JBOD file system according to the path information of the JBOD file system and the mount point path;
根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息。According to the mount point path of the JBOD file system, a path file of the JBOD file system is created in the metadata file to store the path information of the data file of the JBOD file system on the data disk of the JBOD.
可选地,所述创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径包括:Optionally, the creating a configuration file to configure a path information, a format type, and a mount point path of the JBOD file system includes:
创建配置文件,通过所述创建配置文件配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式化类型,以及JBOD文件系统的挂载点路径。Create a configuration file, configure the path information and formatting type of the metadata file, the path information and formatting type of the data disk, and the mount point path of the JBOD file system by using the created configuration file.
可选地,所述根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化包括:Optionally, the formatting the JBOD file system according to the path information and the format type of the JBOD file system includes:
根据元数据文件的路径信息和格式化类型,对元数据文件进行格式化;并根据数据盘的路径信息和格式化类型,对数据盘进行格式化。The metadata file is formatted according to the path information and formatting type of the metadata file; and the data disk is formatted according to the path information and formatting type of the data disk.
可选地,所述根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化包括:Optionally, the initializing the JBOD file system according to the path information and the mount point path of the JBOD file system includes:
根据元数据文件的路径信息和JBOD文件系统的挂载点路径,对元数据文件中的元数据信息进行挂载;根据数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据盘的挂载点路径,对数据盘进行挂载。The metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
可选地,所述根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在数据盘上 的路径信息包括:Optionally, the path file of the JBOD file system is created in the metadata file according to the mount point path of the JBOD file system, to store the data file of the JBOD file system on the data disk. The path information includes:
根据JBOD文件系统的挂载点路径,在JBOD文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD文件系统的路径文件存放在所述元数据文件中;According to the mount point path of the JBOD file system, create a path file of the JBOD file system in the mount point path of the JBOD file system, and store the path file of the JBOD file system in the metadata file;
根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘;Select the data disk to be stored in the data file of the JBOD file system according to a preset policy;
根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息;Creating a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determining path information of the data file of the JBOD file system on the data disk;
将JBOD文件系统的数据文件的路径信息存放在所述JBOD文件系统的路径文件中。The path information of the data file of the JBOD file system is stored in the path file of the JBOD file system.
此外,为了达到上述目的,本发明实施例还提供一种创建磁盘簇JBOD文件系统的装置,该装置包括:In addition, in order to achieve the above object, an embodiment of the present invention further provides an apparatus for creating a disk cluster JBOD file system, where the apparatus includes:
配置模块,设置为创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径;The configuration module is configured to create a configuration file to configure path information, format type, and mount point path of the JBOD file system;
格式化处理模块,设置为根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化;The formatting processing module is configured to format the JBOD file system according to the path information and the formatting type of the JBOD file system;
初始化处理模块,设置为根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化;The initialization processing module is configured to initialize the JBOD file system according to the path information of the JBOD file system and the mount point path;
系统盘,设置为当侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件;且根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息。The system disk is configured to create a metadata file to store the path file of the JBOD file system when the JBOD file system creation instruction is detected; and create a JBOD file system in the metadata file according to the mount point path of the JBOD file system. Path file to store the path information of the JBOD file system data file on the JBOD data disk.
可选地,所述配置模块设置为:Optionally, the configuration module is configured to:
创建配置文件,通过所述创建配置文件配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式化类型,以及JBOD文件系统的挂载点路径。 Create a configuration file, configure the path information and formatting type of the metadata file, the path information and formatting type of the data disk, and the mount point path of the JBOD file system by using the created configuration file.
可选地,所述格式化处理模块是设置为:Optionally, the formatting processing module is configured to:
根据元数据文件的路径信息和格式化类型,对元数据文件进行格式化;并根据数据盘的路径信息和格式化类型,对数据盘进行格式化。The metadata file is formatted according to the path information and formatting type of the metadata file; and the data disk is formatted according to the path information and formatting type of the data disk.
可选地,所述初始化处理模块是设置为:Optionally, the initialization processing module is configured to:
根据元数据文件的路径信息和JBOD文件系统的挂载点路径,对元数据文件中的元数据信息进行挂载;根据数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据盘的挂载点路径,对数据盘进行挂载。The metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
可选地,所述系统盘包括:Optionally, the system disk includes:
元数据文件创建单元,设置为当侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件;The metadata file creation unit is configured to create a metadata file to store the path file of the JBOD file system when the JBOD file system creation instruction is detected;
路径文件创建单元,设置为根据JBOD文件系统的挂载点路径,在JBOD文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD文件系统的路径文件存放在所述元数据文件中;The path file creation unit is configured to create a path file of the JBOD file system in the mount point path of the JBOD file system according to the mount point path of the JBOD file system, and store the path file of the JBOD file system in the metadata file. ;
数据盘选择单元,设置为根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘;The data disk selection unit is configured to select a data disk to be stored in the data file of the JBOD file system according to a preset policy;
数据文件创建单元,设置为根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息;The data file creation unit is configured to create a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determine the data file of the JBOD file system in the data. Path information on the disk;
文件关联单元,设置为将JBOD文件系统的数据文件的路径信息存放在所述JBOD文件系统的路径文件中。The file association unit is configured to store the path information of the data file of the JBOD file system in the path file of the JBOD file system.
此外,为了达到上述目的,本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述方法。In addition, in order to achieve the above object, an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method.
本发明实施例提供的创建JBOD文件系统的方法及装置,首先系统盘在 侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件,配置模块创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径;格式化处理模块根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化;初始化处理模块根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化;然后系统盘根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息。本发明实施例通过将JBOD文件系统的数据文件在数据盘上的路径信息存放在JBOD文件系统的路径文件中,实现JBOD文件系统的路径文件与数据文件的关联对应,从而可以在含有多个数据盘的JBOD上创建多盘JBOD文件系统,当JBOD上有一个或多个数据盘损坏时,只是丢失损坏的数据盘上的数据,而不影响JBOD文件系统正常使用,提高了JBOD使用的可靠性。The method and device for creating a JBOD file system provided by the embodiment of the present invention, firstly, the system disk is When the JBOD file system creation instruction is detected, a metadata file is created to store the path file of the JBOD file system, and the configuration module creates a configuration file to configure the path information, format type, and mount point path of the JBOD file system; The processing module formats the JBOD file system according to the path information and formatting type of the JBOD file system; the initialization processing module initializes the JBOD file system according to the path information of the JBOD file system and the mount point path; then the system disk is based on JBOD The mount point path of the file system creates a path file of the JBOD file system in the metadata file to store the path information of the JBOD file system data file on the JBOD data disk. In the embodiment of the present invention, the path information of the data file of the JBOD file system on the data disk is stored in the path file of the JBOD file system, so that the path file of the JBOD file system is associated with the data file, so that multiple data can be included. Create a multi-disk JBOD file system on the JBOD of the disk. When one or more data disks on the JBOD are damaged, only the data on the damaged data disk is lost, without affecting the normal use of the JBOD file system, and the reliability of the JBOD is improved. .
附图概述BRIEF abstract
图1为本发明实施例创建JBOD文件系统的方法流程示意图;1 is a schematic flowchart of a method for creating a JBOD file system according to an embodiment of the present invention;
图2为图1中步骤S50的流程示意图;2 is a schematic flow chart of step S50 in FIG. 1;
图3为本发明实施例创建JBOD文件系统的装置的结构示意图;3 is a schematic structural diagram of an apparatus for creating a JBOD file system according to an embodiment of the present invention;
图4为图3中系统盘的结构示意图。4 is a schematic structural view of the system disk of FIG. 3.
本发明的较佳实施方式Preferred embodiment of the invention
应当理解,此处所描述的实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明实施例提供一种创建JBOD文件系统的方法。Embodiments of the present invention provide a method for creating a JBOD file system.
参照图1,图1为本发明实施例创建JBOD文件系统的方法流程示意图。Referring to FIG. 1, FIG. 1 is a schematic flowchart of a method for creating a JBOD file system according to an embodiment of the present invention.
本发明实施例提供的创建JBOD文件系统的方法包括以下步骤:The method for creating a JBOD file system provided by the embodiment of the present invention includes the following steps:
步骤S10:当侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件。 Step S10: When the JBOD file system creation instruction is detected, a metadata file is created to store the path file of the JBOD file system.
为在含有多个数据盘的JBOD上创建多盘JBOD文件系统,本实施例将JBOD连接到创建JBOD文件系统的装置(如服务器主机)上,当创建JBOD文件系统的装置侦测到JBOD文件系统创建指令时,如果该JBOD文件系统创建指令是JBOD首次连接创建JBOD文件系统的装置时发起的,在系统盘上创建元数据文件,利用该元数据文件存放JBOD文件系统的路径文件,以建立JBOD文件系统的路径文件与数据文件的关联对应。In order to create a multi-disk JBOD file system on a JBOD containing multiple data disks, this embodiment connects the JBOD to a device (such as a server host) that creates a JBOD file system, and the device that creates the JBOD file system detects the JBOD file system. When creating the instruction, if the JBOD file system creation instruction is initiated when the JBOD first connects to the device that creates the JBOD file system, create a metadata file on the system disk, and use the metadata file to store the path file of the JBOD file system to establish the JBOD. The path file of the file system corresponds to the association of the data file.
步骤S20:创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径。Step S20: Create a configuration file to configure path information, format type, and mount point path of the JBOD file system.
在创建用于存放JBOD文件系统的路径文件的元数据文件后,创建JBOD文件系统的装置创建配置文件,通过配置文件配置JBOD文件系统的路径信息、格式化类型和挂载点路径,以便在创建JBOD文件系统过程中对JBOD文件系统进行格式化和初始化,为创建JBOD文件系统做好准备。After creating a metadata file for storing the path file of the JBOD file system, the device for creating the JBOD file system creates a configuration file, and configures the path information, format type, and mount point path of the JBOD file system through the configuration file, so as to be created. The JBOD file system is formatted and initialized during the JBOD file system process, ready to create a JBOD file system.
步骤S30:根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化。Step S30: Format the JBOD file system according to the path information and formatting type of the JBOD file system.
在对JBOD文件系统的路径信息、格式化类型和挂载点路径进行配置,确定JBOD文件系统的路径信息、格式化类型和挂载点路径之后,创建JBOD文件系统的装置根据所配置的JBOD文件系统的路径信息,按照所配置的JBOD文件系统的格式化类型,对JBOD文件系统进行格式化。After configuring the path information, format type, and mount point path of the JBOD file system to determine the path information, format type, and mount point path of the JBOD file system, the device that creates the JBOD file system is configured according to the configured JBOD file. The path information of the system is formatted according to the formatted type of the configured JBOD file system.
步骤S40:根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化。Step S40: Initialize the JBOD file system according to the path information of the JBOD file system and the mount point path.
经过对JBOD文件系统进行格式化后,创建JBOD文件系统的装置根据所配置的JBOD文件系统的路径信息,以及所配置的JBOD文件系统的挂载点路径,对JBOD文件系统进行初始化,从而给应用层提供JBOD文件系统的文件访问接口,使得在创建JBOD文件系统后,应用层可以访问JBOD文件系统。After formatting the JBOD file system, the device that creates the JBOD file system initializes the JBOD file system according to the path information of the configured JBOD file system and the mount point path of the configured JBOD file system, thereby giving the application The layer provides a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
步骤S50:根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息。 Step S50: Create a path file of the JBOD file system in the metadata file according to the mount point path of the JBOD file system, so as to store the path information of the data file of the JBOD file system on the data disk of the JBOD.
创建JBOD文件系统的装置在侦测到JBOD文件系统创建指令时,通过系统盘在根目录下创建元数据文件,在对JBOD文件系统进行格式化,以及对JBOD文件系统进行初始化后,创建JBOD文件系统的装置建立JBOD文件系统的路径文件与JBOD文件系统的数据文件的关联对应,包括:创建JBOD文件系统的装置根据所配置的JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,将JBOD文件系统的数据文件在JBOD的数据盘上的路径信息存放在JBOD文件系统的路径文件中,从而通过JBOD文件系统的路径文件存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息,实现JBOD文件系统的路径文件与JBOD文件系统的数据文件的关联对应,完成JBOD文件系统的创建。由于JBOD上包含多个数据盘,因此每个数据盘上存放的数据文件在路径文件中都有对应的路径信息,即路径文件存放每个数据盘中的数据文件的路径信息。When the device that creates the JBOD file system detects the JBOD file system creation instruction, it creates a metadata file in the root directory through the system disk, formats the JBOD file system, and initializes the JBOD file system to create a JBOD file. The device of the system establishes a path file of the JBOD file system and associates with the data file of the JBOD file system, including: the device for creating the JBOD file system creates a JBOD file in the metadata file according to the mount point path of the configured JBOD file system. The path file of the system stores the path information of the data file of the JBOD file system on the data disk of the JBOD in the path file of the JBOD file system, so that the data file of the JBOD file system is stored in the JBOD data file through the path file of the JBOD file system. The path information on the disk is used to implement the association between the path file of the JBOD file system and the data file of the JBOD file system, and the creation of the JBOD file system is completed. Since the JBOD contains multiple data disks, the data files stored on each data disk have corresponding path information in the path file, that is, the path file stores the path information of the data files in each data disk.
JBOD文件系统的路径文件中不仅包含JBOD文件系统的数据文件在JBOD的每个数据盘上的路径信息,还包含JBOD中每个数据盘的文件目录、文件名称。The path file of the JBOD file system not only contains the path information of the data file of the JBOD file system on each data disk of the JBOD, but also the file directory and file name of each data disk in the JBOD.
本发明实施例创建JBOD文件系统的方法,通过将JBOD文件系统的数据文件在数据盘上的路径信息存放在JBOD文件系统的路径文件中,实现JBOD文件系统的路径文件与数据文件的关联对应,从而可以在含有多个数据盘的JBOD上创建多盘JBOD文件系统,当JBOD上有一个或多个数据盘损坏时,只是丢失损坏的数据盘上的数据,而不影响JBOD文件系统正常使用,提高了JBOD使用的可靠性。The method for creating a JBOD file system in the embodiment of the present invention stores the path information of the data file of the JBOD file system on the data disk in the path file of the JBOD file system, so as to implement the association between the path file and the data file of the JBOD file system. Therefore, a multi-disk JBOD file system can be created on a JBOD containing multiple data disks. When one or more data disks on the JBOD are damaged, only the data on the damaged data disk is lost, without affecting the normal use of the JBOD file system. Improve the reliability of JBOD use.
可选地,步骤S20包括:Optionally, step S20 includes:
创建配置文件,通过所述创建配置文件配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式化类型,以及JBOD文件系统的挂载点路径。Create a configuration file, configure the path information and formatting type of the metadata file, the path information and formatting type of the data disk, and the mount point path of the JBOD file system by using the created configuration file.
上述JBOD文件系统的路径信息包括元数据文件的路径信息和数据盘的 路径信息,上述JBOD文件系统的格式化类型包括元数据文件的格式化类型和数据盘的格式化类型。The path information of the above JBOD file system includes the path information of the metadata file and the data disk. Path information, the formatting type of the above JBOD file system includes the formatting type of the metadata file and the formatting type of the data disk.
在侦测到有JBOD接入的情况下,创建JBOD文件系统的装置配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式化类型,以及JBOD文件系统的挂载点路径。In the case where JBOD access is detected, the path information and formatting type of the device configuration metadata file of the JBOD file system, the path information and formatting type of the data disk, and the mount point path of the JBOD file system are created.
例如,要在创建JBOD文件系统的装置的系统盘的根目录/home下创建名为jbodfs.meta的元数据文件(用metafile表示),要在元数据文件中构建ext文件系统,则可以将元数据文件的路径信息配置为“/home/jbodfs.meta”,将元数据文件的格式化类型(用metaformat表示)配置为“ext”。For example, to create a metadata file named jbodfs.meta (indicated by metafile) under the root directory /home of the system disk of the device that creates the JBOD file system, to build the ext file system in the metadata file, you can The path information of the data file is configured as "/home/jbodfs.meta", and the format type of the metadata file (indicated by metaformat) is configured as "ext".
例如,JBOD包含16个数据盘,且数据盘(用datadev表示)的设备名称分别为sdb,……,sdq,要在数据盘中构建xfs文件系统,则可以将数据盘的路径信息配置为“/dev/sdb,/dev/sdc,……,/dev/sdq”,将数据盘的格式化类型(用dateformat表示)配置为“xfs”。For example, the JBOD contains 16 data disks, and the device names of the data disks (represented by datadev) are sdb, ..., sdq. To build the xfs file system in the data disk, you can configure the path information of the data disk as " /dev/sdb, /dev/sdc, ..., /dev/sdq", configures the format type of the data disk (indicated by dateformat) as "xfs".
例如,要将JBOD文件系统挂载在/jbodfs路径下,则可以将JBOD文件系统的挂载点路径(用mountpath表示)配置为“/jbodfs”。For example, to mount the JBOD file system in the /jbodfs directory, you can configure the JBOD file system mount point path (represented by mountpath) as "/jbodfs".
可根据如下示意的命令格式进行配置:It can be configured according to the command format as shown below:
metafile=/home/jbodfs.meta;Metafile=/home/jbodfs.meta;
metaformat=ext3;Metaformat=ext3;
datadev=/dev/sdb,/dev/sdc,……,/dev/sdq;Datadev=/dev/sdb, /dev/sdc, ..., /dev/sdq;
dateformat=xfs;Dateformat=xfs;
mountpath=/jbodfs。Mountpath=/jbodfs.
可选地,步骤S30包括:Optionally, step S30 includes:
根据元数据文件的路径信息和格式化类型,对元数据文件进行格式化;并根据数据盘的路径信息和格式化类型,对数据盘进行格式化。The metadata file is formatted according to the path information and formatting type of the metadata file; and the data disk is formatted according to the path information and formatting type of the data disk.
在对元数据文件的路径信息、格式化类型,以及数据盘的路径信息、格 式化类型进行配置,确定元数据文件的路径信息、格式化类型,以及数据盘的路径信息、格式化类型之后,创建JBOD文件系统的装置根据所配置的元数据文件的路径信息,按照所配置的元数据文件的格式化类型,对元数据文件进行格式化;根据所配置的数据盘的路径信息,按照所配置的数据盘的格式化类型,对数据盘进行格式化。Path information, formatting type, and path information of the data disk in the metadata file The configuration type is configured to determine the path information of the metadata file, the format type, and the path information and format type of the data disk. The device that creates the JBOD file system is configured according to the path information of the configured metadata file. Formatting the metadata file, formatting the metadata file; formatting the data disk according to the formatted type of the configured data disk according to the configured path information of the data disk.
例如,在将元数据文件的路径信息配置为“/home/jbodfs.meta”,将元数据文件的格式化类型配置为“ext”的情况下,可根据如下示意的命令格式对元数据文件进行格式化:For example, when the path information of the metadata file is configured as "/home/jbodfs.meta" and the format type of the metadata file is configured as "ext", the metadata file can be performed according to the command format as illustrated below. format:
mkfs-t ext3/home/jbodfs.meta。Mkfs-t ext3/home/jbodfs.meta.
例如,在将数据盘的路径信息配置为“/dev/sdb,sdc,……,/dev/sdq”,将数据盘的格式化类型配置为“xfs”的情况下,可根据如下示意的命令格式对数据盘进行格式化:For example, when the path information of the data disk is configured as "/dev/sdb, sdc, ..., /dev/sdq", and the format type of the data disk is configured as "xfs", the command may be as follows: Format formats the data disk:
mkfs–t xfs/dev/sdb;Mkfs–t xfs/dev/sdb;
mkfs–t xfs/dev/sdc;Mkfs–t xfs/dev/sdc;
……......
mkfs–t xfs/dev/sdq。Mkfs–t xfs/dev/sdq.
可选地,步骤S40包括:Optionally, step S40 includes:
根据元数据文件的路径信息和JBOD文件系统的挂载点路径,对元数据文件中的元数据信息进行挂载;根据数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据盘的挂载点路径,对数据盘进行挂载。The metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
经过对元数据文件中和数据盘进行格式化后,创建JBOD文件系统的装置根据所配置的元数据文件的路径信息,以及所配置的JBOD文件系统的挂载点路径,对元数据文件中的元数据信息(包括路径文件,以及路径文件中包含的每个数据盘的文件目录、文件名称,以及数据文件的路径信息)进行初始化,即对元数据文件中的元数据信息进行挂载;同时根据所配置的数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据 盘的挂载点路径,对数据盘进行初始化,即对数据盘进行挂载。从而给应用层提供JBOD文件系统的文件访问接口,使得在创建JBOD文件系统后,应用层可以访问JBOD文件系统。After formatting the metadata file and the data disk, the device for creating the JBOD file system according to the path information of the configured metadata file and the mount point path of the configured JBOD file system are in the metadata file. The metadata information (including the path file, and the file directory of each data disk included in the path file, the file name, and the path information of the data file) are initialized, that is, the metadata information in the metadata file is mounted; Reading the serial number of the data disk according to the configured path information of the data disk, and obtaining data according to the serial number of the data disk The mount point path of the disk initializes the data disk, that is, mounts the data disk. Therefore, the application layer is provided with a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
例如,在将元数据文件的路径信息配置为“/home/jbodfs.meta”,将JBOD文件系统的挂载点路径配置为“/jbodfs”的情况下,可根据如下示意的命令格式对元数据文件中的元数据信息进行挂载:For example, when the path information of the metadata file is configured as "/home/jbodfs.meta" and the mount point path of the JBOD file system is configured as "/jbodfs", the metadata can be formatted according to the command format as shown below. The metadata information in the file is mounted:
mkdir/jbodfs;Mkdir/jbodfs;
mount–t ext3–o loop/home/jbodfs.meta/jbodfs。Mount–t ext3–o loop/home/jbodfs.meta/jbodfs.
例如,在将数据盘的路径信息配置为“/dev/sdb,/dev/sdc,……,/dev/sdq”的情况下,可读取出JBOD中/dev/sdb路径下数据盘的序列号、/dev/sdc路径下数据盘的序列号、……、/dev/sdq路径下数据盘的序列号,假设/dev/sdb路径下数据盘的序列号为SNB、/dev/sdc路径下数据盘的序列号为SNC、……、/dev/sdq路径下数据盘的序列号为SNQ,则可根据如下示意的目录格式为数据盘进行挂载:For example, in the case where the path information of the data disk is configured as "/dev/sdb, /dev/sdc, ..., /dev/sdq", the sequence of the data disk in the path of /dev/sdb in JBOD can be read and read out. No., the serial number of the data disk in the /dev/sdc path, ..., the serial number of the data disk in the /dev/sdq path, assuming the serial number of the data disk in the /dev/sdb path is SNB, /dev/sdc path If the serial number of the data disk is SNC, ..., /dev/sdq, the serial number of the data disk is SNQ, then the data disk can be mounted according to the directory format shown below:
mkdir/mnt/SNB;Mkdir/mnt/SNB;
mkdir/mnt/SNC;Mkdir/mnt/SNC;
……......
mkdir/mnt/SNQ;Mkdir/mnt/SNQ;
mount–t xfs/dev/sdb/mnt/SNB;Mount–t xfs/dev/sdb/mnt/SNB;
mount–t xfs/dev/sdb/mnt/SNC;Mount–t xfs/dev/sdb/mnt/SNC;
……......
mount–t xfs/dev/sdq mnt/SNQ。Mount–t xfs/dev/sdq mnt/SNQ.
再参照图2,图2为图1中步骤S50的流程示意图。Referring again to FIG. 2, FIG. 2 is a schematic flow chart of step S50 in FIG.
可选地,步骤S50包括以下步骤:Optionally, step S50 includes the following steps:
步骤S51:根据JBOD文件系统的挂载点路径,在JBOD文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD文件系统的路径文件 存放在所述元数据文件中。Step S51: According to the mount point path of the JBOD file system, create a path file of the JBOD file system in the mount point path of the JBOD file system, and set a path file of the JBOD file system. Stored in the metadata file.
步骤S52:根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘。Step S52: Select a data disk to be stored in the data file of the JBOD file system according to a preset policy.
步骤S53:根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息。Step S53: Create a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determine the path of the data file of the JBOD file system on the data disk. information.
步骤S54:将JBOD文件系统的数据文件的路径信息存放在所述JBOD文件系统的路径文件中。Step S54: The path information of the data file of the JBOD file system is stored in the path file of the JBOD file system.
创建JBOD文件系统的装置在侦测到JBOD文件系统创建指令时,通过系统盘在根目录下创建元数据文件,在对元数据文件和数据盘进行格式化,以及对元数据文件和数据盘进行初始化后,创建JBOD文件系统的装置建立JBOD文件系统的路径文件与JBOD文件系统的数据文件的关联对应,包括:系统盘根据所配置的JBOD文件系统的挂载点路径,在JBOD文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD文件系统的路径文件存放在该元数据文件中,例如,在JBOD文件系统的挂载点路径/jbodfs/path下创建名为test.txt的路径文件,该路径文件的路径信息为/jbodfs/path/test.txt;而且根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘,例如,选择JBOD中最空闲的一个数据盘存放JBOD文件系统的数据文件,且该最空闲的数据盘的序列号为SNB,该最空闲的数据盘的挂载点路径为/mnt/SNB。When the device that creates the JBOD file system detects the JBOD file system creation instruction, it creates a metadata file in the root directory through the system disk, formats the metadata file and the data disk, and performs metadata file and data disk. After the initialization, the device that creates the JBOD file system establishes the association between the path file of the JBOD file system and the data file of the JBOD file system, including: the system disk hangs in the JBOD file system according to the mount point path of the configured JBOD file system. Create a path file of the JBOD file system in the load path, and store the path file of the JBOD file system in the metadata file. For example, create a test named named test.txt in the mount path of the JBOD file system/jbodfs/path. The path file, the path information of the path file is /jbodfs/path/test.txt; and the data disk to be stored in the data file of the JBOD file system is selected according to a preset policy, for example, one of the most idle data disks in the JBOD is selected for storage. The data file of the JBOD file system, and the serial number of the most idle data disk is SNB, the mount point of the most idle data disk Is / mnt / SNB.
在选择要存放数据文件的数据盘后,根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息。例如,在所选择的数据盘的序列号为SNB,挂载点路径为/mnt/SNB的情况下,在/mnt/SNB/path下创建名为test.txt的数据文件,由此可确定该数据文件的路径信息为/mnt/SNB/path/test.txt。After selecting the data disk to store the data file, according to the serial number of the selected data disk and the mount point path, create a data file of the JBOD file system in the mount point path of the selected data disk, and determine the JBOD file system. The path information of the data file on the data disk. For example, if the serial number of the selected data disk is SNB and the mount point path is /mnt/SNB, a data file named test.txt is created under /mnt/SNB/path, thereby determining the The path information of the data file is /mnt/SNB/path/test.txt.
在确定数据文件的路径信息为/mnt/SNB/path/test.txt后,将数据文件的路径信息“/mnt/SNB/path/test.txt”存放到/jbodfs/path路径下的路径文件test.txt中,至此,实现了元数据文件中存放的路径文件跟数据盘中存放的数据文件 的关联对应,完成JBOD文件系统的创建。从而应用层要对/jbodfs/path路径下的路径文件test.txt进行操作时,只要打开/mnt/SNB/path下的数据文件test.txt进行操作即可。After the path information of the data file is determined to be /mnt/SNB/path/test.txt, the path information of the data file "/mnt/SNB/path/test.txt" is stored in the path file test under the /jbodfs/path path. In .txt, at this point, the path file stored in the metadata file and the data file stored in the data disk are implemented. Correspondence of the association, complete the creation of the JBOD file system. Therefore, when the application layer needs to operate on the path file test.txt in the /jbodfs/path path, just open the data file test.txt under /mnt/SNB/path.
例如,JBOD文件系统的数据文件存放在序列号为SNB的数据盘中,当应用层需要读写/jbodfs/path路径下的路径文件test.txt,先打开/jbodfs/path路径下的路径文件test.txt,从中获取数据文件实际存放的路径信息/mnt/SNB/path/test.txt,然后根据路径信息/mnt/SNB/path/test.txt读写序列号为SNB数据盘中的数据文件,进而完成对/jbodfs/path路径下的路径文件test.txt的读写操作。For example, the data file of the JBOD file system is stored in the data disk with the serial number SNB. When the application layer needs to read and write the path file test.txt in the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then read and write the serial number as the data file in the SNB data disk according to the path information /mnt/SNB/path/test.txt. Then, the read and write operations of the path file test.txt in the /jbodfs/path path are completed.
又如,JBOD文件系统的数据文件存放在序列号为SNB的数据盘中,当应用层需要删除/jbodfs/path路径下的路径文件test.txt,先打开/jbodfs/path路径下的路径文件test.txt,从中获取数据文件实际存放的路径信息/mnt/SNB/path/test.txt,然后根据路径信息/mnt/SNB/path/test.txt将序列号为SNB的数据盘中的数据文件test.txt删除,再将/jbodfs/path路径下的路径文件test.txt删除,进而完成对/jbodfs/path路径下的路径文件test.txt的删除操作。For example, the data file of the JBOD file system is stored in the data disk with the serial number SNB. When the application layer needs to delete the path file test.txt under the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then use the path information /mnt/SNB/path/test.txt to set the data file in the data disk with the serial number SNB. Delete the .txt file, and then delete the path file test.txt in the /jbodfs/path path to complete the deletion of the path file test.txt in the /jbodfs/path path.
本发明实施例还提供一种创建JBOD文件系统的装置。The embodiment of the invention further provides an apparatus for creating a JBOD file system.
参照图3,图3为本发明实施例创建JBOD文件系统的装置的结构示意图。Referring to FIG. 3, FIG. 3 is a schematic structural diagram of an apparatus for creating a JBOD file system according to an embodiment of the present invention.
如图3所示,本发明实施例中,创建JBOD文件系统的装置包括配置模块100、格式化处理模块200、初始化处理模块300和系统盘400。As shown in FIG. 3, in the embodiment of the present invention, an apparatus for creating a JBOD file system includes a configuration module 100, a formatting processing module 200, an initialization processing module 300, and a system disk 400.
其中,配置模块100设置为当侦测到有JBOD(图未示)接入时,配置JBOD文件系统的路径信息、格式化类型和挂载点路径。The configuration module 100 is configured to configure path information, a format type, and a mount point path of the JBOD file system when a JBOD (not shown) is detected.
格式化处理模块200设置为根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化。The formatting processing module 200 is configured to format the JBOD file system according to the path information and formatting type of the JBOD file system.
初始化处理模块300设置为根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化。The initialization processing module 300 is configured to initialize the JBOD file system according to the path information of the JBOD file system and the mount point path.
系统盘400设置为当侦测到JBOD文件系统创建指令时,创建元数据文 件,以存放JBOD文件系统的路径文件;且根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息。The system disk 400 is set to create a metadata file when a JBOD file system creation instruction is detected. To store the path file of the JBOD file system; and according to the mount point path of the JBOD file system, create a path file of the JBOD file system in the metadata file to store the data file of the JBOD file system on the JBOD data disk. Path information.
为在含有多个数据盘的JBOD上创建多盘JBOD文件系统,本实施例将JBOD连接到创建JBOD文件系统的装置(如服务器主机)上,当创建JBOD文件系统的装置侦测到JBOD文件系统创建指令时,该JBOD文件系统创建指令是JBOD首次连接创建JBOD文件系统的装置时发起的,创建JBOD文件系统的装置通过系统盘400创建元数据文件,利用该元数据文件存放JBOD文件系统的路径文件,以建立JBOD文件系统的路径文件与数据文件的关联对应。In order to create a multi-disk JBOD file system on a JBOD containing multiple data disks, this embodiment connects the JBOD to a device (such as a server host) that creates a JBOD file system, and the device that creates the JBOD file system detects the JBOD file system. When the instruction is created, the JBOD file system creation instruction is initiated when the JBOD first connects to the device that creates the JBOD file system. The device that creates the JBOD file system creates a metadata file through the system disk 400, and uses the metadata file to store the path of the JBOD file system. The file corresponds to the association between the path file of the JBOD file system and the data file.
在创建用于存放JBOD文件系统的路径文件的元数据文件后,通过配置模块100创建配置文件,通过配置文件配置JBOD文件系统的路径信息、格式化类型和挂载点路径,以便在创建JBOD文件系统过程中对JBOD文件系统进行格式化和初始化,为创建JBOD文件系统做好准备。After the metadata file for storing the path file of the JBOD file system is created, the configuration file is created by the configuration module 100, and the path information, the format type, and the mount point path of the JBOD file system are configured through the configuration file, so that the JBOD file is created. The JBOD file system is formatted and initialized during the system process, ready to create a JBOD file system.
在配置模块100对JBOD文件系统的路径信息、格式化类型和挂载点路径进行配置,确定JBOD文件系统的路径信息、格式化类型和挂载点路径之后,创建JBOD文件系统的装置中格式化处理模块200根据所配置的JBOD文件系统的路径信息,按照所配置的JBOD文件系统的格式化类型,对JBOD文件系统进行格式化。After the configuration module 100 configures the path information, the format type, and the mount point path of the JBOD file system, and determines the path information, the format type, and the mount point path of the JBOD file system, the device is created in the JBOD file system. The processing module 200 formats the JBOD file system according to the format information of the configured JBOD file system according to the configured path information of the JBOD file system.
经过格式化处理模块200对JBOD文件系统进行格式化后,创建JBOD文件系统的装置中初始化处理模块300根据所配置的JBOD文件系统的路径信息,以及所配置的JBOD文件系统的挂载点路径,对JBOD文件系统进行初始化,从而给应用层提供JBOD文件系统的文件访问接口,使得在创建JBOD文件系统后,应用层可以访问JBOD文件系统。After the formatting processing module 200 formats the JBOD file system, the initialization processing module 300 in the device for creating the JBOD file system according to the path information of the configured JBOD file system and the mount point path of the configured JBOD file system. The JBOD file system is initialized to provide the application layer with a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
创建JBOD文件系统的装置在侦测到JBOD文件系统创建指令时,通过系统盘在根目录下创建元数据文件,在格式化处理模块200对JBOD文件系统进行格式化,以及初始化处理模块300对JBOD文件系统进行初始化后,创建JBOD文件系统的装置建立JBOD文件系统的路径文件与JBOD文件系统的数据文件的关联对应,包括:创建JBOD文件系统的装置中系统盘400 根据所配置的JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,将JBOD文件系统的数据文件在JBOD的数据盘上的路径信息存放在JBOD文件系统的路径文件中,从而通过JBOD文件系统的路径文件存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息,实现JBOD文件系统的路径文件与JBOD文件系统的数据文件的关联对应,完成JBOD文件系统的创建。由于JBOD上包含多个数据盘,因此每个数据盘上存放的数据文件在路径文件中都有对应的路径信息,即路径文件存放每个数据盘中的数据文件的路径信息。The device for creating the JBOD file system creates a metadata file in the root directory through the system disk when the JBOD file system creation instruction is detected, formats the JBOD file system in the formatting processing module 200, and initializes the processing module 300 to the JBOD. After the file system is initialized, the device that creates the JBOD file system establishes the association between the path file of the JBOD file system and the data file of the JBOD file system, including: the system disk 400 in the device that creates the JBOD file system. According to the mount point path of the configured JBOD file system, create a path file of the JBOD file system in the metadata file, and store the path information of the data file of the JBOD file system on the JBOD data disk in the path file of the JBOD file system. Therefore, the path file of the JBOD file system is stored in the path file of the JBOD file system on the data disk of the JBOD file system, and the path file of the JBOD file system is associated with the data file of the JBOD file system, and the JBOD file system is completed. create. Since the JBOD contains multiple data disks, the data files stored on each data disk have corresponding path information in the path file, that is, the path file stores the path information of the data files in each data disk.
JBOD文件系统的路径文件中不仅包含JBOD文件系统的数据文件在JBOD的每个数据盘上的路径信息,还包含JBOD中每个数据盘的文件目录、文件名称。The path file of the JBOD file system not only contains the path information of the data file of the JBOD file system on each data disk of the JBOD, but also the file directory and file name of each data disk in the JBOD.
本发明实施例创建JBOD文件系统的装置,通过将JBOD文件系统的数据文件在数据盘上的路径信息存放在JBOD文件系统的路径文件中,实现JBOD文件系统的路径文件与数据文件的关联对应,从而可以在含有多个数据盘的JBOD上创建多盘JBOD文件系统,当JBOD上有一个或多个数据盘损坏时,只是丢失损坏的数据盘上的数据,而不影响JBOD文件系统正常使用,提高了JBOD使用的可靠性。The device for creating a JBOD file system in the embodiment of the present invention stores the path information of the data file of the JBOD file system on the data disk in the path file of the JBOD file system, so as to implement the association between the path file and the data file of the JBOD file system. Therefore, a multi-disk JBOD file system can be created on a JBOD containing multiple data disks. When one or more data disks on the JBOD are damaged, only the data on the damaged data disk is lost, without affecting the normal use of the JBOD file system. Improve the reliability of JBOD use.
可选地,所述配置模块100是设置为:Optionally, the configuration module 100 is configured to:
创建配置文件,通过所述创建配置文件配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式化类型,以及JBOD文件系统的挂载点路径。Create a configuration file, configure the path information and formatting type of the metadata file, the path information and formatting type of the data disk, and the mount point path of the JBOD file system by using the created configuration file.
上述JBOD文件系统的路径信息包括元数据文件的路径信息和数据盘的路径信息,上述JBOD文件系统的格式化类型包括元数据文件的格式化类型和数据盘的格式化类型。The path information of the JBOD file system includes path information of the metadata file and path information of the data disk. The format type of the JBOD file system includes a format type of the metadata file and a format type of the data disk.
在侦测到有JBOD接入的情况下,创建JBOD文件系统的装置中配置模块100配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式 化类型,以及JBOD文件系统的挂载点路径。In the case that JBOD access is detected, the configuration module 100 in the device for creating the JBOD file system configures the path information and formatting type of the metadata file, and the path information and format of the data disk. The type, as well as the mount point path of the JBOD file system.
例如,要在创建JBOD文件系统的装置的系统盘的根目录/home下创建名为jbodfs.meta的元数据文件(用metafile表示),要在元数据文件中构建ext文件系统,则配置模块100可以将元数据文件的路径信息配置为“/home/jbodfs.meta”,将元数据文件的格式化类型(用metaformat表示)配置为“ext”。For example, to create a metadata file named jbodfs.meta (indicated by metafile) under the root directory /home of the system disk of the device that creates the JBOD file system, to build the ext file system in the metadata file, the configuration module 100 The path information of the metadata file can be configured as "/home/jbodfs.meta", and the format type of the metadata file (indicated by metaformat) can be configured as "ext".
例如,JBOD包含16个数据盘,且数据盘(用datadev表示)的设备名称分别为sdb,……,sdq,要在数据盘中构建xfs文件系统,则配置模块100可以将数据盘的路径信息配置为“/dev/sdb,/dev/sdc,……,/dev/sdq”,将数据盘的格式化类型(用dateformat表示)配置为“xfs”。For example, the JBOD contains 16 data disks, and the device names of the data disks (represented by datadev) are sdb, ..., sdq. To build the xfs file system in the data disk, the configuration module 100 can set the path information of the data disk. Configured as "/dev/sdb, /dev/sdc, ..., /dev/sdq", configure the format type of the data disk (indicated by dateformat) as "xfs".
例如,要将JBOD文件系统挂载在/jbodfs路径下,则配置模块100可以将JBOD文件系统的挂载点路径(用mountpath表示)配置为“/jbodfs”。For example, to mount the JBOD file system in the /jbodfs path, the configuration module 100 can configure the mount path of the JBOD file system (represented by mountpath) as "/jbodfs".
可根据如下示意的命令格式进行配置:It can be configured according to the command format as shown below:
metafile=/home/jbodfs.meta;Metafile=/home/jbodfs.meta;
metaformat=ext3;Metaformat=ext3;
datadev=/dev/sdb,/dev/sdc,……,/dev/sdq;Datadev=/dev/sdb, /dev/sdc, ..., /dev/sdq;
dateformat=xfs;Dateformat=xfs;
mountpath=/jbodfs。Mountpath=/jbodfs.
可选地,所述格式化处理模块200是设置为:Optionally, the formatting processing module 200 is configured to:
根据元数据文件的路径信息和格式化类型,对元数据文件进行格式化;并根据数据盘的路径信息和格式化类型,对数据盘进行格式化。The metadata file is formatted according to the path information and formatting type of the metadata file; and the data disk is formatted according to the path information and formatting type of the data disk.
在配置模块100对元数据文件的路径信息、格式化类型,以及数据盘的路径信息、格式化类型进行配置,确定元数据文件的路径信息、格式化类型,以及数据盘的路径信息、格式化类型之后,创建JBOD文件系统的装置中格式化处理模块200根据所配置的元数据文件的路径信息,按照所配置的元数据文件的格式化类型,对元数据文件进行格式化;同时根据所配置的数 据盘的路径信息,按照所配置的数据盘的格式化类型,对数据盘进行格式化。The configuration module 100 configures the path information of the metadata file, the format type, and the path information and format type of the data disk, determines the path information of the metadata file, the format type, and the path information and formatting of the data disk. After the type, the formatting processing module 200 in the device that creates the JBOD file system formats the metadata file according to the format information of the configured metadata file according to the configured path information of the metadata file; Number According to the path information of the disk, the data disk is formatted according to the formatted type of the configured data disk.
例如,在将元数据文件的路径信息配置为“/home/jbodfs.meta”,将元数据文件的格式化类型配置为“ext”的情况下,格式化处理模块200可根据如下示意的命令格式对元数据文件进行格式化:For example, in the case where the path information of the metadata file is configured as "/home/jbodfs.meta" and the format type of the metadata file is configured as "ext", the formatting processing module 200 can be in accordance with the command format as illustrated below. Format the metadata file:
mkfs-t ext3/home/jbodfs.meta。Mkfs-t ext3/home/jbodfs.meta.
例如,在将数据盘的路径信息配置为“/dev/sdb,sdc,……,/dev/sdq”,将数据盘的格式化类型配置为“xfs”的情况下,格式化处理模块200可根据如下示意的命令格式对数据盘进行格式化:For example, in the case where the path information of the data disk is configured as "/dev/sdb, sdc, ..., /dev/sdq", and the format type of the data disk is configured as "xfs", the formatting processing module 200 may Format the data disk according to the command format as shown below:
mkfs–t xfs/dev/sdb;Mkfs–t xfs/dev/sdb;
mkfs–t xfs/dev/sdc;Mkfs–t xfs/dev/sdc;
……......
mkfs–t xfs/dev/sdq。Mkfs–t xfs/dev/sdq.
可选地,所述初始化处理模块300是设置为:Optionally, the initialization processing module 300 is configured to:
根据元数据文件的路径信息和JBOD文件系统的挂载点路径,对元数据文件中的元数据信息进行挂载;根据数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据盘的挂载点路径,对数据盘进行挂载。The metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
经过格式化处理模块200对元数据文件中和数据盘进行格式化后,创建JBOD文件系统的装置中初始化处理模块300根据所配置的元数据文件的路径信息,以及所配置的JBOD文件系统的挂载点路径,对元数据文件中的元数据信息进行初始化,即对元数据文件中的元数据信息(包括路径文件,以及路径文件中包含的每个数据盘的文件目录、文件名称,以及数据文件的路径信息)进行挂载;同时根据所配置的数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据盘的挂载点路径,对数据盘进行初始化,即对数据盘进行挂载。从而给应用层提供JBOD文件系统的文件访问接口,使得在创建JBOD文件系统后,应用层可以访问JBOD文件系统。 After the formatting processing module 200 formats the metadata file and the data disk, the initialization processing module 300 in the device for creating the JBOD file system is configured according to the path information of the configured metadata file and the configured JBOD file system. The carry point path, which initializes the metadata information in the metadata file, that is, the metadata information in the metadata file (including the path file, and the file directory, file name, and data of each data disk included in the path file) The path information of the file is mounted; at the same time, according to the path information of the configured data disk, the serial number of the data disk is read, and the mount point path of the data disk is obtained according to the serial number of the data disk, and the data disk is performed. Initialization, that is, mounting the data disk. Therefore, the application layer is provided with a file access interface of the JBOD file system, so that after the JBOD file system is created, the application layer can access the JBOD file system.
例如,在将元数据文件的路径信息配置为“/home/jbodfs.meta”,将JBOD文件系统的挂载点路径配置为“/jbodfs”的情况下,可根据如下示意的命令格式对元数据文件中的元数据信息进行挂载:For example, when the path information of the metadata file is configured as "/home/jbodfs.meta" and the mount point path of the JBOD file system is configured as "/jbodfs", the metadata can be formatted according to the command format as shown below. The metadata information in the file is mounted:
mkdir/jbodfs;Mkdir/jbodfs;
mount–t ext3–o loop/home/jbodfs.meta/jbodfs。Mount–t ext3–o loop/home/jbodfs.meta/jbodfs.
例如,在将数据盘的路径信息配置为“/dev/sdb,/dev/sdc,……,/dev/sdq”的情况下,可读取出JBOD中/dev/sdb路径下数据盘的序列号、/dev/sdc路径下数据盘的序列号、……、/dev/sdq路径下数据盘的序列号,假设/dev/sdb路径下数据盘的序列号为SNB、/dev/sdc路径下数据盘的序列号为SNC、……、/dev/sdq路径下数据盘的序列号为SNQ,则可根据如下示意的目录格式为数据盘进行挂载:For example, in the case where the path information of the data disk is configured as "/dev/sdb, /dev/sdc, ..., /dev/sdq", the sequence of the data disk in the path of /dev/sdb in JBOD can be read and read out. No., the serial number of the data disk in the /dev/sdc path, ..., the serial number of the data disk in the /dev/sdq path, assuming the serial number of the data disk in the /dev/sdb path is SNB, /dev/sdc path If the serial number of the data disk is SNC, ..., /dev/sdq, the serial number of the data disk is SNQ, then the data disk can be mounted according to the directory format shown below:
mkdir/mnt/SNB;Mkdir/mnt/SNB;
mkdir/mnt/SNC;Mkdir/mnt/SNC;
……......
mkdir/mnt/SNQ;Mkdir/mnt/SNQ;
mount–t xfs/dev/sdb/mnt/SNB;Mount–t xfs/dev/sdb/mnt/SNB;
mount–t xfs/dev/sdb/mnt/SNC;Mount–t xfs/dev/sdb/mnt/SNC;
……......
mount–t xfs/dev/sdq mnt/SNQ。Mount–t xfs/dev/sdq mnt/SNQ.
再参照图4,图4为图3中系统盘的结构示意图。Referring again to FIG. 4, FIG. 4 is a schematic structural view of the system disk of FIG.
如图3和图4所示,系统盘400包括元数据文件创建单元410、路径文件创建单元420、数据盘选择单元430、数据文件创建单元440和文件关联单元450。As shown in FIGS. 3 and 4, the system disk 400 includes a metadata file creating unit 410, a path file creating unit 420, a data disk selecting unit 430, a data file creating unit 440, and a file associating unit 450.
其中,元数据文件创建单元410设置为当侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件。The metadata file creation unit 410 is configured to create a metadata file to store a path file of the JBOD file system when the JBOD file system creation instruction is detected.
路径文件创建单元420设置为根据JBOD文件系统的挂载点路径,在JBOD文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD 文件系统的路径文件存放在所述元数据文件中。The path file creation unit 420 is configured to create a path file of the JBOD file system in the mount point path of the JBOD file system according to the mount point path of the JBOD file system, and the JBOD The path file of the file system is stored in the metadata file.
数据盘选择单元430设置为根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘。The data disk selection unit 430 is configured to select a data disk to be stored in the data file of the JBOD file system according to a preset policy.
数据文件创建单元440设置为根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息。The data file creating unit 440 is configured to create a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determine the data file of the JBOD file system in the data. Path information on the disk.
文件关联单元450设置为将JBOD文件系统的数据文件的路径信息存放在所述JBOD文件系统的路径文件中。The file association unit 450 is arranged to store the path information of the data file of the JBOD file system in the path file of the JBOD file system.
创建JBOD文件系统的装置在侦测到JBOD文件系统创建指令时,通过系统盘400中的元数据文件创建单元410在系统盘400的根目录下创建元数据文件,在格式化处理模块200对元数据文件和数据盘进行格式化,以及初始化处理模块300对元数据文件和数据盘进行初始化后,创建JBOD文件系统的装置建立JBOD文件系统的路径文件与JBOD文件系统的数据文件的关联对应,包括:路径文件创建单元420根据所配置的JBOD文件系统的挂载点路径,在JBOD文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD文件系统的路径文件存放在该元数据文件中,例如,在JBOD文件系统的挂载点路径/jbodfs/path下创建名为test.txt的路径文件,该路径文件的路径信息为/jbodfs/path/test.txt;而且数据盘选择单元430根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘,例如,选择JBOD中最空闲的一个数据盘存放JBOD文件系统的数据文件,且该最空闲的数据盘的序列号为SNB,该最空闲的数据盘的挂载点路径为/mnt/SNB。When the JBOD file system creation instruction is detected, the metadata file creation unit 410 in the system disk 400 creates a metadata file in the root directory of the system disk 400, and the format processing module 200 pairs the element. After the data file and the data disk are formatted, and the initialization processing module 300 initializes the metadata file and the data disk, the device that creates the JBOD file system establishes the association between the path file of the JBOD file system and the data file of the JBOD file system, including The path file creation unit 420 creates a path file of the JBOD file system in the mount point path of the JBOD file system according to the mount point path of the configured JBOD file system, and stores the path file of the JBOD file system in the metadata file. For example, a path file named test.txt is created under the mount point path /jbodfs/path of the JBOD file system, and the path information of the path file is /jbodfs/path/test.txt; and the data disk selection unit 430 Select the data disk to be stored in the data file of the JBOD file system according to the preset policy, for example, select the most idle in JBOD A data storage disk JBOD file system data files, data and the most idle SNB disk serial number, the least busy disk mount point path data for / mnt / SNB.
在数据盘选择单元430选择要存放数据文件的数据盘后,数据文件创建单元440根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息。例如,在所选择的数据盘的序列号为SNB,挂载点路径为/mnt/SNB的情况下,在/mnt/SNB/path下创建名为test.txt的数据文件,由此可确定该数据文件的路径信息为/mnt/SNB/path/test.txt。After the data disk selection unit 430 selects the data disk to store the data file, the data file creation unit 440 creates the JBOD file system in the mount point path of the selected data disk according to the serial number of the selected data disk and the mount point path. The data file and determine the path information of the JBOD file system data file on the data disk. For example, if the serial number of the selected data disk is SNB and the mount point path is /mnt/SNB, a data file named test.txt is created under /mnt/SNB/path, thereby determining the The path information of the data file is /mnt/SNB/path/test.txt.
在数据文件创建单元440确定数据文件的路径信息为/mnt/SNB/path/test.txt后,文件关联单元450将数据文件的路径信息 “/mnt/SNB/path/test.txt”存放到/jbodfs/path路径下的路径文件test.txt中,至此,实现了元数据文件中存放的路径文件跟数据盘中存放的数据文件的关联对应,完成JBOD文件系统的创建。从而应用层要对/jbodfs/path路径下的路径文件test.txt进行操作时,只要打开/mnt/SNB/path下的数据文件test.txt进行操作即可。After the data file creation unit 440 determines that the path information of the data file is /mnt/SNB/path/test.txt, the file association unit 450 will path information of the data file. "/mnt/SNB/path/test.txt" is stored in the path file test.txt in the path of /jbodfs/path. At this point, the association between the path file stored in the metadata file and the data file stored in the data disk is implemented. Correspondingly, the creation of the JBOD file system is completed. Therefore, when the application layer needs to operate on the path file test.txt in the /jbodfs/path path, just open the data file test.txt under /mnt/SNB/path.
例如,JBOD文件系统的数据文件存放在序列号为SNB的数据盘中,当应用层需要读写/jbodfs/path路径下的路径文件test.txt,先打开/jbodfs/path路径下的路径文件test.txt,从中获取数据文件实际存放的路径信息/mnt/SNB/path/test.txt,然后根据路径信息/mnt/SNB/path/test.txt读写序列号为SNB数据盘中的数据文件,进而完成对/jbodfs/path路径下的路径文件test.txt的读写操作。For example, the data file of the JBOD file system is stored in the data disk with the serial number SNB. When the application layer needs to read and write the path file test.txt in the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then read and write the serial number as the data file in the SNB data disk according to the path information /mnt/SNB/path/test.txt. Then, the read and write operations of the path file test.txt in the /jbodfs/path path are completed.
又如,JBOD文件系统的数据文件存放在序列号为SNB的数据盘中,当应用层需要删除/jbodfs/path路径下的路径文件test.txt,先打开/jbodfs/path路径下的路径文件test.txt,从中获取数据文件实际存放的路径信息/mnt/SNB/path/test.txt,然后根据路径信息/mnt/SNB/path/test.txt将序列号为SNB的数据盘中的数据文件test.txt删除,再将/jbodfs/path路径下的路径文件test.txt删除,进而完成对/jbodfs/path路径下的路径文件test.txt的删除操作。For example, the data file of the JBOD file system is stored in the data disk with the serial number SNB. When the application layer needs to delete the path file test.txt under the path of /jbodfs/path, first open the path file test under the path of /jbodfs/path. .txt, obtain the path information /mnt/SNB/path/test.txt where the data file is actually stored, and then use the path information /mnt/SNB/path/test.txt to set the data file in the data disk with the serial number SNB. Delete the .txt file, and then delete the path file test.txt in the /jbodfs/path path to complete the deletion of the path file test.txt in the /jbodfs/path path.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现,相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本发明不限制于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or a portion of the steps described above can be accomplished by a program that instructs the associated hardware, such as a read-only memory, a magnetic or optical disk, and the like. Optionally, all or part of the steps of the foregoing embodiments may also be implemented by using one or more integrated circuits. Accordingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware, or may be implemented by using a software function module. Formal realization. The invention is not limited to any specific form of combination of hardware and software.
以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformation of the present invention and the contents of the drawings may be directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of the present invention.
工业实用性 Industrial applicability
上述技术方案实现了当JBOD上有一个或多个数据盘损坏时,只是丢失损坏的数据盘上的数据,而不影响JBOD文件系统正常使用,提高了JBOD使用的可靠性。 The above technical solution realizes that when one or more data disks on the JBOD are damaged, only the data on the damaged data disk is lost, and the normal use of the JBOD file system is not affected, thereby improving the reliability of the JBOD use.

Claims (11)

  1. 一种创建磁盘簇JBOD文件系统的方法,所述方法包括:A method of creating a disk cluster JBOD file system, the method comprising:
    当侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件;When the JBOD file system creation instruction is detected, a metadata file is created to store the path file of the JBOD file system;
    创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径;Create a configuration file to configure the path information, format type, and mount point path of the JBOD file system.
    根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化;Format the JBOD file system according to the path information and formatting type of the JBOD file system;
    根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化;Initializing the JBOD file system according to the path information of the JBOD file system and the mount point path;
    根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息。According to the mount point path of the JBOD file system, a path file of the JBOD file system is created in the metadata file to store the path information of the data file of the JBOD file system on the data disk of the JBOD.
  2. 如权利要求1所述的创建JBOD文件系统的方法,其中,所述创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径包括:The method of creating a JBOD file system according to claim 1, wherein the creating a configuration file to configure a path information, a format type, and a mount point path of the JBOD file system includes:
    创建配置文件,通过所述创建配置文件配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式化类型,以及JBOD文件系统的挂载点路径。Create a configuration file, configure the path information and formatting type of the metadata file, the path information and formatting type of the data disk, and the mount point path of the JBOD file system by using the created configuration file.
  3. 如权利要求2所述的创建JBOD文件系统的方法,其中,所述根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化包括:The method of creating a JBOD file system according to claim 2, wherein the formatting the JBOD file system according to the path information and the formatting type of the JBOD file system comprises:
    根据元数据文件的路径信息和格式化类型,对元数据文件进行格式化;并根据数据盘的路径信息和格式化类型,对数据盘进行格式化。The metadata file is formatted according to the path information and formatting type of the metadata file; and the data disk is formatted according to the path information and formatting type of the data disk.
  4. 如权利要求2或3所述的创建JBOD文件系统的方法,其中,所述根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化 包括:The method for creating a JBOD file system according to claim 2 or 3, wherein the JBOD file system is initialized according to the path information of the JBOD file system and the mount point path. include:
    根据元数据文件的路径信息和JBOD文件系统的挂载点路径,对元数据文件中的元数据信息进行挂载;根据数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据盘的挂载点路径,对数据盘进行挂载。The metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
  5. 如权利要求4所述的创建JBOD文件系统的方法,其中,所述根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在数据盘上的路径信息包括:The method for creating a JBOD file system according to claim 4, wherein the path file of the JBOD file system is created in the metadata file according to the mount point path of the JBOD file system, so as to store the data file of the JBOD file system. The path information on the data disk includes:
    根据JBOD文件系统的挂载点路径,在JBOD文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD文件系统的路径文件存放在所述元数据文件中;According to the mount point path of the JBOD file system, create a path file of the JBOD file system in the mount point path of the JBOD file system, and store the path file of the JBOD file system in the metadata file;
    根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘;Select the data disk to be stored in the data file of the JBOD file system according to a preset policy;
    根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息;Creating a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determining path information of the data file of the JBOD file system on the data disk;
    将JBOD文件系统的数据文件的路径信息存放在所述JBOD文件系统的路径文件中。The path information of the data file of the JBOD file system is stored in the path file of the JBOD file system.
  6. 一种创建磁盘簇JBOD文件系统的装置,所述装置包括:An apparatus for creating a disk cluster JBOD file system, the apparatus comprising:
    配置模块,设置为创建配置文件,以配置JBOD文件系统的路径信息、格式化类型和挂载点路径;The configuration module is configured to create a configuration file to configure path information, format type, and mount point path of the JBOD file system;
    格式化处理模块,设置为根据JBOD文件系统的路径信息和格式化类型,对JBOD文件系统进行格式化;The formatting processing module is configured to format the JBOD file system according to the path information and the formatting type of the JBOD file system;
    初始化处理模块,设置为根据JBOD文件系统的路径信息和挂载点路径,对JBOD文件系统进行初始化;The initialization processing module is configured to initialize the JBOD file system according to the path information of the JBOD file system and the mount point path;
    系统盘,设置为当侦测到JBOD文件系统创建指令时,创建元数据文件, 以存放JBOD文件系统的路径文件,且根据JBOD文件系统的挂载点路径,在元数据文件中创建JBOD文件系统的路径文件,以存放JBOD文件系统的数据文件在JBOD的数据盘上的路径信息。The system disk is set to create a metadata file when the JBOD file system creation instruction is detected. To store the path file of the JBOD file system, and create a path file of the JBOD file system in the metadata file according to the mount point path of the JBOD file system, to store the path information of the JBOD file system data file on the JBOD data disk. .
  7. 如权利要求6所述的创建JBOD文件系统的装置,其中,所述配置模块是设置为:The apparatus for creating a JBOD file system according to claim 6, wherein the configuration module is configured to:
    创建配置文件,通过所述创建配置文件配置元数据文件的路径信息和格式化类型、数据盘的路径信息和格式化类型,以及JBOD文件系统的挂载点路径。Create a configuration file, configure the path information and formatting type of the metadata file, the path information and formatting type of the data disk, and the mount point path of the JBOD file system by using the created configuration file.
  8. 如权利要求7所述的创建JBOD文件系统的装置,其中,所述格式化处理模块是设置为:The apparatus for creating a JBOD file system according to claim 7, wherein said formatting processing module is configured to:
    根据元数据文件的路径信息和格式化类型,对元数据文件进行格式化;并根据数据盘的路径信息和格式化类型,对数据盘进行格式化。The metadata file is formatted according to the path information and formatting type of the metadata file; and the data disk is formatted according to the path information and formatting type of the data disk.
  9. 如权利要求7或8所述的创建JBOD文件系统的装置,其中,所述初始化处理模块是设置为:The apparatus for creating a JBOD file system according to claim 7 or 8, wherein the initialization processing module is set to:
    根据元数据文件的路径信息和JBOD文件系统的挂载点路径,对元数据文件中的元数据信息进行挂载;根据数据盘的路径信息,读取数据盘的序列号,并根据所述数据盘的序列号获取数据盘的挂载点路径,对数据盘进行挂载。The metadata information in the metadata file is mounted according to the path information of the metadata file and the mount point path of the JBOD file system; and the serial number of the data disk is read according to the path information of the data disk, and according to the data The serial number of the disk acquires the mount point path of the data disk and mounts the data disk.
  10. 如权利要求9所述的创建JBOD文件系统的装置,其中,所述系统盘包括:The apparatus for creating a JBOD file system according to claim 9, wherein the system disk comprises:
    元数据文件创建单元,设置为当侦测到JBOD文件系统创建指令时,创建元数据文件,以存放JBOD文件系统的路径文件;The metadata file creation unit is configured to create a metadata file to store the path file of the JBOD file system when the JBOD file system creation instruction is detected;
    路径文件创建单元,设置为根据JBOD文件系统的挂载点路径,在JBOD 文件系统的挂载点路径下创建JBOD文件系统的路径文件,将JBOD文件系统的路径文件存放在所述元数据文件中;Path file creation unit, set to the mount point path according to the JBOD file system, in JBOD Create a path file of the JBOD file system in the mount point path of the file system, and store the path file of the JBOD file system in the metadata file;
    数据盘选择单元,设置为根据预设的策略选择JBOD文件系统的数据文件要存放的数据盘;The data disk selection unit is configured to select a data disk to be stored in the data file of the JBOD file system according to a preset policy;
    数据文件创建单元,设置为根据所选择数据盘的序列号和挂载点路径,在所选择数据盘的挂载点路径下创建JBOD文件系统的数据文件,并确定JBOD文件系统的数据文件在数据盘上的路径信息;The data file creation unit is configured to create a data file of the JBOD file system in the mount point path of the selected data disk according to the serial number and the mount point path of the selected data disk, and determine the data file of the JBOD file system in the data. Path information on the disk;
    文件关联单元,设置为将JBOD文件系统的数据文件的路径信息存放在所述JBOD文件系统的路径文件中。The file association unit is configured to store the path information of the data file of the JBOD file system in the path file of the JBOD file system.
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1~5中任一项所述方法。 A computer storage medium having stored therein computer executable instructions for performing the method of any one of claims 1 to 5.
PCT/CN2015/072932 2014-06-26 2015-02-12 Method and apparatus for creating jbod file system WO2015196820A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410299366.3A CN105279095B (en) 2014-06-26 2014-06-26 Create the method and device of JBOD file system
CN201410299366.3 2014-06-26

Publications (1)

Publication Number Publication Date
WO2015196820A1 true WO2015196820A1 (en) 2015-12-30

Family

ID=54936708

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/072932 WO2015196820A1 (en) 2014-06-26 2015-02-12 Method and apparatus for creating jbod file system

Country Status (2)

Country Link
CN (1) CN105279095B (en)
WO (1) WO2015196820A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197291A (en) * 2018-01-19 2018-06-22 北京小米移动软件有限公司 Operation performs method and device
CN113422791A (en) * 2020-06-08 2021-09-21 阿里巴巴集团控股有限公司 Cloud service configuration method and device, electronic equipment and computer-readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101840314A (en) * 2010-05-05 2010-09-22 北京星网锐捷网络技术有限公司 Method, device and server for expanding storage space of database
CN101923444A (en) * 2009-06-09 2010-12-22 Lsi公司 N-way directly connected any to any controller architecture
CN101984399A (en) * 2010-10-29 2011-03-09 中兴通讯股份有限公司 Management method and system of soft redundant array of independent disk

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6148349A (en) * 1998-02-06 2000-11-14 Ncr Corporation Dynamic and consistent naming of fabric attached storage by a file system on a compute node storing information mapping API system I/O calls for data objects with a globally unique identification
IE20000203A1 (en) * 1999-03-25 2001-02-21 Converge Net Technologies Inc Storage domain management system
US7293133B1 (en) * 2003-12-31 2007-11-06 Veritas Operating Corporation Performing operations without requiring split mirrors in a multi-class file system
US7574435B2 (en) * 2006-05-03 2009-08-11 International Business Machines Corporation Hierarchical storage management of metadata
WO2011031903A2 (en) * 2009-09-09 2011-03-17 Fusion-Io, Inc. Apparatus, system, and method for allocating storage

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101923444A (en) * 2009-06-09 2010-12-22 Lsi公司 N-way directly connected any to any controller architecture
CN101840314A (en) * 2010-05-05 2010-09-22 北京星网锐捷网络技术有限公司 Method, device and server for expanding storage space of database
CN101984399A (en) * 2010-10-29 2011-03-09 中兴通讯股份有限公司 Management method and system of soft redundant array of independent disk

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197291A (en) * 2018-01-19 2018-06-22 北京小米移动软件有限公司 Operation performs method and device
CN108197291B (en) * 2018-01-19 2022-01-11 北京小米移动软件有限公司 Operation execution method and device
CN113422791A (en) * 2020-06-08 2021-09-21 阿里巴巴集团控股有限公司 Cloud service configuration method and device, electronic equipment and computer-readable storage medium
CN113422791B (en) * 2020-06-08 2024-01-09 阿里巴巴集团控股有限公司 Cloud service configuration method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN105279095B (en) 2019-09-13
CN105279095A (en) 2016-01-27

Similar Documents

Publication Publication Date Title
US8706859B2 (en) Method and apparatus of data center file system
US9880759B2 (en) Metadata for data storage array
US8438136B2 (en) Backup catalog recovery from replicated data
US8122212B2 (en) Method and apparatus for logical volume management for virtual machine environment
US10564874B2 (en) Dynamically managing a table of contents
US8849966B2 (en) Server image capacity optimization
US9575858B2 (en) Dynamic protection of storage resources for disaster recovery
US10880387B2 (en) Selective token clash checking for a data write
US8555025B2 (en) Selective device access control
KR101693683B1 (en) Virtual database rewind
US20160062671A1 (en) Restoring data
US20170193000A1 (en) Recovering from a pending uncompleted reorganization of a data set
US20170364378A1 (en) Live storage domain decommissioning in a virtual environment
US10725661B2 (en) Selective write control
WO2015196820A1 (en) Method and apparatus for creating jbod file system
US20200004637A1 (en) Comingling conventional and backup volumes in tiered storage systems
US10606802B2 (en) Catalog backup and recovery using logical mirroring
US20230222090A1 (en) Test adaption and distribution according to customer knowledge base
US8700896B1 (en) Techniques for automatic management of file system encryption drivers
US9471223B2 (en) Volume class management
US10162531B2 (en) Physical allocation unit optimization
Fisk Mastering Ceph: Infrastructure storage solutions with the latest Ceph release
US10866752B2 (en) Reclaiming storage space in raids made up of heterogeneous storage drives
US10394483B2 (en) Target volume shadow copy
US10248353B2 (en) Dynamicly freeing storage space in tiered storage systems

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15811381

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15811381

Country of ref document: EP

Kind code of ref document: A1