Repository navigation
To tar or not to tar... that is the question... #378
Replies: 16 comments
|
The pre-release -tar (on Windows too) |
|
Hi Franco, Thanks for implementing the -tar option for Windows. There are some interesting files on the modern versions of Windows :
%LocalAppData%\Microsoft\WindowsApps are app execution aliases (reparse points) that tell Windows how to launch Store/packaged apps. How the -tar option will treat those files? |
|
Replying my question :
Later : I extracted all the files with the x and -tar options. The zero-length files were not restored but this should not be an issue. No need to backup those files. |
|
Thank you for the question, and for testing it. Those files are app execution aliases: a reparse point (IO_REPARSE_TAG_APPEXECLINK) with the package, the app and the real exe inside, which only CreateProcess can open. From 65.23n, a without -tar skips them with one line and exit code 0. a -tar keeps them in the table of -tar (the reparse point, attributes, date and permissions), and x -tar makes them again: a restored winget.exe works. x without -tar never writes them. BTW NTFS is way harder and more complex, therefore if it works... it works. Some guys spent YEARS to try to fix NTFS manipulation. |
|
Hi Franco, Thanks for the update. Here is my report. The new version restored the zero-length files :
|
|
Hi Franco, You mentioned above the wimlib tool. Inspired by your message, I decided to backup the whole C: partition with zpaqfranz's tar option. The purpose is to create a file based backup independent of the size of the C: partition. Exactly like wimlib. Booting off from WinPE :
For the next time, I will take in account the -longpath switch. Formatting C: and restoring the operating system :
Rebooting the computer after the restore task, the Windows 11 system came back to life without any warnings. Is it possible to solve the hardlink issues above? Thanks. By the way, you are right about the difficulties of NTFS. Linux is much more better in this area. Not so complicated file systems. |
|
I am not sure PS no, the DISM-wim-based image is way more complex than current zpaqfranz's -tar-Windows support LSS: I'll try my best, no promises 😄 |
|
Thanks for the detailed report. LSS: try this one please |
|
Hi Franco, Thanks for the new release. Today's report, all the tests carried on WinPE : Restoring the original backup with zpaqfranz's xc option : -tar backup with the the -longpath option : Format C: and restore the operating system : This caught my attention after the restore operation :
zpaqfranz reported 99.91% and not 100% After the restore operation, displaying a file with very long path : Booting Windows 11 : |
|
I am working on a better -tar for 65.24 NTFS is way worst then Vietnamese jugle 🥲 |
|
Hi Franco, You are right, NTFS is very complicated. Here is another test to check two restores with the 1on1 options : Restore the backup of the test computer : Create a folder named Restore on the external USB drive and restore the tar archive : Compare C:\ and D:\Restore\C_ |
|
I think I'll must make a VM with two restored partitions: one by image, one by file, and compare |
|
Hi Franco, I decided to repeat my tests to help you in this matter. Restoring the operating system with the xc option : Renaming the archive WimBackup to TarBackup : ( WimBackup was not a good choice for naming. ) C:>ren WimBackup1904Ntbk.zpaq TarBackup1904Ntbk.zpaq At this point, I renamed the C: partition of the hard disk to T: C: -> T: I created a .vhd disk on the external USB drive. Renaming the virtual disk to C: Virtual drive E: -> C: T: belongs to the hard disk of the test computer. Restoring the tar backup to C: After this restore, the virtual disk partition identified with the symbol C: holds all the operating systems files backed up with the tar option. The first check : "System Volume Information is not important" for a tar backup. "Documents and Settings" is missing in the partition C: Let's investigate the case of the "Program Files" folder : Diving deeper : As I guess, the symbolic links is the source of the issue. The case of the Users folder : "Default User" and "All users" missing on C:\Users I guess that symbolic links and junctions are problematic here. Maybe, they are affecting the 1o1 option of zpaqfranz. Thanks again for your wonderful work. |
|
Hi Franco, Another test. Restoring the tar archive on the original C: partition of the test computer's hard disk : Symbolic links are missing. They are listed in my previous messages. This is how it should look ( listing from another computer ) : |
|
I am working for a crazy project: file-level backup and restore |
|
The updated tar-spiegone of 65_24 to tar or not to tar... that is the question...Linux, macOS, FreeBSD, OpenBSD, Solaris: from zpaqfranz 65.4l (with fixes up to 65.24z13). Windows: In shortAn archive of zpaqfranz keeps the data of every file, its date and its basic attributes. That is what you need nine times out of ten. The tenth time you need everything the file system knows about a file: who owns it, who may read it, which other names it has, and so on. That is what The switch is the same everywhere, and the idea is the same everywhere: keep what tar would keep. But "what the file system knows" is a very different thing on Windows and on *nix, so this page has three parts:
At the end, the big recap: how much I trust each kind of backup of Windows.
Without Part one: Linux and the other *nixUsing it on *nixWith Plus what tar does not have: deduplication, versions, a hash for every file. On Linux, macOS, FreeBSD, OpenBSD and Solaris the copy comes back identical, checked field by field; the What a -tar stores
A symlink is never followed, not even when it points to a folder: the link is stored, what it points to is stored only if it is in the tree too. Same for a symlink given on the command line: At the end: The metadata live in the franz block of every file (the 360 bytes of a Posix structure, plus 24 bytes for nanoseconds and 32-bit ids), so no extra file is needed. What x -tar doesEverything is first extracted as usual (a symlink as a small file holding its target, a FIFO or a device as an empty file); then, when all the data are written:
Over what is there ( Owners and permissionsOwners. By default by name: if the user (group) of the archive exists on this machine, its uid (gid) here; else the number of the archive. The same default of GNU tar. With Not as root, as tar (65.19h): the files belong to whoever extracts them, the modes go through the umask, setuid/setgid/sticky are dropped, devices are not made. Hard links, across versionsThe files with the same device and inode seen by one A backup made every night meets groups that change: a link added, the "first" file deleted or replaced. Since 65.23 (issue #377) these cases are handled, and tested:
What cannot be repaired: an archive written by 65.22 or before, where such a new link was stored as a plain file. It stays a copy (also on the next adds, until the file changes). -not with -tar
l -tarA symlink shows Versions on *nixA Use What is not kept, and why
The way beyond these limits is the one Windows took: a table in a file of the version. For *nix it is not done (yet). The limits of each operating system
The builds: every Linux, macOS, BSD and Solaris build has How it was tested on *nixA tree with every kind of entry: files with every mode (0000, 0444, 4755, 2755, 6750, 1644...), owners with 32-bit ids and 32-character names, ids with no name, sticky and read-only folders (with links inside), symlinks (relative, absolute, dangling, to a folder, 300 and 2,584 bytes long, with spaces and accents), hard link groups (same folder, other folders, inside a read-only folder, one with a first name of 250 bytes), FIFO, character and block devices, a socket, a sparse file, nanosecond times. Compared field by field with the original (
The scripts are in Part two: Windows, files and folders (
|
| what | how | given back |
|---|---|---|
| owner and group | the SIDs in the security descriptor | yes (an owner that is not who extracts: SeRestorePrivilege) |
| DACL | every ACE, as it is: allowed and denied, inherited (ID) and explicit, the inheritance flags, the "protected" bit (inheritance disabled) and the "auto inherited" one |
yes, exactly: no inheritance is pushed to the children |
| SACL | the audit entries (when SeSecurityPrivilege can be enabled: as administrator, yes) | yes |
| integrity label | the mandatory label (Low, Medium, High...) | yes |
| accounts | the name of every account of a computer or of a domain found in the descriptors | yes, by name when it exists here |
| hard links | the names of the same file (volume and file index) seen by this a |
yes: one file, many names |
| short names (8.3) | the short name of every entry that has one different from its name | yes |
| extended attributes | the whole list, for the entries that have some (the ones of the kernel, $KERNEL.*, are left out: no program can set them) |
yes |
| links (65.24) | junctions, symbolic links to files and folders (relative, absolute, even broken), the special files of WSL1: their reparse point, never followed | yes, as they were: an absolute target points where it pointed |
| alternate data streams (65.24) | every named stream of files and folders (the Mark of the Web Zone.Identifier, the attributes of Dropbox...), as entries of the archive |
yes |
| EFS (65.24) | an encrypted file or folder, raw: the ciphertext of every stream and the keys of its users | yes, encrypted again for the same users |
| compression (65.24) | NTFS compression of files and folders; WOF (compact /exe, CompactOS) with its algorithm |
yes |
| sparse files (65.24) | the allocated ranges | yes: the holes exactly where they were |
| object IDs (65.24) | the 64 bytes of FILE_OBJECTID_BUFFER (the tracking of shortcuts) |
yes, when no other file of the volume has it |
| case sensitive folders (65.24) | the flag of fsutil file setCaseSensitiveInfo (WSL) |
yes |
| times and attributes (65.24) | the four times of NTFS (creation, last access, last write, change) to 100 ns, and every attribute (T) |
yes, last of all, after the permissions: to 100 ns (without -tar: the last write, to the second, as always) |
| the root of a volume (65.24) | a c:\ -tar: the root is not an entry; its permissions, object ID, times are in the table |
yes, to the folder it goes to |
Every file and every folder has its row: the permissions of a folder are often the important ones.
A file that even the administrators cannot read (a DENY, the files of some programs...) is read anyway: with -tar zpaqfranz opens the files as backup software does (FILE_FLAG_BACKUP_SEMANTICS, with the backup and restore privileges), so the DACL does not stop it, neither in a nor in x. From 65.24 the scan too: a folder that Windows does not list even to the administrators (C:\Windows\CSC, the folders of Defender, ProgramData\Microsoft\Windows\SystemData...) is listed with -tar as backup software does. Not System Volume Information: it belongs to the volume (shadow copies, the indexer, BitLocker), and Windows makes it again.
What you see
At the end of the a:
6 link(s) (junctions, symbolic links) in the table of -tar, as links (never followed)
-tar (Windows): 3 encrypted (EFS) entries, raw: 3 read now (4.31 KB), 0 the same, 0 not readable
-tar (Windows): the security of 14 entries (9 descriptors), 0 from the archive
-tar (Windows): 2 WOF compressed, 1 sparse, 1 object ID(s), 1 case sensitive folder(s)
-tar (Windows): 2 entries with extended attributes, 3 short names (8.3)
-tar (Windows): the attributes and the four times (100 ns) of 14 entries
-tar (Windows): 6 link(s) in the table (junctions, symbolic links)
-tar (Windows): 4 alternate data stream(s), 3.00 MB
-tar (Windows): 1 account(s) by name, 2 hard link group(s) (4 names in this add)
"9 descriptors" for 14 entries: a descriptor is written once however many files share it (in a real folder, thousands of files share two or three). "From the archive": the entries kept from the table of the previous version (see versions).
At the end of the x:
-tar (Windows): 1 case sensitive folder(s), made before the data, 0 errors
-tar: 1 account(s) by name: 0 the same here, 1 with the SID of this computer, 0 not here (by SID)
-tar (Windows): 2 hard link(s) made, 0 errors
-tar (Windows): 3 short name(s) given back, 0 errors
-tar (Windows): 4 compressed (NTFS), 2 WOF, 1 sparse, 1 object ID(s) given back, 0 errors
-tar (Windows): 3 encrypted (EFS) entries given back, 0 errors
-tar (Windows): attributes and dates (100 ns) given back to 14 entries, 0 errors
-tar (Windows): extended attributes of 2 entries given back, 0 errors
-tar (Windows): 6 link(s) made, 0 already there, 0 errors
-tar (Windows): security given back to 14 entries, 0 errors
What could not be done is an error line for the file (the first 20, all of them with -verbose) and the exit code becomes 1 (a WARNING: the data are there, some metadata are not).
How far it is (65.24). Reading the metadata of every file in a, and giving them back after the data in x, can take minutes (millions of files, a hard disk). After the first two seconds one line, once a second, says the phase, how far it is and an ETA (-noeta: none); a small archive shows nothing:
-tar: giving back the permissions 19.212 / 150.152 ( 12.8%) ETA 00:00:46
One phase at a time (the permissions, the compression, the links...): their steps do not cost the same, and one ETA for all of them would lie. On 150,000 small files, on a VM: a -tar 14 s, x -tar 89 s (65.23: 12 and 90 s, with much less to do).
Administrator only
The security of the files of the other users cannot be read by a normal user, and owners cannot be given back by one: half a table would be worse than none. So:
- run from a normal prompt,
a -tarandx -tarask for the administrator rights by themselves (the elevated window), exactly as-imagedoes; - where that cannot happen (a session that cannot elevate; the "open" build, which does not elevate by itself and works only from a prompt that is already administrator), nothing is done: an error and exit code 2, no archive written, nothing extracted;
xwithout-tarworks for anyone, as always.
Versions
The table of a version is the table of all the files of the archive at that version, not only of the files written by this a. Three consequences:
- A change of permissions alone is seen. On Windows a new ACL does not change the date of the file, so the file is not read again; but the table changes, so the version has a new table (and nothing else: the data are not read again).
- An
awith nothing changed writes nothing. The new table is compared with the one in the archive (size, CRC-32 and hash): the same, nothing is written, no empty version. The last access time alone does not count (65.24o): where Windows keeps it (the Windows 10 22H2 of my tests does, withfsutil behavior query disablelastaccesssaying 2, "system managed, disabled"), every read moves it, the reads ofatoo. An entry whose attributes and other three times are the same keeps theTof the archive; one that changed takes its access time of now. x -until N -tarneeds the table of version N only, and gets the permissions of that version.
Adds of different folders in the same archive are fine: the rows of the files that are not part of this a are taken from the table of the archive, as they were. The rows of the files deleted by this a go away with them.
Use -tar always, or never, on an archive: a version written without -tar keeps the table of the previous one, which may not be right any more for the files of that version.
-index (65.24z12): with a multipart archive and its index (a "z:\x??.zpaq" c:\data -tar -index z:\x_index.zpaq) the table of the version before is in the parts, not in the index. It was read at the wrong place from the second version on, and when the parts were elsewhere (what -index is for) the a stopped with Archive not found. Now it is read from the part of its version; a part that is not here: one line (64421), and the table of the new version has the files of this a only. This is for files: an image (-image, ac) refuses -index (65.24z13, see part three).
Accounts by name
A SID like S-1-5-21-3956606738-664601186-3522947502-1031 is a user of that computer (or of that domain). On another PC, or on the same PC after a reinstall, the user "mario" has another SID, and an ACL that names the old one names nobody.
So a -tar stores, for every such SID found in the descriptors (owner, group, any ACE), its name as Windows gives it: PC-OFFICE\mario, or .\mario for a local account of the computer being backed up (the "same name on the computer where I am extracted").
x -tar looks for that name here. Found: its SID takes the place of the old one in every descriptor. Not found: the old SID stays, as tar does with a uid with no name.
-tar: 3 account(s) by name: 1 the same here, 1 with the SID of this computer, 1 not here (by SID)
The SIDs that are the same on every Windows are never looked for by name: SYSTEM, Administrators, Users, TrustedInstaller, the capability SIDs... Their names change with the language of Windows ("Administrators", "Administratoren"...), their SIDs never do.
-numeric, as tar --numeric-owner: every SID exactly as stored. The right choice when you restore the same machine and do not want any surprise.
Hard links
The names of the same file seen by one a (same volume, same file index) are a group. Each name is stored as a file anyway (the deduplication makes the copies cost a few bytes of index), so every name can still be extracted alone, or without -tar, or by any other zpaq.
x -tar makes every other name of the group a link to the first one extracted, after checking that they have the same data (size and hash). The folders where a link was made get their date back (a new name changes the date of its folder).
Short names (8.3)
An installer, or the registry, can keep paths like C:\PROGRA~1\GAMENA~1\bin. Windows generates short names in the order files are created: after a restore the same folder can become GAMENA~2, and those paths point to nothing.
a -tar stores the short name of every entry that has one, when it is not the name itself (readme.txt is already 8.3: nothing to store). x -tar gives them back with SetFileShortNameW, in two passes: first every short name to give back is taken away, then each one is set. The extraction may have given one of those short names to another file of the same folder: if that one was extracted now too, and has no short name of its own in the table, it loses the generated one.
One thing I learned testing it: turning 8.3 names off (fsutil 8dot3name set ... 1, on the volume or on the whole system) stops only the generation of new short names. A short name set explicitly is accepted anyway, so x -tar gives them back there too.
Another one (65.24p): a file has one short name, however many hard links it has. Edge keeps its files twice, Edge\Application\<version> and EdgeCore\Optimized, as hard links, and the short name is on the second name. On a volume that generates short names (8.3 on, as every system C:) the first name extracted got one, and giving the original one to the link failed: 20,582 errors restoring a whole C: (none on a volume with 8.3 off). Now, in a hard link group with a short name to give back, every name of the group that has none in the table loses the generated one first.
Extended attributes
Almost no Windows program uses them, with one important exception: WSL1, which keeps the owner, group, mode and device numbers of every Linux file in extended attributes ($LXUID, $LXGID, $LXMOD, $LXDEV, LXATTRB). A WSL1 distribution copied without them is broken.
a -tar asks every file how big its extended attributes are (almost always zero: one cheap call), and reads them only when there are some; the ones of the kernel ($KERNEL.*) are left out, since no program can write them back. x -tar gives them back before the permissions.
(WSL2 keeps everything inside a .vhdx: that is a single big file, and needs nothing of this.)
App execution aliases (WindowsApps)
%LOCALAPPDATA%\Microsoft\WindowsApps is full of files of 0 bytes: winget.exe, python.exe, wt.exe, notepad.exe, ms-teams.exe... They are not files: each one is a reparse point (IO_REPARSE_TAG_APPEXECLINK) with the package, the app and the real exe inside, and only CreateProcess knows how to open it. Every read fails ("The system cannot access the file"), so until 65.23m every a of a whole profile ended with errors, with or without -tar. And given back as empty files they would be worse than nothing: an empty winget.exe, first in the PATH, breaks winget.
From 65.23n (65.23o for t):
a(without-tar) never stores them, and says how many in one line, exit code 0. Windows makes them again when the app is registered for the user.a -tarkeeps them in the table (R: the reparse point, attributes, date) with their permissions (F). They are not files of the archive:ldoes not show them,xwithout-tardoes not make them.x -tarmakes them again (FSCTL_SET_REPARSE_POINTon a new empty file), with their date, attributes and permissions. One already there with the same reparse point gets its permissions only; something else in its place is left alone (exit code 1),-forcereplaces it.-only,-not,-toand-untilwork as for the files.
64462: 35 app execution alias(es) of Windows (WindowsApps: 0 bytes, they cannot be read) in the table of -tar, not as files
64464: -tar (Windows): 35 app execution alias(es) in the table (35 in this add)
...
64463: -tar (Windows): 35 app execution alias(es) made, 0 already there, 0 errors
An alias made again in another folder works: winget.exe --version from the -to folder gives the version.
t archive folder leaves the aliases of the folder out too (one line: not compared), and from 65.23o the table itself is no longer a -internal (a file of the archive not on disk): it never is a file of the folder.
Links: junctions and symbolic links (65.24)
Up to 65.23 a junction (or a symbolic link to a folder) was not even seen: the scan skipped it, without entering. A symbolic link to a file was followed: the archive had the data of its target, and x gave back a copy. A Windows restored from such a backup had no C:\Documents and Settings, no C:\Users\All Users, none of the junctions of a profile (Application Data, Start Menu...).
With -tar (without it: as before) they are links, never followed:
a -tarstores their reparse point in the table (J), with attributes, date and permissions: junctions, symbolic links to files and to folders (relative or absolute, even broken ones), and the special files of WSL1 (its symlinks, sockets, FIFOs, devices);x -tarmakes them again (a folder or an empty file, thenFSCTL_SET_REPARSE_POINT), as they were: an absolute target points where it pointed, as tar does with an absolute symlink. One already there and the same: its permissions only; something else there: left alone (exit code 1),-forcereplaces it, but never a folder with something inside.
x without -tar does not make them, and older versions of zpaqfranz ignore them.
A warning I learned the hard way, writing the tests: never run takeown /r or icacls /t on a restored tree with junctions. They go through them, and change the permissions of what is on the other side (C:\Windows\...). rd /s removes the link, not its target.
Alternate data streams (65.24)
With -tar every named stream of every file and folder is stored: the Mark of the Web (Zone.Identifier, which makes Windows and Office warn about files from the Internet), the attributes of Dropbox on files and folders, whatever a program writes there.
- They are asked with the same handle that reads the security (
FileStreamInformation): no other open of the file, almost no cost. - They are entries of the archive, as
-forcewindowsmakes them (name:stream:$DATA): deduplicated and compressed as everything else, and hidden as always (ldoes not show them,xwithout-tardoes not write them). x -tar: the folder of a stream is made before the data (or Windows would make a file with that name); the stream of a file that is there and not written (no-force) is left alone (never a stream of the archive on a file that is not the one of the archive); the date of every file with a stream is set again at the end: writing a stream changes it. That last bug was there with-forcewindowstoo, from always: fixed for it as well.
Encrypted files (EFS) (65.24)
A file encrypted with EFS (cipher /e, the "Encrypt contents" box) can be read only by its users. An administrator cannot read it, and up to 65.23 a ended with an error for it; when it could be read (the backup run by its own user), it came back decrypted.
With -tar it is exported raw (OpenEncryptedFileRaw, what backup software uses): the ciphertext of every stream and the keys of its users, no key needed. It is one more stream of the file in the archive (name:zpaqfranz-efs:$DATA, read from a temporary file beside the archive while the a runs).
- Its data are stored as always too, when they can be read:
xwithout-targives them back, as before. When they cannot (a file of another user), the raw only, and no error. x -tarwrites the data as always, then imports the raw over them (WriteEncryptedFileRaw): the file is encrypted again, for the same users, as it was (the raw of the copy is the same, byte for byte). Encrypted folders too.- An
awith nothing changed does not export again (the same date as in the archive). - Where EFS is not there (WinPE, an edition of Windows without it, a volume that is not NTFS) the import fails: the data stay (when the archive has them), and a WARNING. Not tried yet: WinPE.
One thing to know: Windows refuses the raw export and import to a session of OpenSSH ("access denied"), even as administrator. From a console, an elevated window, a scheduled task, they work.
Compression, WOF, sparse files (65.24)
- NTFS compression (the "Compress contents" box,
compact /c), of files and folders: it was always in the attributes stored, never given back.x -tarsets it, or takes it away from a file that got it from a compressed folder that was already there. - WOF (
compact /exe:lzx, and CompactOS, the way Windows compresses itself on small disks): the data are read as Windows gives them, whole.x -tarcompresses them again with the same algorithm. A Windows restored without it could not fit on its disk any more. - Sparse files:
xalways made a sparse file sparse, its fragments of zeros holes.x -tarmakes the holes exactly where they were, and writes the zeros that were allocated (a range of zeros written on purpose stays written).
Object IDs, case sensitive folders (65.24)
- Object IDs are how Windows finds the target of a shortcut that was moved. They are given back, but two files of a volume cannot have the same one: a restore beside the original (
-toon the same disk) says so in one line, and that is not an error. - Case sensitive folders (
fsutil file setCaseSensitiveInfo, used by WSL): Windows sets the flag only on an empty folder, sox -tarmakes those folders and sets the flag before the data.
x: the order of the work
Before the data: the case sensitive folders, and the folders of the streams of folders. Then everything is extracted as usual. Then:
- the hard links (a copy becomes a link);
- the links (junctions, symbolic links), and the app execution aliases, each with its own permissions;
- the short names;
- the dates of the folders touched by 1, 2 and 3;
- the extended attributes;
- the raw EFS imported over their files;
- the compression; a file that
xleft sparse and was not, not sparse again (its holes filled); then the object IDs, the sparse ranges, WOF last (an object ID set on a WOF file decompresses it:cmd.exeandnotepad.exeof a Windows lost WOF so, without a word, up to 65.24h); - the permissions: the files first, then the folders from the deepest, and the root of a volume;
- the times and attributes of every entry (links, aliases and root too), the folders from the deepest: everything before changes them, the change time too.
The permissions go almost last on purpose: a folder whose DACL denies writing does not stop anything done before. The times go after them because writing a descriptor changes the change time.
Volumes that do not keep everything
exFAT and FAT have no permissions, no extended attributes, no short names of NTFS, no hard links, no reparse points, no compression, no sparse files, no object IDs, no EFS; a network share may keep some and not others. Before giving anything back, zpaqfranz asks the volume what it keeps (once per volume), and instead of an error for every file says one line for each thing the volume cannot keep:
64456$ -tar: the volume of <<M:/restore/game/bin/a.dll>> keeps no permissions: 16 entries without
64456$ -tar: the volume of <<M:/restore/game/bin/b.dll>> keeps no hard links (copies there): 2 entries without
The data are there; the exit code is 1 (WARNING).
l: the column TAR
l of an archive with the table has one more column: TAR for every file and folder whose metadata are in the table.
Date Time Size Ratio TAR Name
---------- -------- --------- ----- --- -----
2026-11-21 15:09:52 [ 12.028 dir TAR # W:/games/game/
2026-11-21 15:09:52 2.402 38% TAR + W:/games/game/bin/f1.dat
2026-11-21 15:09:52 6 33% + W:/games/readme.txt
The fast list (-lfast) has no way to read the table, so on these archives l reads the index (it says so: the table of -tar: the index read as well, for the column TAR). Archives without the table are listed as fast as always. The column is shown on Linux too.
The table: VFILE-w-tar.txt
The franz block of a file (550 bytes, a size every older zpaqfranz expects) has no room for a security descriptor, which can be kilobytes. So the table is one more file in the version, VFILE-w-tar.txt. It is plain text, anyone can read it:
zpaqfranz-wintar 2
C PC-OFFICE
U S-1-5-21-3956606738-664601186-3522947502-1031 1 .\mario
S 0100049414000000300000000000000000...
S 01000484...
F 0 C:/Program Files/Game/
F 0 C:/Program Files/Game/bin/
F 1 C:/Program Files/Game/bin/game.exe
F 1 C:/Program Files/Game/tools/game_copy.exe
L 0 C:/Program Files/Game/bin/game.exe
L 0 C:/Program Files/Game/tools/game_copy.exe
N GAMENA~1 C:/Program Files/Game/Game name with spaces/
E 0000000000050400...4C58554944... C:/Program Files/Game/linux/file
R 1B0000808E010000030000004D006900... 00000420/20261117172816 C:/Users/mario/AppData/Local/Microsoft/WindowsApps/wt.exe
J 030000A05E00000000003800... 00000410/20261124093012 C:/Users/mario/Application Data
W 2/1 C:/Program Files/Game/bin/game.exe
P 1048576+1048576;20971520+2097152 C:/Program Files/Game/data/sparse.bin
O 9CA3166BF1E7F111A9874845E676DEEC... C:/Program Files/Game/readme.txt
X 1 C:/Program Files/Game/linux/
T 20/1DB001195641C9A/1DB00119568E1C8/=/1DD69610A72BEED C:/Windows/System32/notepad.exe
| line | what |
|---|---|
C |
the computer of the a |
U |
a SID, its type, its account (.\name: a local account of that computer) |
S |
a security descriptor, in hex (self-relative); the first is number 0, then 1... |
F |
the descriptor of a name |
L |
a hard link group and one of its names |
N |
a short name and its name |
E |
the extended attributes (a list of FILE_FULL_EA_INFORMATION, in hex) and the name |
R |
an app execution alias: its reparse point (as FSCTL_GET_REPARSE_POINT gives it, in hex), its attributes and date, the name (65.23n) |
J |
a link (junction, symbolic link, a special file of WSL1), as R (65.24) |
W |
WOF: provider (2, a file) and algorithm (0 XPRESS4K, 1 LZX, 2 XPRESS8K, 3 XPRESS16K) (65.24) |
P |
a sparse file: its allocated ranges, offset+length;... (none: a hole only) (65.24) |
O |
an object ID: the 64 bytes of FILE_OBJECTID_BUFFER, in hex (65.24) |
X |
a case sensitive folder: the flags (65.24) |
T |
the attributes and the four times: attributes/creation/access/write/change, hex, the times in 100 ns from 1601 (=: the same as the one before it) (65.24) |
The streams and the raw EFS are not in the table: they are entries of the archive (name:stream:$DATA, name:zpaqfranz-efs:$DATA), with their data deduplicated as everything else.
Lines that a version does not know are left alone: a newer zpaqfranz can add some without breaking the older ones (65.23 reads a table of 65.24 and gives back what it knows). Between versions the table changes little, and the deduplication of zpaq does the rest.
With other versions and systems
| who reads an archive with the table | what happens |
|---|---|
zpaqfranz 65.23, x without -tar |
the data, as always; the table is not written as a file |
zpaqfranz 65.23, x -tar on Linux |
the data; the table is not written; the Linux part of -tar finds nothing to do |
zpaqfranz 65.23, l on Linux |
the column TAR |
zpaqfranz 65.23, x -tar of an archive of 65.24 |
the data, the security, links of files, short names, extended attributes, aliases; not the links, streams, EFS, compression and the rest of 65.24 (exit code 0) |
| zpaqfranz 65.22 and older, zpaq 7.15 | the data, plus VFILE-w-tar.txt written as a small text file (and with -forcewindows, or zpaq 7.15 on Windows, the streams; the raw EFS as a stream of its own, of no use) |
x -tar of an archive without the table |
the data, and a WARNING: no security of Windows files in this archive (version): the data only |
What is not kept, and the limits
the extended attributes of the kernel ($KERNEL.PURGE.ESBCACHE: the signature of an exe, checked once) |
not kept: no program can write them. Windows makes them again (about 32,000 files of a Windows 11) |
System Volume Information |
not kept: it belongs to the volume (shadow copies, the indexer, BitLocker), Windows makes it again |
a SACL present and empty (the files of AppX, WindowsApps) |
given back as no SACL (NTFS writes it so): no audit and no label either way |
| booting | a Windows given back to a disk does not start by itself: its boot partition (EFI) and BCD are not files of C: (that is what ac and xc are for; ac -tar: part three) |
| WIMBoot files (WOF with a WIM behind) | their data are stored, the link to the WIM is not (the WIM may not be there) |
| two names that differ only in case, in a case sensitive folder | zpaqfranz on Windows keeps one name per case-insensitive path: one of them |
| EFS without the EFS service (WinPE, an edition without EFS) or from an OpenSSH session | the raw cannot be read or written: the data as always; a says it in a yellow line for each file (exit code 0, as the security that cannot be read), x a WARNING (OpenSSH: tried; WinPE: not yet) |
| an object ID that another file of the volume has | not given back (one line, not an error) |
names x has to change (-utf, reserved names...) |
they get their permissions, not their links, short names and extended attributes |
| names over 259 characters | given back with or without -longpath: x -tar writes a name over 240 characters in the \\?\ form by itself (65.24; 65.23t did it for the hard links). Not -longpath itself: with one -to it puts every name under it, the folder selected too (x c.zpaq c:/ -to t:\ -longpath makes t:\c_\...) |
| a folder that denies the listing even to the administrators | with -tar: listed as backup software does (65.24). Without -tar the scan (FindFirstFile) does not see inside it: its files are not added at all |
-vss and names over 250 characters |
fixed in 65.24, for every -vss, not only -tar: they were stored as c:/franzsnap/..., every other name as c:/... (x -to put them in a franzsnap folder of their own), and with -tar their security was not read |
x -all |
the table is not used |
hard links between a file of this a and one out of it |
not seen: the group is made by the scan of one a |
How it was tested
On a Windows 11 virtual machine (tortura\w11\w11_wintar.ps1, 45 checks, and w11_wintar_na.ps1 for the user that is not an administrator). Every descriptor is compared, as SDDL with owner, group, DACL, SACL and label, before and after (tortura\w11\sddl.cpp, which also checks links, short names and extended attributes):
- owner TrustedInstaller; a
DENYthat keeps the administrators out; inheritance disabled with a group of its own; the SID of a user deleted before the backup; integrity label High; an audit entry in the SACL; x -tar: every descriptor identical;xwithout-tar: the permissions of where the files land, and noVFILE-w-tar.txt;- an
awith nothing changed: the archive untouched; oneicaclsonly: a new version,-untilgives back the old and the new permission; - two folders in two adds: both given back;
-onlyone file: that one only;-forcein place over a changed permission: repaired; - two hard link groups, one across two folders: links again, and the date of the folder as stored;
- a local user deleted and created again with the same name (another SID): its new SID with
-tar, the old one with-numeric, the old one when the user is not there; - short names set in the "wrong" order and one for a folder that Windows would never make: all given back; extended attributes like the ones of WSL on a file and a folder: given back;
- NTFS with 8.3 off: everything given back; exFAT: the data, one line for each thing it cannot keep, exit code 1;
-vss, the elevated run,t,l; and the same archive extracted on Linux (Fedora).- 65.23n, the app execution aliases (
tortura\w11\w11_alias2.cmd):aanda -ntfsrc 0;a -tartwice (the same table);xwithout-tar: none;x -tar: the 35 made again, the reparse point identical (fsutil reparsepoint query), the same date, owner, group and DACL, andwinget.exe --versionruns from the new folder;x -taragain: "already there";-only; a regular file in the place of one: left alone, then-force; one deleted between two adds: gone from the table; the realwinget.exeof the user deleted and given back byx -tar:wingetworks again.
The SACL of the aliases is present and empty (S:in SDDL, as AppX makes it);SetKernelObjectSecuritywrites it back as no SACL (S:NO_ACCESS_CONTROL): no audit either way. - 65.24, everything NTFS keeps (
tortura\w11\w11_tar24.ps1, on Windows 11 and Windows 10;tortura\w11\nt24.cppdumps, for every entry, attributes, date, data, every stream, reparse point and target, WOF, allocated ranges, object ID, case sensitivity and SDDL). A folder with all of it: streams on files, on a read-only hidden file and on a folder (one of 3 MB); a junction inside the tree and one toC:\Windows\Help, a symbolic link to a folder, to a file (relative, absolute, broken); NTFS compression of a folder and of files, one not compressed inside it; WOF LZX and XPRESS4K; a sparse file with ranges and 1 MB of zeros allocated; EFS files and folder (made by a scheduled task: OpenSSH has no EFS); an object ID; a case sensitive folder.
x -taron another volume: every line identical (27 of 27); on the same volume, the object ID only (the original has it). 17 more checks (on the Windows 10 too, where the access times move: 65.24n wrote the table again there, 65.24o does not): anawith nothing changed writes nothing and does not export the EFS again;xwithout-tar: the data only, no stream, no link;x -tarover a copy (links "already there") and with-force; a stream and a junction changed,-until 1and the last version;lshows no stream;t,twith the folder; 65.23 reads the archive (exit code 0, nothing of 65.24 written). And a file encrypted by another user:a -tarkeeps its raw only,x -targives it back encrypted, its raw identical byte for byte,xwithout-tardoes not make it (8 checks).
The tests of 65.23 again (w11_wintar.ps144,w11_wintar_na.ps13,w11_tarlungo.ps18,w11_alias2.cmd),autotest -all; 150,000 files for the times and the ETA. - 65.24, the whole
C:of a Windows 11 against its image (tortura\w11\w11_cimg.ps1,nt25.cpp,diff25.py).a -imageofC:(17.9 GB used, 195,960 entries; 33 s), the image restored on a partitionG:(42 s):G:is thatC:, frozen.a -tarofG:(142 s, 9.08 GB),x -taron a new, formattedT:(548 s), andnt25dumps every entry of both: the four times to 100 ns, attributes, data, streams, reparse points, WOF, allocated ranges, object ID, case sensitivity, 8.3 name, extended attributes, hard link group, EFS raw, SDDL with SACL, label and resource attributes. A secondawrites nothing (the same table);G:is untouched after thea(its dump the same, byte for byte).
Result: every column of every entry the same, except what the limits above say: the extended attributes of the kernel (31,788 files), the empty SACL of 28,375 files of AppX given back as none,System Volume Information. The root ofT:is the one ofC:(owner TrustedInstaller, its DACL, its object ID). The same through-vssof the liveC:(a c:\ -tar -vss,x c:/ -to u:\ -tar): rc 0, the differences only of the hour between the two (logs, prefetch, the registry).
The first round of this test (65.24h) found what the small tests had not seen, all of it with 0 errors in the lines ofx: creation, access and change times never given back, the last write to the second; WOF lost by the 12 names of 6 files with an object ID (cmd.exe,notepad.exe...); 66 files in folders Windows does not list, not archived; the ARCHIVE attribute on 630 files that had not it, 104 files left sparse; the short names of the links; the root of the volume; 5 resource attributes (RA) of the files of an app. With-vss: 24 descriptors not read and 3 names over 255 characters not extracted (rc 2). All fixed in 65.24i-n.
Part three: Windows, the whole disk by its files (ac -tar)
Read this before anything else.
ac -taris an experiment. There is no guarantee that a Windows restored from it starts, or works as it did.Windows does not foresee being put back file by file. Some of what it keeps on its own files can be written only by Windows itself, by its kernel: no program can write it back, not zpaqfranz, not any backup software (the extended attributes
$KERNEL.*, below). The system backup of Windows itself is an image of the volumes, not a copy of their files.So errors can show up after a restore, and one of them shows up almost always. Most of them are patched by
zpaqfranz fix; if you forget it, never mind: Windows rebuilds what is missing by itself, one app at a time.The reliability of this kind of backup is very low (see the recap at the end). Take it for what it is: a test bench, where I learn what a restore by files must do to be right. For a backup to rely on, use
ac: the image.
What it is
ac saves the disk of Windows for a restore that boots: the partition table, the small partitions it boots with (EFI, MSR, recovery: raw, byte by byte), and C: as an image (its used clusters, through a shadow copy). xc writes it all back on a disk.
ac -tar does the same, but takes C: by its files, as a c:\ -tar -vss would: every file, with everything Part two keeps (owners, permissions, links, streams, short names, compression...). At the restore, xc formats a new NTFS for C: and puts the files back with x -tar.
ac w:\pc.zpaq -tar the disk of Windows, C: by its files
ac w:\pc.zpaq -tar -all every partition of that disk too (65.24z11)
ac w:\pc.zpaq -tar -frugal without the junk of every user
xc w:\pc.zpaq the plan: what is in the backup, nothing written
xc w:\pc.zpaq -to 2: -force on the physical disk 2 (it asks how big C:)
xc w:\pc.zpaq -to 2: -force -resize +20 ...20 GB more for C:, not asked
xc w:\pc.zpaq -to c: -force C: only, on a partition that is there (a Windows PE)
image w:\pc.zpaq -to d:\pc.vhdx the whole disk in a .vhdx, or a .vhd (65.24z11)
zpaqfranz fix in the restored Windows, after its first boot
Why would anyone want it, when the image is safer? Because files can do what an image cannot:
- any size:
C:comes back bigger or smaller than it was, on a disk bigger or smaller than the original (an image of an NTFS comes back exactly as big as it was); - every file of every version can be taken out with a plain
x, by any zpaqfranz, without restoring anything; - what Windows itself says not to back up stays out of the archive.
And because it is the hardest test there is for Part two: a whole Windows (175,000 to 196,000 entries on my test VMs) has to come back right, or it does not start.
What is saved, and what is not
| zone | ac -tar |
ac -tar -all |
|---|---|---|
| the partition table, the start and the end of the disk | raw | raw |
| EFI, MSR, recovery (and a partition without a letter up to 1 GB) | raw | raw |
C: |
its files (-tar -vss) |
its files |
a data partition with a letter (D:, E:...) |
not saved: on another disk it is made again, empty (to be formatted) | its used clusters (NTFS, FAT, exFAT), as ac -all |
| a partition Windows cannot read (VeraCrypt, BitLocker locked, not formatted) | not saved | raw, the whole of it |
| the partition the archive is written on | not saved | not saved |
-not f: leaves a partition out of -all. The archive cannot be on C: (it would be inside its own backup).
Not with -index (65.24z13, issue #383). -index is for a multipart archive whose parts are kept somewhere else, with only the index here. But what the next run of ac needs (the state of -wim, the small files of the images, the table of -tar) is data of the archive, in its parts, not in its index. Up to 65.24z12 ac ... -wim -index stopped with Archive not found when the parts were elsewhere; now ac (in every form: -tar, -all, -wim) and every -image refuse -index at once (01949), nothing done. A multipart archive without -index is fine.
Out of C:, always: pagefile.sys, swapfile.sys, hiberfil.sys (Windows makes them again; in a shadow copy they are zeros anyway).
What Windows says not to back up (65.24y): the registry key FilesNotToBackup lists memory dumps, the cache of Windows Update, temporary files, error reports...: left out, the folders stay, without their files. -everything takes them too. One entry of that list is ignored on purpose: the log of MSDTC, without which the transaction coordinator of the restored Windows did not start (found in a test, 65.24z9). -frugal: the junk of every user too (caches, temporary files), never what a restored Windows needs.
The registry (65.24z8). The hives (SYSTEM, SOFTWARE, the NTUSER.DAT of every user logged in...) are not taken from the shadow copy: they are saved from memory (RegSaveKeyEx), whole and clean, and their log files are stored empty. Why: a shadow copy taken by a program is like pulling the plug. After an unclean shutdown, the SYSTEM hive in the copy was one that Windows "repaired" when loading it, giving every service key the same security: the restored Windows started without network (DNS client, DHCP, BFE: "access denied"). Found on a test VM, reproduced, fixed.
The metafile disk_C.txt says everything: the disk, every zone, what is saved and how; for C: its cluster, serial number, MFT record size, whether it makes short names, what was left out. It is a text file of the archive: x z:\pc.zpaq disk_C.txt -to z:\out\ and read it.
xc: the restore
On a disk (-to N: -force, then the captcha with the name of the disk):
- the partition table and the raw pieces, each checked against the index first (size, CRC-32, hash, fragments);
C:gets a letter for the time of the restore (on GPT it has none), and is formatted NTFS with its cluster, its label, its short names setting and its serial number (written back into its boot sector);- its files come back with
x -tar: the accounts by their SIDs (-numeric), the version of the backup, the switches that would change the names (-longpath,-flat,-utf...) turned off for it; - with
-verify: every piece read back right after it was written, then every file ofC:read back (with the rights of a backup) against the archive; - the table of the backup last.
How big C: (65.24z11). On a GPT disk that is not the disk of the backup, xc says how big the partition of Windows is, how much its files want while written, how much room the disk has, and asks:
xc: the partition of Windows is of 30.09 GB, its files want about 23.12 GB while written (5% more: 24.27 GB)
xc: disk 2 is 30.00 GB bigger than the disk of the backup (50.00 GB): free room after the partitions as they are
xc: it can be from 24.27 GB to 60.09 GB (-5.82 GB to +30.00 GB)
How many GB more for the partition of Windows? (+5: 5 GB more, -5: 5 GB less;
ENTER or 0: as it is, nothing moved):
- ENTER (or
0):C:as big as it was, every partition where it was; the room more stays free at the end of the disk. +5: 5 GB more; the partitions after it (recovery, data) move by as much, with the same distances between them.-5: 5 GB less, if the files fit (and 5% more). This is how a smaller disk can be used: xc says how muchC:must shrink, at least.- What cannot be done is said, and nothing is written.
-resize Xgives the answer on the command line (scripts);-nocaptchawithout it: as it is.
The boot files find the partitions by their GUIDs, so they can move; the ReAgent.xml of the restored Windows is told where its recovery partition went. On an MBR disk: the layout of the backup, no question (for now). Up to 65.24z10 C: took by itself all the room of a bigger disk: asking is better, a disk ten times bigger does not always want a C: ten times bigger.
The original disk is here too (the same GUIDs): Windows would put one of the two off line. xc gives the restored disk an identity of its own while it formats it, the one of the backup at the end, and leaves it off line. Take one of the two disks away before booting.
A virtual disk (65.24z11): xc pc.zpaq -to d:\pc.vhdx, or image pc.zpaq -to d:\pc.vhdx (a .vhd too). The virtual disk is made here (expandable: it grows as it is written), attached by Windows, written as a disk, detached. It has the GUIDs of the original disk: it is for a virtual machine, or another PC. Administrator only (Windows attaches virtual disks for them).
C: alone (-to c: -force, captcha formatC): on a partition that is there, from a Windows PE when C: does not start any more. Formatted the same way, then its files. It must be as big as the files want, and 5% more (-space: all the same). On the partition of the backup itself it boots as before; anywhere else its boot files must be made (bcdboot c:\Windows).
The room while writing. x -tar gives the compression (NTFS, WOF) back after the data: while it writes, a compressed file takes its whole size. On the test VM: 26 GB used on C:, about 23 GB wanted while written (since 65.24y the names of a hard link group are written once: before, 35 GB).
The apps, and the marks of the kernel on their files
What an "app" is. Since Windows 8, besides the programs everyone knows (an installer, a folder in C:\Program Files, an .exe), Windows has apps: programs that come as a signed package from the Microsoft Store, the Windows version of the App Store and of Google Play on the phones. They live in a folder that even an administrator cannot open (C:\Program Files\WindowsApps), and the Store keeps them up to date. The idea was to make the PC work like a phone. It did not really happen (most software is still made of plain programs, and Windows Phone is long gone), but along the way a good part of Windows itself became apps: Photos, Calculator, Paint, the Notepad of Windows 11, Phone Link, the Store itself. A Windows 11 just installed has about a hundred packages.
Why they need something special. The promise of a store is that what you run is exactly what the store delivered, not a copy someone changed. To keep it, Windows checks the files of a package against its signature, and that means reading all of them: slow. So once a file has been checked, Windows writes a mark on it, and the next time it trusts the mark instead of checking again.
Where the mark is. In an extended attribute: a small named piece of data attached to a file, next to its content, that Explorer does not show and almost no program uses (Part two keeps them: WSL1 needs them). The marks of Windows have names beginning with $KERNEL.: $KERNEL.PURGE.APPXFICACHE on the files of the apps (about 28,000 files on a Windows 11), $KERNEL.PURGE.ESBCACHE for the signature of the executables.
Why no program can write them. Two rules, both on purpose:
- an attribute whose name begins with
$KERNEL.can be written only by the kernel of Windows: not by a program, not as administrator, not by backup software; PURGEmeans that NTFS deletes it by itself as soon as the file is changed.
If a program could write the mark, any malware could put "checked" on a file it had just changed, and the check would be worth nothing. So the mark is made only by Windows, and only after checking. A restore by files writes the very same bytes, but in a new file, without the mark. An image of the volume, instead, gives back its sectors, and the marks with them.
What happens without them. Nothing is broken: the files are right, byte for byte. Windows just does not find the mark, so it no longer trusts the package: the first time an app starts it says "This app can't open", checks the whole package and writes the marks again; from the second launch on, everything works. The cache of the signatures of the executables comes back the same way, silently, the first time each one is loaded.
Honestly, it is a lot of machinery to protect a store that never became what it was meant to be. But it is in every Windows, and a restore by files has to live with it: hence fix.
After the first boot: fix, and the error that comes anyway
After a restore by files the marks above are not there, so every packaged desktop app (Phone Link, Photos, Notepad...) fails once, at its first launch ("This app can't open", 0x80073CFC): Windows checks its package, writes the marks again, and from the second launch on the app works. The apps of the Store wait for the check and open at the first try.
Something like that
zpaqfranz fix, run in the restored Windows, as administrator, asks Windows to check every package at once (VerifyContentIntegrityAsync: about 100 packages in half a minute, no app started). After it the apps open at the first try.
One error comes anyway: the window of Phone Link at the very first login, before anything can be run. Close it.
fix forgotten: never mind. Each app fails once, and Windows repairs it by itself. fix only saves you those failures.
The other mark, $KERNEL.PURGE.ESBCACHE, needs nothing: Windows makes it again by itself.
What can go wrong
- the clone does not start at all;
- it starts, and some service does not: seen, and fixed, no network (the hive from the shadow copy, 65.24z8) and MSDTC (its log left out, 65.24z9). Others may be waiting;
- the apps fail once each (above:
fix); - files the backup could not read (in use, locked, without the shadow copy:
-novss) are not there; - what Windows was doing during the shadow copy is frozen in that instant, as after a power cut;
- a security descriptor with an empty SACL comes back with no SACL; files with no short name on the original get one (NTFS makes them): no effect seen;
- BitLocker:
C:is read in clear, and comes back not encrypted; - on a Windows 10 VM an
ac -tarcrawled at 74% and was stopped: not understood yet.
How ac -tar was tested
On virtual machines only, never on real hardware:
- Windows 11, the first test VM (GPT, UEFI):
ac -tarofC:(25 GB used, about 196,000 entries, 3 to 4 minutes),xcon a second disk, the original disk taken away, the clone started: desktop, login, Windows activated, network and services up (from 65.24z8), WinRE enabled,chkdskclean, DISM with no damage;sfc: one file missing, missing on the original too. The apps: one failure each beforefix, none after it. The clone made bigger (+16 GB, the partitions after it moved): started, WinRE found. - Windows 11, the new test VM (with a data partition and a VeraCrypt one, 65.24z11):
ac -tar(the two data partitions left out),ac -tar -all(the NTFS by its used clusters, the VeraCrypt one raw: restored with the same SHA-256, the files of the NTFS the same),-all -not f:;xcwith+5, ENTER,-5, and-5.5on a disk smaller than the original; the.vhdxand the.vhd; every restore with-verify(every file read back the same), every partition table read back (the copy of the GPT at the end of the disk, the old one gone). These clones were not started yet. - Not tested: real PCs, other hardware, MBR and BIOS with
ac -tar, BitLocker onC:, a PC in a domain, a Windows with updates waiting for a reboot.
The big recap: how much to trust each backup
These are my estimates. Not measurements.
I give them because you should know them before you trust a backup of Windows to zpaqfranz.
| what you made | what you hope for | how likely, in my opinion |
|---|---|---|
ac -tar (C: by its files) |
the restored Windows starts | 10% |
ac -tar |
the archive has practically all your data, to be taken out by hand (x) |
20% |
ac (C: as an image, by its sectors) |
turned into a .vhd/.vhdx (image), and the data taken out by hand |
70% |
ac |
really restored on bare metal (xc), and it boots |
40% |
ac -wim (the image, reading only what changed) |
it works | 50% |
ac -wim |
it really gives back what was there | 30% |
ac -tar is the least reliable of all. It is a test bench, to learn how to restore well with -tar, not a backup to bet your PC on. With an image by sectors I am more confident; -wim is somewhere in between, younger, and with more that can go wrong.
These numbers are not based on measurements: a handful of virtual machines are not statistics. But they are the best estimate you can get.
To make them go up, feedback is needed. Users who try (a spare disk, a virtual machine, an old PC), and report what happened, good or bad, in an issue on GitHub: what Windows, what disk, what command, what went wrong. A restore that worked is news too. Every report from a real PC moves these numbers more than a hundred runs on my VMs.
Uh oh!
There was an error while loading. Please reload this page.
Windows: from zpaqfranz 65.23. Linux, macOS, FreeBSD, OpenBSD, Solaris: from 65.4l (with fixes up to 65.23).
In short
An archive of zpaqfranz keeps the data of every file, its date and its basic attributes.
That is what you need nine times out of ten.
The tenth time you need everything the file system knows about a file: who owns it, who may read it, which other names it has, and so on.
That is what
-taris for.The switch is the same everywhere, and the idea is the same everywhere: keep what tar would keep.
But "what the file system knows" is a very different thing on Windows and on *nix, so the two worlds are explained separately:
-numeric: by SID)-numeric: by number)-windate, as always)-imageVFILE-w-tar.txtWithout
-tarnothing changes, on any system: the archive is the one you know, andxwithout-targives the data back as always, whatever is stored in the archive.Part one: Windows
Why
The request came from a user who needed to put back a game installed under
C:\Program Files, with its "strange" permissions: an installer that sets owners and ACLs of its own, and does not work any more if a copy of the files comes back with the permissions of the folder they land in.The usual answers were not good ones:
-imagewith a filter): the image would contain every other file of the volume too, with its name and size but full of zeros. Restored as a volume it would destroy everything outside the folder; mounted, it would be a trap of files that look right and are not. A volume with only the folder means writing an NTFS from scratch, or copying with external tools: not worth it.What the user needs is not a disk: it is the data of the files plus what NTFS knows about each of them. That is exactly what
-tardoes on *nix, so the same switch does it on Windows.Using it
Adds the folder, as always, and one more file in the version: the table of the security of every file and folder (see the table). With
-vsseverything is read from the shadow copy, the security too.Gives back the files where they were, and their owners, permissions, links, short names, extended attributes. With
-forcethe files that are already there and identical are not written again, but their metadata are given back anyway: the quickest way to repair the permissions of a folder that somebody "fixed".Somewhere else, a part, an older version: everything works as usual. Only the files really extracted (or found identical with
-force) get their metadata:-onlynever touches the files of the folder that were not selected.The SIDs exactly as stored, never looked for by name (see accounts).
What is kept
ID) and explicit, the inheritance flags, the "protected" bit (inheritance disabled) and the "auto inherited" onea$KERNEL.*, are left out: no program can set them)Every file and every folder has its row: the permissions of a folder are often the important ones.
A file that even the administrators cannot read (a
DENY, the files of some programs...) is read anyway: with-tarzpaqfranz opens the files as backup software does (FILE_FLAG_BACKUP_SEMANTICS, with the backup and restore privileges), so the DACL does not stop it, neither inanor inx.What you see
At the end of the
a:"9 descriptors" for 14 entries: a descriptor is written once however many files share it (in a real folder, thousands of files share two or three). "From the archive": the entries kept from the table of the previous version (see versions).
At the end of the
x:What could not be done is an error line for the file (the first 20, all of them with
-verbose) and the exit code becomes 1 (a WARNING: the data are there, some metadata are not).Administrator only
The security of the files of the other users cannot be read by a normal user, and owners cannot be given back by one: half a table would be worse than none. So:
a -tarandx -tarask for the administrator rights by themselves (the elevated window), exactly as-imagedoes;xwithout-tarworks for anyone, as always.Versions
The table of a version is the table of all the files of the archive at that version, not only of the files written by this
a. Three consequences:awith nothing changed writes nothing. The new table is compared with the one in the archive (size, CRC-32 and hash): the same, nothing is written, no empty version.x -until N -tarneeds the table of version N only, and gets the permissions of that version.Adds of different folders in the same archive are fine: the rows of the files that are not part of this
aare taken from the table of the archive, as they were. The rows of the files deleted by thisago away with them.Use
-taralways, or never, on an archive: a version written without-tarkeeps the table of the previous one, which may not be right any more for the files of that version.Accounts by name
A SID like
S-1-5-21-3956606738-664601186-3522947502-1031is a user of that computer (or of that domain). On another PC, or on the same PC after a reinstall, the user "mario" has another SID, and an ACL that names the old one names nobody.So
a -tarstores, for every such SID found in the descriptors (owner, group, any ACE), its name as Windows gives it:PC-OFFICE\mario, or.\mariofor a local account of the computer being backed up (the "same name on the computer where I am extracted").x -tarlooks for that name here. Found: its SID takes the place of the old one in every descriptor. Not found: the old SID stays, as tar does with a uid with no name.The SIDs that are the same on every Windows are never looked for by name: SYSTEM, Administrators, Users, TrustedInstaller, the capability SIDs... Their names change with the language of Windows ("Administrators", "Administratoren"...), their SIDs never do.
-numeric, astar --numeric-owner: every SID exactly as stored. The right choice when you restore the same machine and do not want any surprise.Hard links
The names of the same file seen by one
a(same volume, same file index) are a group. Each name is stored as a file anyway (the deduplication makes the copies cost a few bytes of index), so every name can still be extracted alone, or without-tar, or by any other zpaq.x -tarmakes every other name of the group a link to the first one extracted, after checking that they have the same data (size and hash). The folders where a link was made get their date back (a new name changes the date of its folder).Short names (8.3)
An installer, or the registry, can keep paths like
C:\PROGRA~1\GAMENA~1\bin. Windows generates short names in the order files are created: after a restore the same folder can becomeGAMENA~2, and those paths point to nothing.a -tarstores the short name of every entry that has one, when it is not the name itself (readme.txtis already 8.3: nothing to store).x -targives them back withSetFileShortNameW, in two passes: first every short name to give back is taken away, then each one is set. The extraction may have given one of those short names to another file of the same folder: if that one was extracted now too, and has no short name of its own in the table, it loses the generated one.One thing I learned testing it: turning 8.3 names off (
fsutil 8dot3name set ... 1, on the volume or on the whole system) stops only the generation of new short names. A short name set explicitly is accepted anyway, sox -targives them back there too.Extended attributes
Almost no Windows program uses them, with one important exception: WSL1, which keeps the owner, group, mode and device numbers of every Linux file in extended attributes (
$LXUID,$LXGID,$LXMOD,$LXDEV,LXATTRB). A WSL1 distribution copied without them is broken.a -tarasks every file how big its extended attributes are (almost always zero: one cheap call), and reads them only when there are some; the ones of the kernel ($KERNEL.*) are left out, since no program can write them back.x -targives them back before the permissions.(WSL2 keeps everything inside a
.vhdx: that is a single big file, and needs nothing of this.)x: the order of the work
Everything is first extracted as usual. Then:
The permissions go last on purpose: a folder whose DACL denies writing does not stop anything done before.
Volumes that do not keep everything
exFAT and FAT have no permissions, no extended attributes, no short names of NTFS, no hard links; a network share may keep some and not others. Before giving anything back, zpaqfranz asks the volume what it keeps (once per volume), and instead of an error for every file says one line for each thing the volume cannot keep:
The data are there; the exit code is 1 (WARNING).
l: the column TAR
lof an archive with the table has one more column:TARfor every file and folder whose metadata are in the table.The fast list (
-lfast) has no way to read the table, so on these archiveslreads the index (it says so:the table of -tar: the index read as well, for the column TAR). Archives without the table are listed as fast as always. The column is shown on Linux too.The table: VFILE-w-tar.txt
The franz block of a file (550 bytes, a size every older zpaqfranz expects) has no room for a security descriptor, which can be kilobytes. So the table is one more file in the version,
VFILE-w-tar.txt. It is plain text, anyone can read it:CaU.\name: a local account of that computer)SFLNEFILE_FULL_EA_INFORMATION, in hex) and the nameLines that a version does not know are left alone: a newer zpaqfranz can add some without breaking the older ones. Between versions the table changes little, and the deduplication of zpaq does the rest.
With other versions and systems
xwithout-tarx -taron Linux-tarfinds nothing to dolon LinuxTARVFILE-w-tar.txtwritten as a small text filex -tarof an archive without the tableno security of Windows files in this archive (version): the data onlyWhat is not kept, and the limits
-tar:-forcewindows, as always-tar:-windate, as alwaysxhas to change (-utf, reserved names...)FindFirstFile) does not see inside it: its files are not added at all, with or without-tarx -allaand one out of itaHow it was tested
On a Windows 11 virtual machine (
tortura\w11\w11_wintar.ps1, 45 checks, andw11_wintar_na.ps1for the user that is not an administrator). Every descriptor is compared, as SDDL with owner, group, DACL, SACL and label, before and after (tortura\w11\sddl.cpp, which also checks links, short names and extended attributes):DENYthat keeps the administrators out; inheritance disabled with a group of its own; the SID of a user deleted before the backup; integrity label High; an audit entry in the SACL;x -tar: every descriptor identical;xwithout-tar: the permissions of where the files land, and noVFILE-w-tar.txt;awith nothing changed: the archive untouched; oneicaclsonly: a new version,-untilgives back the old and the new permission;-onlyone file: that one only;-forcein place over a changed permission: repaired;-tar, the old one with-numeric, the old one when the user is not there;-vss, the elevated run,t,l; and the same archive extracted on Linux (Fedora).Part two: Linux and the other *nix
Using it
With
-tarzpaqfranz keeps what tar keeps: owner and group (by number and by name), permissions (setuid, setgid, sticky too), modification and access time with nanoseconds, symbolic links (the link, not what it points to), hard links, FIFOs, character and block devices. And it gives them back withx -tar, as tar does: owners by name if that user exists (-numeric: by number, astar --numeric-owner).Plus what tar does not have: deduplication, versions, a hash for every file.
On Linux, macOS, FreeBSD, OpenBSD and Solaris the copy comes back identical, checked field by field; the
tarof macOS and FreeBSD, on the same tree, loses the nanoseconds and more.What a -tar stores
awithout-tara -tarchown/chgrpaloneA symlink is never followed, not even when it points to a folder: the link is stored, what it points to is stored only if it is in the tree too. Same for a symlink given on the command line:
a x.zpaq /some/link -tarstores the link.At the end:
The metadata live in the franz block of every file (the 360 bytes of a Posix structure, plus 24 bytes for nanoseconds and 32-bit ids), so no extra file is needed.
What x -tar does
Everything is first extracted as usual (a symlink as a small file holding its target, a FIFO or a device as an empty file); then, when all the data are written:
mkfifo(); a device:mknod()(root only);chowndrops setuid and setgid, so the order matters), then creation date, mtime and atime;Over what is there (
x -forceon a folder already extracted): a symlink, FIFO or device where a file goes is removed first, never written through. A symlink could point anywhere (/etc/passwd), a device is a device, a FIFO would stopxforever. This holds for everyxon *nix, with or without-tar.Owners and permissions
Owners. By default by name: if the user (group) of the archive exists on this machine, its uid (gid) here; else the number of the archive. The same default of GNU tar. With
-numericalways the number: the right choice restoring a system from a live CD, whose/etc/passwdis not the one of the backup.Not as root, as tar (65.19h): the files belong to whoever extracts them, the modes go through the umask, setuid/setgid/sticky are dropped, devices are not made.
-sameperms(astar -p) gives the modes exactly as stored to a normal user too.Hard links, across versions
The files with the same device and inode seen by one
aare a group: one name is stored as a file, every other one as "link to that name". The data are stored for every name anyway (deduplicated: a few bytes of index), so each name can still be extracted alone, or without-tar, or by zpaq 7.15, as a full copy.A backup made every night meets groups that change: a link added, the "first" file deleted or replaced. Since 65.23 (issue #377) these cases are handled, and tested:
d/newlinked tod/s/file) became a group of its own, and came back as a separate copy;x, the links are made after all the files, by groups: a link and the name it points to, or the links whose first name is gone (deleted, or replaced by other data: never linked to it, it would give them the data of another file). One name stays a file, every other one becomes a link to it, whatever the order of the names;What cannot be repaired: an archive written by 65.22 or before, where such a new link was stored as a plain file. It stays a copy (also on the next adds, until the file changes).
-not with -tar
-not "/proc/*"with-tarleaves out what is inside/proc, not/procitself, astar --exclude(65.18j, issue #350). A system restored from such a backup has its empty/proc,/sys,/dev,/run, as it must. Without-tarthe rule is the one of always.l -tar
A symlink shows
link:(and "full target: the content" when it is longer than the 215 bytes shown), a devicedevice: major,minor, a hard link the first name of its group.Versions
A
chmod, achown, a new target of a symlink, a new name for a file (hard link) all write a new version of that entry; the data are read again only if they changed.x -until N -targives back the owners, modes and links of version N.Use
-taralways, or never, on an archive: anawithout-tardoes not see symlinks, FIFOs and devices (so they look deleted in that version), and a file written again without-tarhas no metadata in that version.What is not kept, and why
linkname, 216 bytes, and the block cannot grow02125user.*,com.apple.*), ACLs (POSIX and NFSv4), SELinux labels, file capabilities (setcap)restorecon -Rafterx; capabilities (ping...) must be set againchattr +i,chflags uchg/schg/nodump)The way beyond these limits is the one Windows took: a table in a file of the version. For *nix it is not done (yet).
The limits of each operating system
setattrlist()chmodfails: done again without themchmodfails: done againThe builds: every Linux, macOS, BSD and Solaris build has
-tar; the NAS builds too (65.15z10), and every-DANCIENTbuild (65.16h; where the system has no nanosecond times,utime()with seconds). The ESXi build and the "open" one for *nix refusea -tarat once (79532), instead of writing an archive without metadata.How it was tested
A tree with every kind of entry: files with every mode (0000, 0444, 4755, 2755, 6750, 1644...), owners with 32-bit ids and 32-character names, ids with no name, sticky and read-only folders (with links inside), symlinks (relative, absolute, dangling, to a folder, 300 and 2,584 bytes long, with spaces and accents), hard link groups (same folder, other folders, inside a read-only folder, one with a first name of 250 bytes), FIFO, character and block devices, a socket, a sparse file, nanosecond times. Compared field by field with the original (
bench/tar/tarcmp.py):/usrof Fedora: 66,824 entries, 8,071 symlinks, 8,823 hard-linked filestarof the system, same treechown,chmod,chgrp, new symlink target, new hard link, deleted file-untilgives back the old owner and targettortura/tutti/t377.sh, 24 checks: the five layouts of issue #377, a first link added later, the first name deleted and then a new link, the first name replaced, data changed with a new link, two groups with the same data,-onlyof one link)-O1and-O3-numeric,-turbo,x -forceover a symlink and a FIFOFinal words
I don't really rely on metadata on either *Nix or Windows, so I've only done minimal testing on that front.
Since it's outside my own use case ("Franco's needs"), I haven't run extensive tests for it.
If you actually need it, feel free to test it yourself and report any issues, I'll be happy to fix them.
All reactions