Jak stworzyć duży plik CMD Linia komend
Polecenie fsutil jest narzędziem wiersza polecenia, którego można używać do wykonywania wielu zadań związanych z systemem plików FAT i NTFS, takich jak: zarządzanie punktami ponownej analizy, zarządzanie rozrzedzonymi plikami, odinstalowanie woluminu lub rozszerzanie woluminu.
Polecenie jest również przydatny do utworzenia plików o wymaganej wielkości.
Może mieć to zastosowanie np. przy testowaniu pojemności dysku lub testach alarmów dyskowych
SKŁADNIA
fsutil file createnew nazwa_pliku wielkość (wielkość jest w bajtach)
Przykład
Przykład , tworzymy plik tekstowy test.txt, o wielkości 50MB :
Jaka wartość w bajtach ???
50 MB Liczymy
50 MB * 1024 = 51200 kB (doża litera B kilobajt (kilobyte) )
51200 kB zamieniamy na B (Bajty)
51200 kB * 1024 = 52428800 B (Bajt-ów)
możemy wpisać w wiersz poleceń
fsutil file createnew test.txt 52428800
Analogicznie tworzymy plik o wielkości - 1 GB
1GB * 1024= 1024 MB
1024 MB * 1024 = 1048576 kB
1048576 kB * 1024 = 1073741824 B (Bajt-ów)
fsutil file createnew c:\test.txt 1073741824
Powyższe polecenie tworzy plik, który nie ma żadnych realnych danych.
Można również utworzyć plik z rzeczywistych danych, dzieki poniższemu poleceniu:
Poniższe polecenia utworzy pliku big_file.txt o wielkości 1 MB.
echo "przykładowa linia do wygenerowania dużego pliku .." > big_file.txt for /L %i in (1,1,14) do big_file.txt >> big_file.txt
Aby stworzyć plik o wielkości 1GB tworzymy poniższe polecenie
echo "to jest tylko przykładowa linia dołączana aby stworzyć duży plik .." > big_file.txt for /L %i in (1,1,24) do big_file.txt >> big_file.txt
Wyjaśnienie : pierwsze polecenie ( echo … ) tworzy plik duzy_plik.txt o wadze 64 B (bajtów ).
Drugie polecenia działa w pętli do 25 razy, co podwaja rozmiar pliku, przez dodanie go do siebie.
Jeszcze jeden przykład :
utworzenie pliku 100MB z rzeczywistych danych :
echo "przykładowa linia do wygenerowania dużego pliku .." > big_file.txt< for /L %i in (1,1,21) do big_file.txt >> big_file.txt
W pliku typu bat lub cmd używamy składni ( 2x %%)
echo "przykładowa linia do wygenerowania dużego pliku .." > big_file.txt for /L %%i in (1,1,25) do type big_file.txt >> big_file.txt
Komendy FSUTIL
Parameters
Subcommand | Description |
---|---|
Fsutil 8dot3name | Queries or changes the settings for short name behavior on the system, for example, generates 8.3 character-length file names. Removes short names for all files within a directory. Scans a directory and identifies registry keys that might be impacted if short names were stripped from the files in the directory. |
Fsutil behavior | Queries or sets volume behavior. |
Fsutil dirty | Queries whether the volume's dirty bit is set or sets a volume's dirty bit. When a volume's dirty bit is set, autochk automatically checks the volume for errors the next time the computer is restarted. |
Fsutil file | Finds a file by user name (if Disk Quotas are enabled), queries allocated ranges for a file, sets a file's short name, sets a file's valid data length, sets zero data for a file, creates a new file of a specified size, finds a file ID if given the name, or finds a file link name for a specified file ID. |
Fsutil fsinfo | Lists all drives and queries the drive type, volume information, NTFS-specific volume information, or file system statistics. |
Fsutil hardlink | Lists hard links for a file, or creates a hard link (a directory entry for a file). Every file can be considered to have at least one hard link. On NTFS volumes, each file can have multiple hard links, so a single file can appear in many directories (or even in the same directory, with different names). Because all of the links reference the same file, programs can open any of the links and modify the file. A file is deleted from the file system only after all links to it are deleted. After you create a hard link, programs can use it like any other file name. |
Fsutil objectid | Manages object identifiers, which are used by the Windows operating system to track objects such as files and directories. |
Fsutil quota | Manages disk quotas on NTFS volumes to provide more precise control of network-based storage. Disk quotas are implemented on a per-volume basis and enable both hard- and soft-storage limits to be implemented on a per-user basis. |
Fsutil repair | Queries or sets the self-healing state of the volume. Self-healing NTFS attempts to correct corruptions of the NTFS file system online without requiring Chkdsk.exe to be run. Includes initiating on-disk verification and waiting for repair completion. |
Fsutil reparsepoint | Queries or deletes reparse points (NTFS file system objects that have a definable attribute containing user-controlled data). Reparse points are used to extend functionality in the input/output (I/O) subsystem. They are used for directory junction points and volume mount points. They are also used by file system filter drivers to mark certain files as special to that driver. |
Fsutil resource | Creates a Secondary Transactional Resource Manager, starts or stops a Transactional Resource Manager, displays information about a Transactional Resource Manager or modifies its behavior. |
Fsutil sparse | Manages sparse files. A sparse file is a file with one or more regions of unallocated data in it. A program will see these unallocated regions as containing bytes with the value zero, but no disk space is used to represent these zeros. All meaningful or nonzero data is allocated, whereas all non-meaningful data (large strings of data composed of zeros) is not allocated. When a sparse file is read, allocated data is returned as stored and unallocated data is returned as zeros (by default in accordance with the C2 security requirement specification). Sparse file support allows data to be deallocated from anywhere in the file. |
Fsutil tiering | Enables management of storage tier functions, such as setting and disabling flags and listing of tiers. |
Fsutil transaction | Commits a specified transaction, rolls back a specified transaction, or displays info about the transaction. |
Fsutil usn | Manages the update sequence number (USN) change journal, which provides a persistent log of all changes made to files on the volume. |
Fsutil volume | Manages a volume. Dismounts a volume, queries to see how much free space is available on a disk, or finds a file that is using a specified cluster. |
Fsutil wim | Provides functions to discover and manage WIM-backed files. |