KR102408150B1 - Disk Allocation Method for Manipulating Cluster Fragmentation - Google Patents

Disk Allocation Method for Manipulating Cluster Fragmentation Download PDF

Info

Publication number
KR102408150B1
KR102408150B1 KR1020200025674A KR20200025674A KR102408150B1 KR 102408150 B1 KR102408150 B1 KR 102408150B1 KR 1020200025674 A KR1020200025674 A KR 1020200025674A KR 20200025674 A KR20200025674 A KR 20200025674A KR 102408150 B1 KR102408150 B1 KR 102408150B1
Authority
KR
South Korea
Prior art keywords
cluster
disk
file
files
target
Prior art date
Application number
KR1020200025674A
Other languages
Korean (ko)
Other versions
KR20210110495A (en
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 동양대학교 산학협력단
Priority to KR1020200025674A priority Critical patent/KR102408150B1/en
Publication of KR20210110495A publication Critical patent/KR20210110495A/en
Application granted granted Critical
Publication of KR102408150B1 publication Critical patent/KR102408150B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1724Details of de-fragmentation performed by the file system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

본 발명은 파일 데이터의 순차적인 삭제를 통하여 파편화된 디스크 클러스터에 함께 저장된 임의의 다른 파일을 디스크 조각 모음을 통하여 특정된 클러스터에 데이터를 할당하여 저장할 수 있는 디스크 할당방법에 관한 것이다.
본 발명에 따르면, 파일의 생성이나 삭제, 복사와 같은 간단한 파일명령들을 사용함에 따라 구현이 용이하고, 특정된 클러스터에 파일 데이터를 임의로 할당 및 할당해제하고 이에 따라 디렉토리 관련 클러스터와 파일의 내용이 규칙적으로 저장할 수 있어, 디스크 내에 파일 및 디렉토리를 효율적이고 용이하게 취급할 수 있다.
The present invention relates to a disk allocation method capable of storing arbitrary other files stored together in a fragmented disk cluster through sequential deletion of file data by allocating data to a specified cluster through disk defragmentation.
According to the present invention, it is easy to implement by using simple file commands such as creation, deletion, and copying of files, and arbitrarily allocating and de-allocating file data to a specified cluster so that directory-related clusters and contents of files are regular. , so that files and directories on disk can be handled efficiently and easily.

Description

클러스터의 할당을 임의로 조작할 수 있는 디스크 할당방법{Disk Allocation Method for Manipulating Cluster Fragmentation}Disk Allocation Method for Manipulating Cluster Fragmentation

본 발명은 클러스터의 할당을 임의로 조작할 수 있는 디스크 할당방법에 관한 것으로, 보다 상세하게는, 파일의 생성이나 삭제, 복사와 같은 간단한 파일명령들을 사용하여 특정한 클러스터에 데이터를 임의로 할당 및 할당해제 할 수 있는 디스크 할당방법에 관한 것이다. The present invention relates to a disk allocation method capable of arbitrarily manipulating the allocation of a cluster, and more particularly, to arbitrarily allocate and deallocate data to a specific cluster using simple file commands such as file creation, deletion, and copying. It relates to possible disk allocation methods.

NTFS 파일시스템에 따르면 파일과 디렉토리 정보가 파일시스템에 $MFT 엔트리 내에 저장되는데, $MFT 엔트리 내에 해당 파일에 관한 기본속성들이 들어 있고 가변크기의 파일명이 저장된다. 즉, $DATA에 파일의 내용이 저장되는데 전부 합쳐서 600KB 이하이면 1KB 크기의 $MFT 엔트리에 저장되고, 파일명의 길이에 따라 저장될 수 있는 파일 내용의 최대 크기가 정해진다. According to the NTFS file system, file and directory information is stored in the $MFT entry in the file system, and the basic properties of the file are included in the $MFT entry and the file name of a variable size is stored. That is, the contents of the file are stored in $DATA, and if the total is less than 600KB, they are stored in the $MFT entry of 1KB size, and the maximum size of the file contents that can be stored is determined according to the length of the file name.

동일한 방식으로 디렉토리의 경우도 $INDEX_ROOT의 경우는 레지던트(resident) 속성으로 저장되는데, 파일목록의 개수가 5~6개 정도는 이 안에 저장되고 이것보다 많은 목록의 경우는 $INDEX_ALLOCATION의 논-레지던트(non-resident) 속성으로 클러스터에 할당되는데, 논-레지던트 속성의 경우는 한 클러스터에 4KB 크기까지 저장된다. 이때, 목록의 수가 많아지면 여러 클러스터에 걸쳐서 목록이 저장되는데 $INDEX_ALLOCATION의 런리스트에 이와 같은 정보가 들어 있으며, 빈 디스크의 경우는 대개 연속적인 클러스터로 할당된다. In the same way, in the case of directories, $INDEX_ROOT is saved as a resident attribute. About 5 to 6 file lists are stored in it, and in the case of a list more than this, $INDEX_ALLOCATION is stored as non-resident ( It is assigned to a cluster as a non-resident) attribute, and in the case of a non-resident attribute, a size of up to 4KB is stored in one cluster. At this time, if the number of lists increases, the list is saved across multiple clusters. Such information is included in the run list of $INDEX_ALLOCATION, and empty disks are usually allocated to a contiguous cluster.

도 9는 하나의 디렉토리에서 다수의 파일을 생성한 상태를 표시한 디스크뷰(Diskview) 화면으로, 이를 참조하면 한 디렉토리에만 파일생성한 경우에는“1st Cls.”위치에 첫 번째 디렉토리 인덱스 정보가 할당된다. 파일의 수가 늘어나면 되면“1st Cls.”에 이어서 담을 수 있는 “2nd Cls.”로 확장하여 저장한다. 계속적으로 파일의 수가 증가하면 “3rd Cls.”.“4th Cls.”등으로 지속적으로 확장된다. 9 is a Diskview screen showing the state of creating a number of files in one directory. Referring to this, when files are created in only one directory, the first directory index information is assigned to the “1st Cls.” position. do. If the number of files increases, it expands to “2nd Cls.” that can be contained after “1st Cls.” and saves it. If the number of files continuously increases, it is continuously expanded to “3rd Cls.”, “4th Cls.”, etc.

계속하여 836개의 파일을 생성하였을 때, 목록이 파일목록의 이용한 할당한 경우 디렉토리 인덱스 클러스터의 수가 훨씬 많아지는데, 인덱스 레코드를 저장한 클러스터들이 여러 개의 클러스터에 연속으로 저장되는 경우가 발생한다. “Last Cls.”가 이 경우에 해당한다. When 836 files are continuously created, the number of directory index clusters becomes much larger when the list is allocated using the file list, and clusters that store index records are continuously stored in several clusters. “Last Cls.” is a case in point.

이와 같이 하나의 디렉토리 안에 많은 파일을 생성하는 경우는 파일들의 목록을 여러 개의 인덱스 레코드 클러스터에 저장되고 불규칙적이며 여러 개의 연속된 클러스터를 사용한다는 문제점이 발생한다. In this way, when many files are created in one directory, the list of files is stored in several index record clusters and there is a problem that irregular and several consecutive clusters are used.

이를 해결하기 위하여, 디렉토리 당 한 개의 인덱스 레코드 클러스터를 가지도록 설정하는 경우에는, 디렉토리 안의 파일 조작을 위해서 파일번호를 사용하는데 어려움이 발생하는 경우가 있어 해결책이 되기는 어렵다. In order to solve this problem, when setting to have one index record cluster per directory, it is difficult to provide a solution because there are cases where it is difficult to use the file number for file manipulation in the directory.

대한민국 공개특허공보 제10-2010-0100494호(파일 시스템에서의 파일 또는 디렉토리에 대한 액세스 방법및 장치)Republic of Korea Patent Publication No. 10-2010-0100494 (Method and device for accessing a file or directory in a file system) 대한민국 공개특허공보 제10-2003-0073981호(대용량 파일시스템의 디렉토리 관리방법)Republic of Korea Patent Publication No. 10-2003-0073981 (Directory management method of large file system)

본 발명은 디렉토리 안에 많은 파일을 생성하면 파일목록을 저장하는 인덱스 레코드가 확장되어 불규칙적으로 여러 클러스터에 복잡하게 할당되는 문제를 해결하도록 창안된 것으로, 파일의 생성이나 삭제, 복사와 같은 간단한 파일명령들을 사용하여 특정한 클러스터에 데이터를 임의로 할당 및 할당해제 할 수 있는 디스크 할당방법을 제공하는 것을 목적으로 한다.The present invention was devised to solve the problem that, when many files are created in a directory, the index record storing the file list is expanded and complexly allocated to multiple clusters irregularly. It aims to provide a disk allocation method that can allocate and deallocate data arbitrarily to a specific cluster using

상기와 같은 기술적 과제를 해결하기 위하여, 본 발명은 디스크를 NTFS로 포맷하여 다수의 클러스터를 생성하는 단계, 상기 디스크에 다수 개 타겟 파일을 생성하여, 파일 데이터를 상기 클러스터에 파일데이터 클러스터로 할당하는 단계, 상기 타겟 파일 중 일부를 삭제하여 상기 파일데이터 클러스터 중 일부를 할당해제 하는 단계, 다른 디스크에 저장된 대상파일을 상기 디스크로 복사하여, 대상파일 데이터를 상기 파일데이터 클러스터로 파편화하여 할당하는 단계 및, 나머지 상기 타겟 파일을 삭제한 후, 디스크 조각모음을 실행하여 대상파일데이터를 상기 파일데이터 클러스터로 연속적으로 할당하는 단계를 포함하는 디스크 할당방법을 제공한다.In order to solve the above technical problem, the present invention comprises the steps of formatting a disk to NTFS to create a plurality of clusters, creating a plurality of target files on the disk, and allocating file data to the cluster as a file data cluster. Deleting some of the target files to deallocate some of the file data clusters, copying a target file stored on another disk to the disk, fragmenting the target file data into the file data cluster, and allocating the target file data into the file data cluster; , after deleting the remaining target files, performing disk defragmentation to continuously allocate target file data to the file data cluster.

본 발명에 있어서, 포맷된 상기 디스크에 루트 디렉토리와 하위의 서브 디렉토리로 생성하여, 생성된 디렉토리의 목록정보를 상기 클러스터에 디렉토리 목록 클러스터로 할당하는 단계를 더 포함할 수 있다.In the present invention, the method may further include creating a root directory and sub-directories on the formatted disk, and allocating the created directory list information to the cluster as a directory list cluster.

본 발명에 있어서, 상기 디렉토리 목록 클러스터는 생성된 다수의 클러스터 중 하나의 클러스터에 할당될 수 있다. In the present invention, the directory listing cluster may be assigned to one cluster among a plurality of generated clusters.

본 발명에 있어서, 상기 타겟 파일은 최하위 서브 디렉토리에 생성될 수 있다. In the present invention, the target file may be created in the lowest sub-directory.

본 발명에 있어서, 다수 개 타겟 파일 각각의 크기는 상기 파일데이터 클러스터 보다 작게 형성되어, 다수 개 타겟 파일 각각이 하나의 파일데이터 클러스터에 할당될 수 있다.In the present invention, the size of each of the plurality of target files is formed to be smaller than the file data cluster, so that each of the plurality of target files can be allocated to one file data cluster.

본 발명에 따르면, 파일의 생성이나 삭제, 복사와 같은 간단한 파일명령들을 사용함에 따라 구현이 용이하고, 특정된 클러스터에 파일 데이터를 임의로 할당 및 할당해제하고 이에 따라 디렉토리 관련 클러스터와 파일의 내용이 규칙적으로 저장할 수 있어, 디스크 내에 파일 및 디렉토리를 효율적이고 용이하게 취급할 수 있다. According to the present invention, it is easy to implement by using simple file commands such as file creation, deletion, and copying, and arbitrarily allocating and de-allocating file data to a specified cluster, so that the directory-related cluster and contents of the file are regular. , so that files and directories on disk can be handled efficiently and easily.

도 1은 본 발명의 일 실시예에 따른 디스크 할당방법의 순서도이다.
도 2는 포맷 후의 디스크의 클러스터 상태를 표시한 디스크뷰(Diskview) 화면이다.
도 3은 포맷 이후 디렉토리와 타겟 파일이 생성된 디스크의 클러스터 상태를 표시한 디스크뷰(Diskview) 화면이다.
도 4는 일부 타겟 파일이 삭제된 디스크의 클러스터 상태를 표시한 디스크뷰(Diskview) 화면이다.
도 5는 대상파일이 복사된 디스크의 클러스터 상태를 표시한 디스크뷰(Diskview) 화면이다.
도 6은 나머지 타겟 파일이 삭제된 디스크의 클러스터 상태를 표시한 디스크뷰(Diskview) 화면이다.
도 7은 디스크 조각모음 실행 후, 디스크 클러스터에 연속적으로 저장된 대상파일의 저장상태를 표시한 디스크뷰(Diskview) 화면이다.
도 8은 임의 위치의 데이터가 삭제된 디스크의 클러스터 상태를 표시한 디스크뷰(Diskview) 화면이다.
도 9는 하나의 디렉토리에서 다수의 파일을 생성한 상태를 표시한 디스크뷰(Diskview) 화면이다.
1 is a flowchart of a disk allocation method according to an embodiment of the present invention.
2 is a disk view screen showing the cluster state of the disk after formatting.
3 is a diskview screen showing the cluster state of a disk on which a directory and a target file are created after formatting.
4 is a diskview screen showing a cluster state of a disk from which some target files have been deleted.
5 is a disk view screen showing the cluster state of the disk to which the target file is copied.
6 is a diskview screen showing the cluster state of the disk from which the remaining target files have been deleted.
7 is a disk view screen showing the storage state of the target files continuously stored in the disk cluster after the disk defragmentation is executed.
8 is a diskview screen showing the cluster state of a disk from which data at an arbitrary location has been deleted.
9 is a diskview screen showing a state in which a plurality of files are created in one directory.

이하, 첨부 도면을 참조하여 본 발명의 실시예를 상세히 설명한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

본 실시예는 당업계에서 평균적인 지식을 가진 자에게 본 발명을 보다 완전하게 설명하기 위해서 제공되어지는 것으로서, 도면에서의 요소의 형상, 요소의 크기, 요소간의 간격 등은 보다 명확한 설명을 강조하기 위해서 과장되거나 축소되어 표현될 수 있다.This embodiment is provided to more completely explain the present invention to those with average knowledge in the art, and the shape of elements in the drawings, the size of elements, the spacing between elements, etc. may be exaggerated or reduced for

또한, 실시예를 설명하는데 있어서, 만일 어떤 구성요소가 다른 구성요소에 "구비하는",“결합되어”,“고정되어”등이 기재된 때에는, 그 다른 구성요소에 직접적으로 구비, 결합 및 고정되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다.In addition, in the description of the embodiment, if a component is described as “included”, “coupled”, “fixed”, etc. to another component, it is directly provided, coupled, and fixed to the other component. There may be, but it should be understood that other components may exist in the middle.

또한, 실시예를 설명하는데 있어서 원칙적으로 관련된 공지의 기능이나 공지의 구성과 같이 이미 당해 기술분야의 통상의 기술자에게 자명한 사항으로서 본 발명의 기술적 특징을 불필요하게 흐릴 수 있다고 판단되는 경우에는 그 상세한 설명을 생략하기로 한다.In addition, when it is determined that the technical features of the present invention may be unnecessarily obscured as it is already obvious to a person skilled in the art, such as a known function or a known configuration related in principle in explaining the embodiment, the detailed description thereof A description will be omitted.

도 1은 본 발명의 일 실시예에 따른 디스크 할당방법의 순서도이다. 도 1을 참조하면, 본 발명에 따른 디스크 할당방법은, 디스크를 포맷하는 단계(S110), 타겟 파일을 생성하여 파일 데이터를 상기 클러스터에 파일데이터 클러스터로 할당하는 단계(S120), 타겟 파일 중 일부를 삭제하여 상기 파일데이터 클러스터 중 일부를 할당 해제하는 단계(S130), 다른 디스크에 저장된 대상파일을 상기 디스크로 복사하여, 대상파일 데이터를 상기 파일데이터 클러스터로 파편화하여 할당하는 단계(S140) 및, 나머지 상기 타겟 파일을 삭제한 후, 디스크 조각모음을 실행하여 대상파일 데이터를 상기 파일데이터 클러스터로 연속적으로 할당하는 단계(S150)를 포함하여 이루어진다.1 is a flowchart of a disk allocation method according to an embodiment of the present invention. 1 , the disk allocation method according to the present invention includes the steps of formatting the disk (S110), creating a target file and allocating file data to the cluster as a file data cluster (S120), and some of the target files De-allocating some of the file data clusters by deleting (S130), copying a target file stored in another disk to the disk, fragmenting the target file data into the file data cluster and allocating (S140); After the remaining target files are deleted, disk defragmentation is performed to continuously allocate target file data to the file data cluster (S150).

S110 단계에서, 상기 디스크를 NTFS 파일 시스템으로 포맷하여 다수의 클러스터를 생성한다. 이때, NTFS로 포맷되는 상기 클러스터는 4KB 크기로 다수 개가 생성될 수 있다. In step S110, the disk is formatted with the NTFS file system to create a plurality of clusters. In this case, a plurality of clusters formatted in NTFS may be created with a size of 4 KB.

S120 단계에서, 상기 타겟 파일의 생성 전에 타겟 파일이 위치하는 디렉토리가 생성된다. 디렉토리는 포맷된 상기 디스크에 루트 디렉토리와 하위의 서브 디렉토리로 생성되며, 최하위의 서브 디렉토리에 타겟 파일이 다수 개로 생성된다. 이와 같이 생성된 디렉토리의 목록정보는 클러스터에 디렉토리 목록 클러스터로 할당된다. In step S120, a directory in which the target file is located is created before the target file is created. A directory is created as a root directory and subdirectories on the formatted disk, and a plurality of target files are created in the lowest subdirectory. The directory listing information created in this way is allocated to the cluster as a directory listing cluster.

이때, 생성된 디렉토리 목록 클러스터는 하나의 클러스터에만 할당되는 것이 바람직하며, 이를 위해서 디렉토리 명칭 등이 설정되며, 다수의 타겟 파일 역시 하나의 파일이 하나의 클러스터에 할당될 수 있도록 데이터 크기가 설정되는데, 이를 위하여 NTFS 파일 시스템에서 각각의 타겟 파일은 800Byte ~4KB 크기로 형성된다. 이와 같이, 디렉토리 목록정보와 개개의 타겟 파일이 복수의 클러스터를 점유하지 않고 하나의 클러스터로 할당됨에 따라, 데이터별 삭제 및 확인이 용이하다.At this time, it is preferable that the created directory list cluster be allocated only to one cluster, and for this purpose, a directory name, etc. is set, and the data size of a plurality of target files is also set so that one file can be allocated to one cluster, For this purpose, each target file in the NTFS file system is formed in 800Byte ~ 4KB in size. As described above, since directory listing information and individual target files are allocated to one cluster without occupying a plurality of clusters, deletion and confirmation for each data is easy.

S130 단계에서, 다수 개로 생성된 타겟 파일은 포맷된 디스크의 클러스터에 연속적으로 할당되는데, 여기서 타겟 파일의 일부를 삭제하면 할당된 해당 파일데이터 클러스터가 할당이 해제되어 연속적으로 할당된 클러스터 중 일부가 비워지게 된다. In step S130, a plurality of target files are successively assigned to a cluster of formatted disks. Here, if a part of the target file is deleted, the assigned file data cluster is deallocated, and some of the continuously assigned clusters are emptied. will lose

S140 단계에서, 포맷된 상기 디스크와 다른 디스크에 저장된 대상 파일을 상기 타겟 파일이 저장된 디스크에 복사하면, 상기 디스크에 파일데이터 클러스터로 할당되는데, 이때 S130 단계에서 연속적으로 할당되었으나 일부가 비워진 클러스터에 할당됨에 따라 대상파일 데이터는 클러스터에 파편화(Fragmentation)되어 할당된다.In step S140, if a target file stored on a disk different from the formatted disk is copied to the disk on which the target file is stored, it is allocated to the disk as a file data cluster. As a result, the target file data is fragmented and allocated to the cluster.

S150 단계에서, 대상파일 데이터가 클러스터에 파편화되어 저장된 디스크에서 나머지 상기 타겟 파일을 삭제한다. 그러면, 나머지 클러스터에 할당된 해당 파일데이터 클러스터가 할당이 해제되어 비워지게 되며, 그런 다음 디스크 조각모음을 실행하면 클러스터에 파편화되어 있는 대상파일 데이터가 클러스터에 연속적으로 할당된다. In step S150, the target file data is fragmented in the cluster and the remaining target files are deleted from the stored disk. Then, the corresponding file data cluster allocated to the remaining cluster is deallocated and emptied. Then, if the disk is defragmented, the target file data fragmented in the cluster is continuously allocated to the cluster.

따라서, 파일의 생성이나 삭제, 복사와 같은 간단한 파일명령들을 사용함에 따라 구현이 용이하고, 특정된 클러스터에 파일 데이터를 임의로 할당 및 할당해제하고 이에 따라 디렉토리 관련 클러스터와 파일의 내용이 규칙적으로 저장할 수 있어, 디스크 내에 파일 및 디렉토리를 효율적이고 용이하게 취급할 수 있다. Therefore, it is easy to implement by using simple file commands such as file creation, deletion, and copying, and arbitrarily allocating and de-allocating file data to a specified cluster, so that directory-related clusters and file contents can be stored regularly. Therefore, files and directories on the disk can be handled efficiently and easily.

이와 같이 이루어지는 본 발명에 따른 실시예를 이하 설명한다.An embodiment according to the present invention made in this way will be described below.

<< 실시예Example >>

1. 디스크 준비1. Prepare the disc

디스크를 준비하고 대상 디스크 드라이버를 NTFS 파일시스템으로 포맷하면, 4KB 단위로 클러스터가 생성된다. If the disk is prepared and the target disk driver is formatted with the NTFS file system, a cluster is created in units of 4KB.

2. 디스크의 전체 클러스터 개수 산출2. Calculate the total number of clusters on the disk

그리고, 디스크에 생성된 전체 클러스터 개수를 구한다. 클러스터 개수는 DeviceIoControl() 함수에 인수를FSCTL_GET_NTFS_FILE_RECORD로 지정하여 구한다. 또는 “fsutil fsinfo ntfsinfo 드라이브명:”을 사용하여 전체 클러스터의 수를 구한다. Then, the total number of clusters created on the disk is obtained. The number of clusters is obtained by designating an argument to the DeviceIoControl() function as FSCTL_GET_NTFS_FILE_RECORD. Or use “fsutil fsinfo ntfsinfo drive letter:” to get the total number of clusters.

3. 3. 디렉토리directory 깊이 계산 depth calculation

다음으로, 아래와 같이 디렉토리 깊이(d)를 계산한다. Next, calculate the directory depth (d) as follows.

d=〔logNidx Nclsd=[log Nidx N cls ]

이때, 파일은 리프 디렉토리에만 생성되고 디렉토리의 목록 정보는 한 클러스터를 차지하도록 설정됨에 따라, 아래와 같이 전체 할당되어야 하는 클러스터의 수(Nidx)는 할당 디렉토리 수(Ndir)와 리프 디렉토리에 생성되는 파일의 수(Nfiles)의 합이 되어야 한다. At this time, as the file is created only in the leaf directory and the directory listing information is set to occupy one cluster, the total number of clusters to be allocated (N idx ) is the number of allocated directories (N dir ) and the number of directories created in the leaf directory as shown below. It should be the sum of the number of files (N files ).

Nfiles+Ndir < Nidx N files +N dir < N idx

4. 4. 디렉토리directory 생성 produce

다음으로, 아래와 같이 루트 디렉토리를 생성하고, 그 안에 서브디렉토리들을 반복적으로 생성하며, 이때 최하단의 디렉토리 레벨은 ddir = d-1이다. Next, create the root directory as shown below, and repeatedly create subdirectories in it, where the lowest directory level is d dir = d-1.

makeDir(dirPrefix, ddir, Ndir)makeDir(dirPrefix, d dir , N dir )

5. 5. 타겟target 파일생성 file creation

그리고, 아래와 같이 ddir 레벨에서 다수 개의 타겟 파일을 생성한다. 이때, 타겟 파일 각각의 크기는 800byte ~ 4KB바이트로 생성하여, 한 개의 타겟 파일이 한 개의 클러스터에 할당되도록 한다. And, d dir as below Create multiple target files in the level. At this time, the size of each target file is created in the range of 800 bytes to 4 KB bytes, so that one target file is allocated to one cluster.

createFile(filePrefix, ext, d, Nfiles) createFile(filePrefix, ext, d, N files )

이때 디렉토리 안에 생성되는 타겟 파일들은 트리에서의 리프 노드로 간주할 수 있으며, 각 디렉토리마다 이 리프노드들(파일들)의 전체의 수는 다음과 같다.At this time, target files created in the directory can be regarded as leaf nodes in the tree, and the total number of these leaf nodes (files) for each directory is as follows.

Nfiles < Nidx - Ndir N files < N idx - N dir

6. 6. 타겟target 파일 중 일부 파일 삭제 Delete some of the files

그 다음으로, 최하위 디렉토리에 들어 있는 리프 노드 타겟 파일들에 대하여 삭제대상 파일을 선택한다. 예를 들어, 파일명은 “filePrefix+num.ext”의 형태로 하여, 최대의 단편화를 위하여 홀수 번호의 파일을 삭제할 수 있다. 아래 삭제 명령에서 파일번호 num의 선택은 비우기를 원하는 클러스터의 위치에 따라 선택적으로 수행된다. Next, a file to be deleted is selected with respect to the leaf node target files in the lowest directory. For example, by making the file name in the form of “filePrefix+num.ext”, files with odd numbers can be deleted for maximum fragmentation. In the delete command below, the selection of file number num is selectively performed according to the location of the cluster that you want to empty.

delete(filePrefix, ext, num) delete(filePrefix, ext, num)

7. 조각 모음 대상파일의 복사7. Copy of defragmentation target file

다음으로, 조각 모음의 대상이 되는 대상 파일(defragFiles)을 디스크로 복사한다. Next, copy the target files (defragFiles) to be defragmented to the disk.

copyFiles(defragFiles) copyFiles(defragFiles)

8. 나머지 8. Rest 타겟target 파일 삭제 delete file

클러스터에 남겨진 나머지 타겟 파일들에 대하여 아래와 같이 삭제 명령을 수행한다.Execute the delete command for the remaining target files left in the cluster as follows.

delete(filePrefix, ext, num)delete(filePrefix, ext, num)

9. 디스크 조각 모음 수행9. Perform Disk Defragmenter

다음으로, 남아있는 대상 파일들에 대하여 아래와 같이 디스크 조각 모음을 수행하고, Next, defragment the disk for the remaining target files as follows,

deFrag(defragFiles) defrag(defragFiles)

대상 디스크에 대한 디스크 조각 모음의 결과를 아래와 같이 리포트 한다. The result of disk defragmentation for the target disk is reported as follows.

reportDefrag(disk) reportDefrag(disk)

<< 실험예Experimental example >>

실험환경Experiment environment

c:fsinfo ntfsinfo g:c:fsinfo ntfsinfo g:

- NTFS Version: 3.1- NTFS Version: 3.1

- Total Sectors: 16,383(8.0 MB)- Total Sectors: 16,383 (8.0 MB)

- Total Clusters: 2,047(8.0 MB)- Total Clusters: 2,047 (8.0 MB)

- Free Clusters: 1,077 (4.2 MB)- Free Clusters: 1,077 (4.2 MB)

- Total Reserved Clusters: 0 (0.0 KB)- Total Reserved Clusters: 0 (0.0 KB)

- Reserved For Storage Reserve: 0 (0.0 KB)- Reserved For Storage Reserve: 0 (0.0 KB)

- Bytes Per Sector: 512- Bytes Per Sector: 512

- Bytes Per Physical Sector: 4096- Bytes Per Physical Sector: 4096

- Bytes Per Cluster: 4096- Bytes Per Cluster: 4096

- Bytes Per FileRecord Segment: 1024- Bytes Per FileRecord Segment: 1024

- Clusters Per FileRecord Segment: 0- Clusters Per FileRecord Segment: 0

- Mft Valid Data Length: 256.00 KB- Mft Valid Data Length: 256.00 KB

- Mft Start Lcn: 0x00000000000002a- Mft Start Lcn: 0x000000000000002a

- Mft2 Start Lcn: 0x0000000000000002- Mft2 Start Lcn: 0x00000000000000002

- Mft Zone Start: 0x00000000000002a0- Mft Zone Start: 0x000000000000002a0

- Mft Zone End: 0x00000000000003c0- Mft Zone End: 0x00000000000003c0

- MFT Zone Size: 1.13 MB- MFT Zone Size: 1.13 MB

이와 같은 환경에서 실험은 파일 당 한 개의 클러스터에 할당되도록 하였다. 그리고, 디렉토리 안의 파일명이나 디렉토리명의 목록의 수가 영향을 주기 때문에 이것에 의하여 클러스터가 할당됨에 따라, B-tree로 구성된 인덱스의 목록들에 의하여 클러스터가 여러 개 점유되지 않도록 하였다. 아래와 같이 파일의 수가 인덱스마다 한 개의 디렉토리 안에 할당되도록 하였다. In this environment, the experiment was assigned to one cluster per file. And, since the number of file names or directory names in the directory is affected, clusters are allocated by this, so that multiple clusters are not occupied by the list of indexes composed of B-tree. As shown below, the number of files is allocated in one directory for each index.

- 파일명의 구성(길이): dataHide○○.txt (14자)- File name structure (length): dataHide○○.txt (14 characters)

- 루트 디렉토리의 수: Nroot=1- Number of root directories: N root =1

- 한 디렉토리 내의 최대 파일 수: Nidx = 35- Maximum number of files in one directory: N idx = 35

- 리프 디렉토리 내에 생성되는 전체 파일 수: Nleaf - Total number of files created within the leaf directory: N leaf

- 전체 클러스터에 할당되는 수는 Ncls=Nleaf + Ndir - The number assigned to the entire cluster is N cls =N leaf + N dir

- Ncls=1,077-N cls =1,077

- d = 〔logNidx Ncls〕 =〔log35 1077〕= 2- d = [log Nidx N cls ] = [log 35 1077] = 2

- ddir = d-1 = 1-d dir = d-1 = 1

- Ndir = Nroot + Nidx ddir = 1 + 351 = 36- N dir = N root + N idx ddir = 1 + 35 1 = 36

Nleaf = INT((Ncls - Ndir)/Nidx)*Nidx N leaf = INT((N cls - N dir )/N idx )*N idx

+ (Ncls - Ndir) mod Nidx + (N cls - N dir ) mod N idx

= INT((1077-36)/35) + (1077-36) mod 35 = INT((1077-36)/35) + (1077-36) mod 35

= 1,015 + 27 = 1,042 = 1,015 + 27 = 1,042

실험은 NTFS 파일시스템으로 포맷한 디스크에 파일을 복사하여 최대한으로 파편화한 후에 디스크 조각 모음을 수행하였다. In the experiment, the files were copied to a disk formatted with the NTFS file system, fragmented to the maximum, and then the disk was defragmented.

도 2는 디스크뷰(DiskView.exe) 도구로 표시된 디스크 포맷 직후의 디스크 상태를 나타내고 있다. 도 2에 도시되는 바와 같이, 작은 용량으로 파티션으로 하였기 때문에 희게 표시된 부분이“Empty Cluster”영역이다. 그리고, 초록색 부분은 “System File”부분이며, 이의 앞쪽에는 연속적으로“$mftmirr”,“$upcase:$info”,“$attrdef”가 형성된다. 또한, 파란색으로 표시된“$mft”부분은 MFT 엔트리가 저장되는 부분으로 포맷 직후에는 도 2와 같은 형태이지만 파일이나 디렉토리가 늘어나면 이 영역은 증가한다. 2 shows the disk state immediately after the disk format displayed by the disk view (DiskView.exe) tool. As shown in FIG. 2 , since the partitions have a small capacity, the area marked in white is the “Empty Cluster” area. And, the green part is the “System File” part, and “$mftmirr”, “$upcase:$info”, and “$attrdef” are continuously formed in front of it. In addition, the "$mft" part marked in blue is the part where the MFT entry is stored. Immediately after formatting, it has the same shape as in FIG. 2, but if the file or directory increases, this area increases.

도 3은 디스크에 타겟 파일과 디렉토리를 최대로 생성한 후의 디스크 클러스터 점유 상태를 나타내고 있다. 도 3에서“Files&Dirs”는 생성된 디렉토리와 타겟 파일의 점유상태를 나타내고,“$MFT”는 이에 따라 증가된 $MFT 영역을 나타내고 있다. 3 shows the disk cluster occupancy state after the target files and directories are maximally created on the disk. In FIG. 3, “Files&Dirs” indicates the occupancy status of the created directory and target file, and “$MFT” indicates the increased $MFT area accordingly.

그리고, 도 4는 리프 디렉토리 내에 생성한 타겟 파일들 중에서 홀수 번 타겟 파일들을 삭제한 후의 상태를 나타낸 것이다. 도 4에 도시되는 바와 같이, 파일마다 한 개의 클러스터를 점유하고 있었기 때문에 삭제 후의 모습에서 삭제되지 않은 짝수 번 타겟 파일들과 삭제된 빈 클러스터 공간들이 교차적으로 표시되고 있음을 알 수 있다.And, FIG. 4 shows a state after deleting odd-numbered target files from among the target files created in the leaf directory. As shown in FIG. 4 , since one cluster was occupied by each file, it can be seen that even target files that were not deleted and empty cluster spaces that were deleted are alternately displayed in the image after deletion.

도 4에는 대상파일인 1.15MB의 file.docx 파일을 디스크에 복사한 후의 파편화 상태가 도시되어 있으며, 도 5에는 짝수파일과 관련 디렉토리들을 삭제한 후에 대상 파일만 남겨진 파편화 상태가 도시되어 있다. 다음으로, 도 7에는 파편화된 대상파일(file.docx)에 대하여 디스크 조각 모음을 수행하고 난 뒤의 상태가 도시되어 있는데, 296개의 클러스터에 데이터가 연속으로 저장된 것을 확인할 수 있다. Fig. 4 shows the fragmentation state after copying the file.docx file of 1.15MB, which is the target file, to the disk, and Fig. 5 shows the fragmentation state in which only the target file remains after deleting even-numbered files and related directories. Next, FIG. 7 shows a state after disk defragmentation is performed on the fragmented target file (file.docx), and it can be seen that data is continuously stored in 296 clusters.

이와 같은 방법으로 임의의 원하는 클러스터의 할당을 해제하는 방법은 디렉토리 안에 만들어진 개별의 파일을 삭제하는 것으로 수행될 수 있다. 이때, 파일마다 할당된 정보를 얻기 위해서 디스크뷰(DiskView.exe)와 같은 도구를 사용할 수 있는데, 이 도구에서 클러스터 위치를 더블클릭하면 할당된 클러스터의 경우 클러스터의 위치에 대한 기본적인 정보를 획득할 수 있다.The method of deallocating any desired cluster in this way can be performed by deleting individual files created in the directory. At this time, you can use a tool such as DiskView (DiskView.exe) to obtain the information allocated for each file. In this tool, if you double-click the location of the cluster, you can obtain basic information about the location of the cluster in the case of the allocated cluster. have.

또한, 특정 위치에 대한 선택은 생성된 파일의 번호를 통하여 가능하다. 한 개의 파일당 한 개의 클러스터를 차지하도록 구현되어 있기 때문에 특정 위치에 대한 선택은 파일의 번호를 통하여 가능하다. 도 8은 임의로 선택된 부분의 할당을 해제하는 과정이 도시되어 있는데, 특정 위치에 연속된 클러스트를 선택할 수 있고 규칙적이거나 반복된 위치에 대하여 선택할 수 있다.In addition, selection of a specific location is possible through the number of the generated file. Since it is implemented to occupy one cluster per file, selection of a specific location is possible through the number of files. 8 shows a process of de-allocation of an arbitrarily selected portion. Clusters contiguous to a specific location can be selected, and a regular or repeated location can be selected.

이와 같이 본 발명에 따르면, 파일의 생성이나 삭제, 복사와 같은 간단한 파일명령들을 사용함에 따라 구현이 용이하고, 특정된 클러스터에 파일 데이터를 임의로 할당 및 할당해제하고 이에 따라 디렉토리 관련 클러스터와 파일의 내용이 규칙적으로 저장할 수 있어, 디스크 내에 파일 및 디렉토리를 효율적이고 용이하게 취급할 수 있다. As described above, according to the present invention, it is easy to implement by using simple file commands such as file creation, deletion, and copying, and arbitrarily allocates and de-allocates file data to a specified cluster, and accordingly, directory-related clusters and contents of files This regular storage allows efficient and easy handling of files and directories on disk.

이상 설명한 본 발명은 기재된 실시예에 한정되는 것은 아니고, 본 발명의 사상 및 범위를 벗어나지 않고 다양하게 수정 및 변형할 수 있음은 이 기술의 분야에서 통상의 지식을 가진 자에게 자명하다. 따라서 그러한 변형예 또는 수정예 들은 본 발명의 특허청구범위에 속한다 해야 할 것이다.The present invention described above is not limited to the described embodiments, and it is apparent to those skilled in the art that various modifications and variations can be made without departing from the spirit and scope of the present invention. Therefore, it should be said that such variations or modifications belong to the claims of the present invention.

본 발명은 한국연구재단(National Research Foundation of Korea. NRF)의 지원으로 수행된 과제(NRF-2019R1F1A1058902) 결과입니다.The present invention is the result of a project (NRF-2019R1F1A1058902) supported by the National Research Foundation of Korea (NRF).

Claims (5)

운영시스템(OS) 내 디스크 관리장치에 의하여 수행되는 디스크 할당방법에 있어서,
디스크를 NTFS로 포맷하여 다수의 클러스터를 생성하는 단계;
상기 디스크에 다수 개 타겟 파일을 생성하여, 파일 데이터를 상기 클러스터에 파일데이터 클러스터로 할당하는 단계;
상기 타겟 파일 중 일부를 삭제하여 상기 파일데이터 클러스터 중 일부를 할당 해제하는 단계;
다른 디스크에 저장된 대상파일을 상기 디스크로 복사하여, 대상파일 데이터를 상기 파일데이터 클러스터로 파편화하여 할당하는 단계; 및
나머지 상기 타겟 파일을 삭제한 후, 디스크 조각모음을 실행하여 대상파일데이터를 상기 파일데이터 클러스터로 연속적으로 할당하는 단계;를 포함하는 것을 특징으로 하는 디스크 할당방법.
In the disk allocation method performed by the disk management device in the operating system (OS),
Formatting the disk to NTFS to create a plurality of clusters;
allocating file data to the cluster as a file data cluster by creating a plurality of target files on the disk;
de-allocating some of the file data clusters by deleting some of the target files;
copying a target file stored in another disk to the disk, fragmenting the target file data into the file data cluster and allocating; and
and allocating the target file data to the file data cluster continuously by performing disk defragmentation after deleting the remaining target files.
제1항에 있어서,
포맷된 상기 디스크에 루트 디렉토리와 하위의 서브 디렉토리로 생성하여, 생성된 디렉토리의 목록정보를 상기 클러스터에 디렉토리 목록 클러스터로 할당하는 단계;를 더 포함하는 것을 특징으로 하는 디스크 할당방법.
According to claim 1,
The method further comprising: creating a root directory and sub-directories on the formatted disk, and allocating the created directory list information to the cluster as a directory list cluster.
제2항에 있어서,
상기 디렉토리 목록 클러스터는 생성된 다수의 클러스터 중 하나의 클러스터에 할당되는 것을 특징으로 하는 디스크 할당방법.
3. The method of claim 2,
The disk allocation method, characterized in that the directory list cluster is allocated to one cluster among a plurality of created clusters.
제2항에 있어서,
상기 타겟 파일은 최하위 서브 디렉토리에 생성되는 것을 특징으로 하는 디스크 할당방법.
3. The method of claim 2,
The disk allocation method, characterized in that the target file is created in the lowest sub-directory.
제4항에 있어서,
다수 개 타겟 파일 각각의 크기는 상기 파일데이터 클러스터 보다 작게 형성되어, 다수 개 타겟 파일 각각이 하나의 파일데이터 클러스터에 할당되는 것을 특징으로 하는 디스크 할당방법.
5. The method of claim 4,
Each of the plurality of target files is formed to have a size smaller than the file data cluster, so that each of the plurality of target files is allocated to one file data cluster.
KR1020200025674A 2020-02-29 2020-02-29 Disk Allocation Method for Manipulating Cluster Fragmentation KR102408150B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200025674A KR102408150B1 (en) 2020-02-29 2020-02-29 Disk Allocation Method for Manipulating Cluster Fragmentation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200025674A KR102408150B1 (en) 2020-02-29 2020-02-29 Disk Allocation Method for Manipulating Cluster Fragmentation

Publications (2)

Publication Number Publication Date
KR20210110495A KR20210110495A (en) 2021-09-08
KR102408150B1 true KR102408150B1 (en) 2022-06-10

Family

ID=77787872

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200025674A KR102408150B1 (en) 2020-02-29 2020-02-29 Disk Allocation Method for Manipulating Cluster Fragmentation

Country Status (1)

Country Link
KR (1) KR102408150B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008146361A (en) 2006-12-11 2008-06-26 Seiko Epson Corp Recorded information editing device, recorded information editing method, and program
JP2016189104A (en) 2015-03-30 2016-11-04 日本電気株式会社 File management device, storage device, file management method, and program
JP2018523228A (en) 2015-05-19 2018-08-16 クリプトムーヴ, インコーポレイテッドCryptomove, Inc. Security through data hiding

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100484942B1 (en) 2002-03-14 2005-04-25 한국전자통신연구원 Method for managing directories of large-scale file system
KR101041367B1 (en) 2009-03-06 2011-06-14 주식회사 코아로직 Method and apparatus of accessing file or directory in file system
KR101767104B1 (en) * 2015-11-27 2017-08-10 동양대학교 산학협력단 Apparatus and method of message hiding in file system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008146361A (en) 2006-12-11 2008-06-26 Seiko Epson Corp Recorded information editing device, recorded information editing method, and program
JP2016189104A (en) 2015-03-30 2016-11-04 日本電気株式会社 File management device, storage device, file management method, and program
JP2018523228A (en) 2015-05-19 2018-08-16 クリプトムーヴ, インコーポレイテッドCryptomove, Inc. Security through data hiding

Also Published As

Publication number Publication date
KR20210110495A (en) 2021-09-08

Similar Documents

Publication Publication Date Title
KR100951107B1 (en) Method for managing files for optimal performance
EP1311940B1 (en) Improved space allocation in a write anywhere file system
US7072916B1 (en) Instant snapshot
US6654772B1 (en) Multi-volume extent based file system
US8793290B1 (en) Metadata management for pools of storage disks
US5956745A (en) System and method for automatically resizing a disk drive volume
US7225211B1 (en) Multi-class storage mechanism
US8135907B2 (en) Method and system for managing wear-level aware file systems
US8607016B2 (en) FAT analysis for optimized sequential cluster management
US8621174B2 (en) Relocating data within a file system
US7584229B2 (en) Method and system for priority-based allocation in a storage pool
JP2008033517A (en) File storage control device and method
JPH07191892A (en) Method and system for management of file system by using flash-reasable programmable read-only memory
KR20100122720A (en) Method of read/write performance of non-volatile data storage device
JP2007200314A (en) Apparatus and method of managing hidden area
US10496612B2 (en) Method for reliable and efficient filesystem metadata conversion
CN111143285A (en) Small file storage file system and small file processing method
Jung et al. Lifetime-leveling LSM-tree compaction for ZNS SSD
CN104238961B (en) The method and apparatus that safety deleting is realized on flash media
CN102253985A (en) File system data management method and system
KR100907477B1 (en) Apparatus and method for managing index of data stored in flash memory
KR102408150B1 (en) Disk Allocation Method for Manipulating Cluster Fragmentation
JP3796391B2 (en) Extent-based file system with versatile indirect designation or multiple volumes
JP2017049897A (en) Storage device, storage device control program, and storage device control method
CN110837478A (en) File management method, storage medium and electronic device

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E90F Notification of reason for final refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant