Computer >> Hướng Dẫn Máy Tính >  >> Hệ Thống >> Windows

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Các bộ phận chính của ổ cứng HDD là đĩa quay (platters) và đầu đọc/ghi dữ liệu trên đó. Phần ngoài của đĩa hình tròn đó, nhờ Vật lý, có gia tốc tuyến tính nhanh hơn. Cũng có chi phí hiệu năng cảm nhận khi dữ liệu rải rác khắp bề mặt.

MyDefrag có thể coi như "bán tuyệt chủng", nhưng vẫn là chương trình duy nhất loại này tối ưu ổ cứng chính xác theo ý bạn. Giống mọi desfragmenter, nó tổ chức lại mọi phần file, gom lại, khắc phục hiệu năng kém khi dữ liệu rải rác. Nó còn cho phép thiết lập zone (vùng), đặt file quan trọng nhất vào vùng ngoài nhanh hơn của bề mặt HDD. Chỉ cần nói cho nó biết file gì đặt đâu qua script đơn giản.

Tìm, tải và cài MyDefrag

Rất tiếc, MyDefrag hiện không còn hỗ trợ, trang chủ đã chết. Nhưng vẫn tìm được ở các trang lưu trữ phần mềm phổ biến như FileHippo, MajorGeeks.

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Tải và cài phiên bản cuối cùng: MyDefrag 4.3.1. Chấp nhận mặc định khi cài, đảm bảo Select and activate the MyDefrag ScreenSaver không được tích.

Tạo script mới

Bạn không điều khiển MyDefrag qua giao diện đồ họa hay tùy chọn dòng lệnh — nó dùng script đơn giản. Tìm thư mục con scripts trong thư mục cài đặt (tồn tại cho mục đích này).

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Chuột phải trong thư mục này → tạo file TXT trống mới. Đặt tên tùy ý, nhưng đổi phần mở rộng thành .MyD (mặc định cho script MyDefrag). Mở bằng trình soạn thảo văn bản yêu thích.

Khởi đầu script

Chúng ta dùng script có sẵn làm cơ sở cho script tối ưu ổ cứng chứa game, đặt file ảnh hưởng hiệu năng game nhiều nhất vào vùng nhanh của đĩa, di chuyển dữ liệu ít quan trọng, ít truy cập ra vùng chậm.

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Phần đầu script thiết lập như sau. Lưu ý: mỗi tham số/lệnh đặt trên dòng riêng. Cũng dùng comment trong code — bắt đầu bằng // — để giải thích phần khó hiểu.

Title("Title of your script")
Description("Short description of your script")
WriteLogfile("MyDefrag.log","LogHeader")
VolumeSelect
CommandlineVolumes()
VolumeActions
AppendLogfile("MyDefrag.log","LogBefore")

Thiết lập zone đầu tiên

Chia bề mặt HDD thành zone, MyDefrag cho phép đặt file/thư mục cụ thể vào vùng bề mặt hiệu năng tốt hơn hoặc kém hơn.

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Thiết lập zone bằng cách chọn gì đi vào zone đó:

// Zone 1 - File không quan trọng, chậm
FileSelect
!include "file_list.txt"! // Chọn file định nghĩa trong file_list.txt
FileActions
MoveToEndOfDisk() // Di chuyển chúng đến phần chậm của HDD vì không quan trọng
AddGap(ZoneEnd + VolumeFree * 0.1) // Thêm khoảng trống 0.1% giữa zone này và zone tiếp theo
FileEnd // Kết thúc chọn file cho zone cụ thể

Thiết lập thêm các zone

MyDefrag chỉ gom file lại như desfragmenter khác nếu không thiết lập zone, nhưng bạn sẽ bỏ lỡ toàn bộ ý nghĩa dùng nó.

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Thiết lập thêm zone như sau:

// Zone 2: Gom thư mục lại, liệt kê nội dung HDD nhanh hơn - cú pháp giống trước
FileSelect
Directory(yes) // Định nghĩa chọn thư mục, không phải file
FileActions
SortByName(Ascending) // Sắp xếp theo tên bảng chữ cái
AddGap(ZoneEnd + VolumeFree * 0.05)
FileEnd

// Zone 3: Các "filetype game" phổ biến, để khởi động game nhanh hơn
FileSelect
Filename("_.exe") OR Filename("_.dll") OR Filename("_.ini") OR Filename("_.conf") OR Filename("_.cfg") OR Filename("_.bat") OR Filename("_.ico")
FileActions
SortByName(Ascending)
AddGap(ZoneEnd + VolumeFree * 0.1)
FileEnd

// Zone 4: Đặt MFT và file hệ thống NTFS đặc biệt ngay sau file quan trọng nhất
FileSelect
SelectNtfsSystemFiles(yes)
FileActions
PlaceNtfsSystemFiles(Ascending,MftSize * 0.01) // Di chuyển file hệ thống NTFS đã chọn, đặt MFT kích thước 0.01%
AddGap(ZoneEnd + VolumeFree * 0.01)
FileEnd

// Zone 5: File truy cập gần đây (hiệu năng game chơi gần đây tốt hơn)
FileSelect
LastAccessEnabled(yes) and LastAccess(60 days ago,now)
FileActions
SortByName(Ascending)
AddGap(ZoneEnd + VolumeFree * 0.3)
FileEnd

// Zone 6: tất cả file còn lại
FileSelect
all
FileActions
SortByName(Ascending)
AddGap(ZoneEnd + VolumeFree)
FileEnd

Script hoàn chỉnh

Dưới đây là toàn bộ script cuối cùng. Tự do copy-paste vào script của bạn, chỉnh sửa theo ý.

Title("Make Tech Easier's Games HDD Monthly")
Description("Optimize Game HDDs by moving temp, downloading, and non-important gaming-related files and directories to its end, leaving the faster HDD space for more important stuff.")
// Write the header to the logfile. See the "Settings.MyD" file for the definition of the "LogHeader" string.
WriteLogfile("MyDefrag.log","LogHeader")
// Select and process the volumes one by one.
VolumeSelect
CommandlineVolumes()
VolumeActions
// Write the "before" statistics to the logfile. See the "Settings.MyD" file for the definition of the "LogBefore" string.
AppendLogfile("MyDefrag.log","LogBefore")
// Zone 1 - Place Non-important, temp and ultra-large files at the end of the disk.
FileSelect
!include "file_list.txt"!
FileActions
MoveToEndOfDisk()
AddGap(ZoneEnd + VolumeFree * 0.1)
FileEnd
// Zone 2: Directories.
FileSelect
Directory(yes)
FileActions
SortByName(Ascending)
AddGap(ZoneEnd + VolumeFree * 0.05)
FileEnd
// Zone 3: Main Game Files (for quicker game launch).
FileSelect
Filename("*.exe") OR Filename("*.dll") OR Filename("*.ini") OR Filename("*.conf") OR Filename("*.cfg") OR Filename("*.BAT") OR Filename("*.ico")
FileActions
SortByName(Ascending)
AddGap(ZoneEnd + VolumeFree * 0.1)
FileEnd
//Zone 4: Place the MFT and some other special NTFS files.
FileSelect
SelectNtfsSystemFiles(yes)
FileActions
PlaceNtfsSystemFiles(Ascending,MftSize * 0.01)
AddGap(ZoneEnd + VolumeFree * 0.01)
FileEnd
// Zone 5: Recently accessed files (for better performance of last games played).
FileSelect
LastAccessEnabled(yes) and LastAccess(60 days ago,now)
FileActions
SortByName(Ascending)
AddGap(ZoneEnd + VolumeFree * 0.3)
FileEnd
// Zone 6: all other files.
FileSelect
all
FileActions
SortByName(Ascending)
AddGap(ZoneEnd + VolumeFree)
FileEnd
// Write the "after" statistics to the logfile. See the "Settings.MyD" file for the definition of the "LogAfter" string.
AppendLogfile("MyDefrag.log","LogAfter")
VolumeEnd
// Write the footer to the logfile. See the "Settings.MyD" file for the definition of the "LogFooter" string.
AppendLogfile("MyDefrag.log","LogFooter")

Tạo danh sách file ưu tiên thấp

Nhớ script yêu cầu danh sách file ưu tiên thấp dạng TXT trước khi tổ chức file? Giờ là lúc tạo file đó.

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Chuột phải trong thư mục scripts → tạo file TXT trống mới. Đặt tên file_list.txt — đúng tên file dùng trong script.

Dưới đây danh sách mẫu để copy dùng. Thay đổi thư mục/file thành những thứ bạn không quan tâm.

DirectoryName("Game_I_never_play_after_installing") OR DirectoryName("Another_game_I_keep_but_rarely_play") OR DirectoryName("Game_that_takes_up_almost_half_the_HDD") OR Filename("vc_redist.x64.exe") OR Filename("vcredist_x64.exe") OR Filename("vcredist_x64*.exe") OR Filename("*.iso") OR Filename("*.isz") OR Filename("*.mdf") OR Filename("*.cdi") OR Filename("*.pdf") OR Filename("*.bik") OR Filename("*.avi") OR Filename("*.wmv") OR Filename("*.bk2") OR Filename("*.mp4") OR Filename("*.rar") OR Filename("*.zip") OR Filename("*.7z") OR Filename("*.7z.*")

Chạy script

Với 2 file định nghĩa logic desfragment sẵn sàng, đến lúc cho chúng làm việc! Chạy MyDefrag, nếu không lỗi chính tả, script của bạn sẽ hiện trong danh sách script mặc định của chương trình.

Cách desfragment (ghi desfragment) ổ cứng hoàn hảo với MyDefrag

Chọn nó từ danh sách Select a script. Sau đó, như MyDefrag nói, Select 1 or more disks từ danh sách thứ 2 bạn muốn desfragment theo quy tắc script. Nhấp Run và cho nó vài giờ (hoặc vài ngày, với HDD Terabyte) để vận động.

Xong. Bạn đã desfragment và tối ưu ổ cứng theo ý muốn, nó nên hoạt động tốt và nhanh hơn.

Liên quan:

  • Điều gì xảy ra khi bạn desfragment ổ đĩa?
  • 5 công cụ cải thiện hiệu năng ổ cứng Windows 10
  • Cách desfragment ổ cứng từ menu chuột phải trong Windows