github fcorbelli/zpaqfranz 65.24
Just about everything

one hour ago

zpaqfranz 65.24 -tar takes everything NTFS keeps, a whole Windows by its files, and fixes

The theme of 65.24 is -tar on Windows, all the way:

  • a -tar now keeps everything NTFS keeps that a program can read: junctions and
    symbolic links, the alternate data streams, the files encrypted with EFS, the compression
    (NTFS and WOF), the sparse files, the object IDs, the case sensitive folders, the four
    times to 100 ns. And x -tar gives all of it back;
  • ac -tar: a backup of the whole disk of Windows where C: is taken by its files
    (not by its image), and xc that gives it back: on a disk, on a partition, on a
    .vhdx. An experiment: read its warning below;
  • two issues (382, 383), l -715 -all that is really zpaq 7.15, and some fixes.

In short:

  • -tar on Windows takes everything it can (65.24a-p): links, streams, EFS, compression,
    sparse, object IDs, case sensitivity; the times to 100 ns; the folders that deny the
    administrators; the root of the volume. The whole story is in tar.md
    Or here #378 (comment)
  • New: ac -tar, the disk of Windows with C: by its files, and its restore with
    xc (65.24q-z18), new: fix, to be run once in the Windows restored.
  • xc asks how big C: should be (-resize to say it before), and can write to a
    .vhdx or .vhd.
  • x -to on Windows no longer writes the files in their place when the case of the path
    is not the one stored (65.24p).
  • -vss: a c:\franzsnap left by a zpaqfranz that did not end is taken away; two -vss
    at the same time are refused; the names longer than 250 characters are stored as the
    others (65.24n-w).
  • -index with -wim and -tar (issue 383): it stopped with Archive not found; now
    -index is refused with images and ac (65.24z12-z13).
  • *-tar on nix: a name that leaves or joins a group of hard links (issue 382) came back
    joined, or split, the wrong way (65.24z12).
  • l -715 prints what zpaq 7.15 prints, to the byte, with -all too (65.24z19).

The two examples, the backup and its restore, in one line each:

zpaqfranz a  w:\users.zpaq c:\users -tar -vss         a folder, with everything NTFS keeps of it
zpaqfranz x  w:\users.zpaq -tar -to d:\back           ...given back, all of it, somewhere else

zpaqfranz ac w:\pc.zpaq -tar                          the disk of Windows, C: by its files
zpaqfranz xc w:\pc.zpaq -to 2: -force                 ...given back on the physical disk 2
zpaqfranz fix                                         ...and once, in that Windows, after its first boot

Part one, what is new, for the user

  1. -tar on Windows: everything NTFS keeps
  2. ac -tar: the disk of Windows by its files
  3. xc: the restore of an ac -tar
  4. fix: the apps after the restore
  5. x -to and the case of the path (Windows)
  6. -vss: a c:\franzsnap left behind, and the long names
  7. -index with images (issue 383)
  8. -tar on *nix: a name that leaves a group of hard links (issue 382)
  9. l -715, as zpaq 7.15 to the byte
  10. Smaller things

1. -tar on Windows: everything NTFS keeps

Windows. 65.23 brought -tar to Windows for the security of the files (owners,
permissions, auditing, accounts by name, hard links, short names, extended attributes). It
left out, on purpose, what was not needed to give a program back its folder. With 65.24
the rule is simpler: -tar takes everything it can, and x -tar gives back everything it
took. Without -tar nothing changes: a and x are as they were.

zpaqfranz a z:\game.zpaq "c:\program files\game" -tar
zpaqfranz x z:\game.zpaq -tar -force                      back in its place
zpaqfranz x z:\game.zpaq -tar -to d:\check                somewhere else

What is new, for every file and folder:

what stored by a -tar given back by x -tar
junctions and symbolic links (to folders and files, even broken), the special files of WSL1 the link itself, never followed yes, as they were (an absolute target points where it pointed)
alternate data streams (the Mark of the Web, the attributes of Dropbox...) of files and folders yes, by itself (no -forcewindows needed) yes
files encrypted with EFS the encrypted data raw, as Windows exports it (no key needed, nothing decrypted) yes, raw: the file is the same encrypted file, for the same user and keys
NTFS compression yes yes (only where it was, and where the folder does not compress already)
WOF compression (compact /exe, CompactOS) yes yes
sparse files, with their empty ranges yes yes (and the sparse flag taken away if it was not there)
object IDs yes yes (before the WOF: setting an object ID uncompresses a WOF file)
case sensitive folders (WSL) yes yes, before their files go in
creation, last access, last write, change time to 100 ns to 100 ns, last of all (after the permissions)
the root of the volume (owner, permissions, object ID) yes yes
the folders that deny even the administrators read with the rights of a backup yes
  • Up to 65.23 a junction was not even seen, and a symbolic link to a file was followed (a
    copy of its target came back): a Windows restored so had no C:\Documents and Settings, no
    C:\Users\All Users, none of the junctions of a profile.
  • A progress line, phase by phase (64472): the scan of the security, the streams, the
    restore of the links, of the permissions..., with its ETA. The big trees took minutes in
    silence.
  • Hard links are written once (65.24y): x -tar writes the data of a group of hard links
    once, then makes the other names as links to it. Up to 65.24x every name was written as a
    copy, then made a link: on a C: of Windows 11 (38,000 hard links) about 10 GB more on
    the disk while extracting, and the time to write them.
  • The short names of the hard links (65.24p): a file has one short name for all its
    names. With 8.3 active on the volume, the first name extracted took one made up by NTFS,
    and the right one could not be given to the second name (20,582 errors 183 on a C:).
    Now 0.
  • The last access time (65.24o): on a Windows 10 that keeps it "managed by the system",
    a second a -tar with nothing changed wrote the table again (only the access times had
    moved, because of the first a itself). Now a change of the last access time alone does
    not make a new table.
  • t with an archive of -tar (65.24y): reads the folder with the rights of a backup, so
    the files that deny the administrator are compared too (64497).

What is still not kept: the extended attributes of the kernel ($KERNEL.*: only the kernel
can write them, see fix below), an empty SACL (it comes back as no SACL: no effect seen),
System Volume Information. Everything else, and how it was tested (a whole C: against
its image, entry by entry), is in tar.md.

2. ac -tar: the disk of Windows by its files

Windows. ac (65.9) makes a backup of the disk of Windows that boots: the partition
table, the boot and recovery partitions, and the image of C:. ac -tar does the same
but takes C: by its files, as a c:\ -tar -vss would, with everything of section 1.

ac -tar is an experiment. There is no guarantee that a Windows restored from it
starts, or works as it did. It was tested on two virtual machines with Windows 11, nothing
else. For a backup of your PC to trust, use ac (the image). My estimates, not
measures, are in tar.md.

zpaqfranz ac w:\pc.zpaq -tar                 the disk of Windows, C: by its files
zpaqfranz ac w:\pc.zpaq -tar -all            every partition of that disk too
zpaqfranz ac w:\pc.zpaq -tar -frugal         without the junk of every user
zpaqfranz ac w:\pc.zpaq -tar -not c:\film    a folder left out (the metafile says it)

Why by its files: an image of C: is fast and sure, but it is the volume: a few GB
changed every day make a new version with all the clusters that moved. By its files, a new
version is the files that changed; and any file can be taken out with a plain x, as from
any archive.

What it saves:

  • the partition table, the boot (EFI) and recovery partitions, raw, as ac;
  • C: by its files, through VSS, with -tar; the other partitions with -all (as
    ac -all: an NTFS by its used clusters, the rest raw);
  • never pagefile.sys, swapfile.sys, hiberfil.sys (65.24u);
  • not what Windows itself says not to back up (the FilesNotToBackup key of the registry:
    memory dumps, the cache of Windows Update, temporary files, error reports...): the folders
    stay, empty. -everything takes them too (65.24y). The transaction log of MSDTC is always
    taken: without it a restored Windows does not start that service (65.24z9);
  • with -frugal: the caches and temporary files of every user left out, the folders
    kept with their permissions (65.24y);
  • the registry from memory (65.24z8): the files of the registry in a VSS copy can be
    inconsistent, if Windows was once stopped badly. Windows "repairs" them when they are
    loaded, giving one security to every key, and the restored Windows starts without
    network
    (the services cannot write their keys). Now the registry of the running Windows
    is saved by Windows itself (RegSaveKeyEx), consistent, in place of the copy of the VSS
    (66551-66557).

ac -tar is for an administrator (it elevates by itself, as ac); the archive cannot be on
C: (66051); -index is refused (01949, see section 7). The details are in
tar.md.

3. xc: the restore of an ac -tar

Windows. xc knows the backups of ac -tar by their metafile, and gives them back:

zpaqfranz xc w:\pc.zpaq -to 2: -force                 on the physical disk 2 (it asks how big C:)
zpaqfranz xc w:\pc.zpaq -to 2: -force -resize +20     ...20 GB more for C:, not asked
zpaqfranz xc w:\pc.zpaq -to 2: -force -verify         ...and every file read back
zpaqfranz xc w:\pc.zpaq -to c: -force                 C: only, on a partition that is there (Windows PE)
zpaqfranz xc w:\pc.zpaq -to d:\pc.vhdx                a virtual disk (.vhdx or .vhd), for a VM
zpaqfranz image w:\pc.zpaq -to d:\pc.vhdx             the same, from image
  • On a disk (-to N:): the partitions as xc always writes them; the partition of
    Windows is formatted NTFS with the cluster, label, short names setting and serial
    number of the backup, then gets its files (x -tar, the accounts by their SID). The disk
    gets the identity (GUIDs) of the original disk: it is meant to take its place. If the
    original disk is online on the same PC, the disk being written gets an identity of its own
    while xc works, and is put offline at the end with the one of the backup.
  • How big C: (65.24z11): on a GPT disk that is not the original one, xc says how big
    the partition was and how much its files want, and asks: +5 = 5 GB more, -5 = 5 GB
    less, ENTER = as it is. The partitions after it move; the copy of the GPT goes at the end
    of the disk; the recovery environment is found again (ReAgent.xml). A disk smaller
    than the original is fine, if C: still holds its files. -resize X says it before (for a
    script); -nocaptcha alone = as it is.
  • On a partition (-to e:): only the partition of Windows, formatted and filled. It
    must be at least as big as the files want, and 5% more (66513): -space to write all the
    same. Not the volume of the running Windows, the archive or the program (66504-66524).
  • On a .vhdx or a .vhd (65.24z11): made here (expandable), attached by Windows,
    written as a disk, detached. Administrator only.
  • -verify: every file of C: read back and compared, every piece of the disk read back
    as soon as written (66545-66548).
  • Switches that make no sense here (-longpath, -flat, -utf, -fix255, -find...) are
    switched off for the x inside xc, and said (66550). With -longpath the files went
    under c_\ and the restored Windows did not start (65.24z5).
  • -all is ignored (66590): xc gives back every partition in the backup. The list of what
    the backup left out is one line; -verbose prints all of it (66527).

xc ends with one line about fix (66561).

4. fix: the apps after the restore

Windows. The files of the Store apps (Store, Photos, Notepad, Phone Link...) carry an
extended attribute of the kernel ($KERNEL.PURGE.APPXFICACHE) that no program can write: a
restore by files cannot give it back. Without it, every app fails once, at its first
launch ("cannot open this app", 0x80073CFC), then Windows verifies its package and it
works.

fix, run once in the restored Windows after its first boot, asks Windows to verify every
package now: the attributes are written again, and the apps start at the first click.

zpaqfranz fix              as administrator: every package (else: the apps of this user)

About 100 packages in half a minute; a progress line with ETA (65.24z15). It changes
nothing of the files: it is the verification Windows would do by itself, one app at a time.
Only the window of Phone Link, at the first login before fix, may still say it once.

5. x -to and the case of the path (Windows)

Windows. x archive c:/data/ -to d:\new takes the files stored as c:/data/... and puts
them under d:\new. The selection did not care about the case (Windows does not), but the
change of path did: with the files stored as C:/data/..., they were selected and written
in their place
, not under -to. Now the change of path does not care about the case
either (65.24p).

6. -vss: a c:\franzsnap left behind, and the long names

Windows.

  • A zpaqfranz with -vss that did not end (killed, a crash, a power cut) left the link
    c:\franzsnap and its shadow copy. The next -vss asked on the keyboard what to do: in a
    scheduled task it waited forever. Now, if no zpaqfranz is using it, the link is taken away
    with its shadow copy, and said (72661, 72662). If another zpaqfranz with -vss is running,
    this one stops at once (72663, exit code 2): one at a time (65.24w).
  • An old bug of every -vss: names longer than 250 characters were stored as
    c:/franzsnap/..., the others as c:/.... Now all as c:/... (65.24n).

7. -index with images (issue 383)

ac ... -wim -index idx.zpaq with the parts of the archive kept somewhere else stopped with
Archive not found. More: with -index, the state of -wim was read from the wrong place
(-wim with -index never worked after its second run), and so the table of -tar on
Windows.

  • Fixed the reading (65.24z12): what is stored in the parts is looked for in the right part,
    at the right place; a part that is not there gives "not there", not a stop.
  • And then refused (65.24z13): what the next run of an image needs (the state of -wim, the
    small files of the image, the table of ac -tar) is data, in the parts, not in the
    index. So -index is not for images: ac in every form and every -image refuse it
    at once (01949, exit code 2), nothing written. a of files with -index (-tar too) works
    as before.

Thanks to Erol for the report.

8. -tar on *nix: a name that leaves a group of hard links (issue 382)

*nix. With -tar, a file that is a hard link is stored as a link to the first name of
its group. If, in a later version, a name leaves the group (it becomes a file of its
own) or joins another one, with the same date and size, a saw nothing changed and
did not write it: at the restore, two files became one (one inode), or the other way around.

Now a compares the link of each name too (65.24z12): a name whose link changed gets a new
entry in the index (0 bytes of data). Windows was not touched by this: there the groups come
from the table of every version.

Thanks to YadeWira for the report.

9. l -715 -all, as zpaq 7.15 to the byte

l -715 is meant to print what zpaq 7.15 prints, for the scripts that read it. It did,
without -all, on small archives. Not always (65.24z19):

  • with more than 1,000 blocks, a progress line (Scan ...) went to the output, and the warning
    about long names;
  • with -all, the records of zpaqfranz (VFILE-filelist, VFILE-info, the comments of the
    versions) were hidden and not counted in the deletions (+4 -0 where zpaq says +4 -2), and
    every : of the names was taken away (pippo:$DATA became pippo$DATA);
  • the files that zpaqfranz leaves out by itself (System Volume Information, $RECYCLE.BIN,
    .dropbox.cache, the alternate streams) were not listed: zpaq lists them.

Now the same bytes as zpaq64 7.15, with and without -all, -until, -only, -not, and
against a folder on disk. What is still different: zpaq writes on stderr the seconds it took.

10. Smaller things

  • The end of an extraction (65.24z14): the progress line stopped at what it showed last
    (99.83%, 22% on Linux); now it ends with 100.00%.
  • x -tar, xc, image no longer print the warning about names longer than 255 (02993)
    and path too long (00911): -tar writes them by itself (65.24z14, z17).
  • xc of an ac -tar made with -all: xc ... -all found nothing to restore (the names
    of every version, under 0001/): -all is ignored now (65.24z16).

Part two, the details, for power users

1. What can change for a script

  • a -tar on Windows: the archive has more: the alternate data streams (entries
    name:stream:$DATA, hidden as always: l does not show them, x without -tar does not
    write them), the links (in the table), the raw data of EFS (name:zpaqfranz-efs:$DATA).
    An a -tar of files that cannot be read (the EFS of another user): the raw only, no error.
  • x -tar on Windows: gives back compression, WOF, sparse, object IDs, times to 100 ns
    (before: only the time of last write, to the second). A volume that cannot keep something:
    one line for each thing, exit code 1, as in 65.23.
  • ac with -index, a -image with -index: exit code 2 (01949), nothing written.
  • -vss with another -vss running: exit code 2 (72663). A c:\franzsnap left behind:
    taken away (before: a question on stdin).
  • x -to on Windows: with a case of the path different from the stored one, the files go
    under -to (before: in their place).
  • xc with -all: ignored, said (66590).
  • l -715: the output of zpaq 7.15, to the byte.
  • fix as first argument runs the verification of the apps: zpaqfranz fix -h too (it
    is not the help).

2. The switches

Switch What
a -tar, x -tar (Windows) now also links, streams, EFS raw, compression, WOF, sparse, object IDs, case sensitivity, times to 100 ns
ac -tar (Windows) the disk of Windows with C: by its files
ac -tar -all ...and every other partition of that disk, as ac -all
ac -tar -everything ...with what FilesNotToBackup says not to back up
ac -tar -frugal ...without the caches and temporary files of every user
xc -to N:, xc -to e:, xc -to x.vhdx the restore of an ac -tar: a disk, a partition, a virtual disk
xc -resize X GB more (+5) or less (-5) for C:, not asked
xc -space -to e: smaller than the files want: written all the same
xc -verify every file and every piece read back
image ... -to x.vhdx an ac -tar to a virtual disk (-resize too)
fix (command) in a Windows restored by its files: the apps verified
t -tar (Windows) an archive of -tar compared with the rights of a backup

3. The messages

Code When
01949! -index with an image or ac: refused
03369 t: streams of the archive not compared (-forcewindows compares them)
64469-64497 -tar on Windows: links, streams, EFS, compression, sparse, object IDs, the progress line, hard links written once, t
66050!-66058 ac -tar: refused combinations, FilesNotToBackup, -frugal, MSDTC
66500!-66550$ xc of an ac -tar: refusals, the plan, format, identity, GPT, ReAgent, -verify, switches off
66551$-66557 ac -tar: the registry saved from memory
66560-66567 fix
66568$-66579 xc: how big C:
66580!-66589 xc and image to a .vhdx/.vhd
66590$ xc: -all ignored
72661$-72663! -vss: a c:\franzsnap left behind, another -vss running

Part three, for developers

1. How it was tested

  • -tar on Windows: on two Windows 11 VMs and a Windows 10 one. tortura\w11\w11_tar24.ps1
    (27 checks on another volume, 17 on other cases, 8 as another user), w11_wintar.ps1 (44),
    w11_wintar_na.ps1 (3, not an administrator), w11_tarlungo.ps1 (8, long names),
    w11_alias2.cmd (the aliases of WindowsApps).
  • A whole C: against its image (tortura\w11\w11_cimg.ps1, nt25.cpp, diff25.py): a -image of C:, the image restored on G: (that C:, frozen), a -tar of G:, x -tar on
    a new T:, and every entry of both dumped (times, attributes, data, streams, reparse points,
    WOF, ranges, object ID, case sensitivity, 8.3, EA, links, EFS raw, SDDL with SACL, label and
    resource attributes). Every column of every entry the same, except the limits of section 1.
    Eight defects of 65.24h were found this way, and fixed in 65.24i-o.
  • ac -tar and xc: tortura\w11\w11_actar.ps1, w11_xctar.ps1, w11_xcnot.ps1,
    w11_xcgrow.ps1, tortura\w11n\xn.ps1 on the new VM: the backup (182 s, 156,908 files, 11
    GB), the restore on a second disk, the original disk taken away and the clone started:
    desktop, login, activated, network and services, WinRE, chkdsk and DISM clean; C: made
    bigger and smaller, .vhdx, .vhd, -all (the VeraCrypt partition with the same SHA-256),
    every restore with -verify. The clones of the new VM (65.24z11 and later) were not started.
  • The registry: the defect reproduced (a VM stopped badly, the hive of the VSS repaired at
    load, the clone without network), then the same backup with 65.24z8: the clone with network.
  • fix: 101 packages, 55 verified, 46 of Windows itself, 0 errors; the apps at the first
    click.
  • Issue 383: t383g.ps1, t383tar.ps1, t383i.ps1 (W11). Issue 382: tortura\tar\t382.sh
    on Fedora, 65.24z11 6 failures, 65.24z12 14 of 14; t377.sh 24 of 24.
  • l -715: 39 cases against zpaq64 7.15, the same bytes: archives of zpaq 7.15, of
    zpaqfranz, of zpaqfranz -715, with streams and the folders left out by default, with
    comments, and an ac -tar of 118,494 files.
  • *On nix (Fedora, Arch, openSUSE, Oracle Linux 7.9, FreeBSD, OpenBSD, macOS, Solaris,
    the NAS x86_64 and i686, ESXi): almost everything of 65.24 is Windows only, so the checks
    of 65.22 and 65.23 on the release binaries (tortura\tutti\nix22.sh, nix23.sh, t377.sh
    where there is -tar), t382.sh on Fedora (14 of 14), autotest -all wherever it runs,
    and the quick checks of repack, w, tw, -tar and, where there is a handler, Ctrl+C in
    the middle of a.

2. Known limits

  • ac -tar is an experiment: two VMs with Windows 11, GPT, UEFI. Not tested: real PCs, MBR and
    BIOS, BitLocker on C:, a PC in a domain, a Windows with updates waiting for a reboot. On a
    Windows 10 VM an ac -tar crawled at 74% and was stopped: not understood yet.
  • The extended attributes of the kernel cannot be written by a program (fix makes Windows
    write the ones of the apps); an empty SACL comes back as none; the files with no short name
    on the original get one from NTFS (no effect seen).
  • xc of an ac -tar with -resize: GPT only (MBR: as it is).
  • -index cannot be used with images any more: an archive of images made with -index before
    65.24z13 is read (x, t) from its parts; to go on adding to it, without -index.
  • The raw export and import of EFS are refused by Windows to a session of OpenSSH, even as
    administrator (from a console, an elevated window, a scheduled task they work). EFS restored
    in WinPE: not tried.
  • zstd 1.6.0 (issue 381) is for the next release.

As far as I know, there are only two programs capable of performing a sort of file-level backup of Windows: DISM and wimlib

As far as I know, neither of them can do what even zpaqfranz can’t do: namely, restore the EA kernels. So zpaqfranz becomes the third program in the world capable of (more or less) creating a bootable, file-by-file backup of Windows 11. If anyone knows of any other tools, please let me know

Download zpaqfranz

Don't miss a new zpaqfranz release

NewReleases is sending notifications on new releases.