Skip to content

Commit 7db82ed

Browse files
committed
Release 1.2
1 parent 5aee954 commit 7db82ed

4 files changed

Lines changed: 43 additions & 14 deletions

File tree

README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
Mount a disk image split over files (*chunks*) in multiple directories (*parts*).
44

5-
## Getting Started
5+
## Features
6+
7+
* Unnecessary chunks become empty (0 bytes) after TRIM.
8+
* Unused files are closed to save system resources and update timestamps when the disk is idle or under low load.
9+
* Supports differential disks.
610

7-
I'm not responsible for the data stored using chunkdisk!
11+
## Getting Started
812

913
1. Install [WinSpd](https://github.com/billziss-gh/winspd/releases/tag/v1.0B1).
10-
2. Copy chunkdisk-x64.exe and winspd-x64.dll to C:\Program Files (x86)\WinSpd\bin\.
14+
2. Copy chunkdisk-x64.exe and winspd-x64.dll (See [issues](#issues)) to C:\Program Files (x86)\WinSpd\bin\.
1115
3. Merge install.reg.
1216
4. Create a `.chunkdisk` file. For example:
1317

@@ -23,19 +27,21 @@ I'm not responsible for the data stored using chunkdisk!
2327
7. Run `diskmgmt.msc` to open Disk Management, [initialize the disk](https://docs.microsoft.com/en-us/windows-server/storage/disk-management/initialize-new-disks) and [create a partition](https://support.microsoft.com/en-us/windows/create-and-format-a-hard-disk-partition-bbb8e185-1bda-ecd1-3465-c9728f7d7d2e).
2428
8. To dismount, right-click the drive in File Explorer and choose "Eject".
2529
26-
## WARNINGS
30+
## Caution
31+
32+
⚠️Be careful not to modify data when the disk is mounted, the authors are not responsible for your data!
33+
34+
* The `.chunkdisk` file is read once. It can be modified and even deleted by other applications.
35+
* Don't modify, add, remove and move around chunk files. They are not write-protected even when being used by chunkdisk. Changes outside chunkdisk may not be visible to the virtual disk, cause I/O errors or even corrupt the file system.
2736
28-
* MAKE A BACKUP of `.chunkdisk` file. Chunkdisk reads it only once when it's mounted. It can be read, modified and even deleted by others while the disk is mounted.
29-
* DO NOT add, remove and move around chunk files when the disk is mounted. Doing so confuses chunkdisk and causes I/O errors.
30-
* DO NOT directly modify chunk files. They are NOT write-protected even when being used.
37+
chunkdisk places a `.lock` file to every part directory to prevent mounting the same disk twice, which will be removed upon exit. If `-W 0` option (mount as read-only) is given you have to remove it on your own to mount the disk again with `-W 1` option.
3138
3239
## `.chunkdisk` File Specs
3340
3441
```plaintext
3542
{disk size in bytes}
3643
{chunk file size in bytes}
3744
{max. number of chunks} {absolute path to a directory}
38-
{max. number of chunks} {absolute path to a directory}
3945
...
4046
```
4147

@@ -46,7 +52,7 @@ I'm not responsible for the data stored using chunkdisk!
4652
## Issues
4753

4854
* winspd-x64.dll is not compatible with the original to workaround [an issue](https://github.com/billziss-gh/winspd/issues/10). Specifically, invoking `SpdStorageUnitSendResponse()` or `SpdIoctlTransact()` leads to an undefined behavior. It's fine with the current WinSpd binaries though. The source code is available [here](https://github.com/extratype/winspd).
49-
* Random I/O performance is not great with SSDs.
55+
* Random I/O performance is not great with NVMe SSDs.
5056

5157
## Notes and Tips
5258

@@ -59,3 +65,19 @@ I'm not responsible for the data stored using chunkdisk!
5965
* When a file in the virtual disk gets deleted the corresponding chunk file may become empty if it is larger than the chunk size. This is done via SCSI UNMAP command (a.k.a. TRIM) requested by Windows.
6066

6167
* You can identify the file in disk for specific chunk or identify the chunk used by specific file. Use `fsutil volume querycluster` for the former, `fsutil file queryextents` for the latter. Use `diskpart` to know the partition offset. For NTFS volumes the cluster size is typically 4096 and LCN 0 corresponds to offset from 0 (inclusive) to 4096 (exclusive) of the partition.
68+
69+
## Differential disk
70+
71+
`.chunkdisk` file specs for differential disks:
72+
73+
```plaintext
74+
{absolute path to the parent disk}
75+
{disk size in bytes}
76+
{chunk file size in bytes}
77+
{max. number of chunks} {absolute path to a directory}
78+
...
79+
```
80+
81+
The parent disk can be either non-differential or differential. The disk size and chunk file size should be equal for all involving `.chunkdisk`. Every part directory should be unique. Parent disks are mounted as read-only (as if `-W 0` option is given). Disks mounted as read-only can be shared over multiple running instances.
82+
83+
You may discard or *merge* the differential disk. To merge, first make sure the differential disk and its parent are not mounted. Then remove `.lock` files in all parts of the parent disk (to mount it later with `-W 1` option); move and overwite all chunk files to the parent disk. The other differential disks based on it should be discarded.

chunkdisk.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include <winver.h>
22

33
VS_VERSION_INFO VERSIONINFO
4-
FILEVERSION 1,0,0,0
5-
PRODUCTVERSION 1,0,0,0
4+
FILEVERSION 1,2,0,0
5+
PRODUCTVERSION 1,2,0,0
66
FILEFLAGSMASK 0x3fL
77
#ifdef _DEBUG
88
FILEFLAGS 0x1L
@@ -18,12 +18,12 @@ BEGIN
1818
BLOCK "040904b0"
1919
BEGIN
2020
VALUE "FileDescription", "chunkdisk"
21-
VALUE "FileVersion", "1.0.0.0"
21+
VALUE "FileVersion", "1.2.0.0"
2222
VALUE "InternalName", "chunkdisk.exe"
2323
VALUE "LegalCopyright", "Copyright (C) 2021 extratype"
2424
VALUE "OriginalFilename", "chunkdisk.exe"
2525
VALUE "ProductName", "chunkdisk"
26-
VALUE "ProductVersion", "1.0.0.0"
26+
VALUE "ProductVersion", "1.2.0.0"
2727
END
2828
END
2929
BLOCK "VarFileInfo"

docs/changes.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@ v1.0
4242
* Improve handling buffers for small-sized I/O's.
4343
* Fix bugs in unaligned (page-based) I/O's.
4444
* Fix inactivity timer.
45+
46+
v1.2
47+
48+
* New feature: differential disk.
49+
* The `.lock` file is not removed automatically on exit if `-W 0` option is given. Manually remove it to mount again with `-W 1` option.
50+
* Close file handles to trigger updating metadata when the virtual disk is not only idle but under low load for a minute.
51+
* Handle the case where the file system does not support FSCTL_SET_ZERO_DATA IOCTL.

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ DWORD CreateStorageUnit(PWSTR chunkdisk_file, const BOOLEAN write_protected, PWS
442442
err = [&bases, write_protected, pipe_name, &unit]() -> DWORD
443443
{
444444
constexpr wchar_t ProductId[] = L"ChunkDisk";
445-
constexpr wchar_t ProductRevision[] = L"1.0";
445+
constexpr wchar_t ProductRevision[] = L"1.2";
446446
auto unit_params = SPD_STORAGE_UNIT_PARAMS();
447447

448448
UuidCreate(&unit_params.Guid);

0 commit comments

Comments
 (0)