2019-03-16 18:44:45 +03:00
File Formats
============
2019-11-17 14:53:08 +03:00
.. _pxar-format:
2019-03-16 18:44:45 +03:00
Proxmox File Archive Format (`` .pxar `` )
---------------------------------------
.. graphviz :: pxar-format-overview.dot
2021-02-28 12:32:56 +03:00
.. _data-blob-format:
2021-02-28 13:25:22 +03:00
Data Blob Format (`` .blob `` )
----------------------------
2021-02-28 12:32:56 +03:00
2021-10-27 17:19:27 +03:00
The data blob format is used to store small binary data. The magic number
decides the exact format:
2021-02-28 12:32:56 +03:00
.. list-table ::
:widths: auto
* - `` [66, 171, 56, 7, 190, 131, 112, 161] ``
- unencrypted
- uncompressed
* - `` [49, 185, 88, 66, 111, 182, 163, 127] ``
- unencrypted
- compressed
* - `` [123, 103, 133, 190, 34, 45, 76, 240] ``
- encrypted
- uncompressed
* - `` [230, 89, 27, 191, 11, 191, 216, 11] ``
- encrypted
- compressed
2021-10-27 17:19:27 +03:00
The compression algorithm used is `` zstd `` . The encryption cipher is
`` AES_256_GCM `` .
2021-02-28 12:32:56 +03:00
Unencrypted blobs use the following format:
.. list-table ::
:widths: auto
* - `` MAGIC: [u8; 8] ``
* - `` CRC32: [u8; 4] ``
* - `` Data: (max 16MiB) ``
2021-10-27 17:19:27 +03:00
Encrypted blobs additionally contain a 16 byte initialization vector (IV),
followed by a 16 byte authenticated encryption (AE) tag, followed by the
encrypted data:
2021-02-28 12:32:56 +03:00
.. list-table ::
* - `` MAGIC: [u8; 8] ``
* - `` CRC32: [u8; 4] ``
2021-08-02 15:36:07 +03:00
* - `` IV: [u8; 16] ``
2021-02-28 12:32:56 +03:00
* - `` TAG: [u8; 16] ``
* - `` Data: (max 16MiB) ``
2021-02-28 13:12:31 +03:00
.. _fixed-index-format:
2021-02-28 13:25:22 +03:00
Fixed Index Format (`` .fidx `` )
-------------------------------
2021-02-28 13:12:31 +03:00
All numbers are stored as little-endian.
.. list-table ::
* - `` MAGIC: [u8; 8] ``
- `` [47, 127, 65, 237, 145, 253, 15, 205] ``
* - `` uuid: [u8; 16] `` ,
- Unique ID
* - `` ctime: i64 `` ,
- Creation Time (epoch)
* - `` index_csum: [u8; 32] `` ,
2021-10-27 17:19:27 +03:00
- SHA-256 over the index (without header) `` SHA256(digest1||digest2||...) ``
2021-02-28 13:12:31 +03:00
* - `` size: u64 `` ,
- Image size
* - `` chunk_size: u64 `` ,
- Chunk size
* - `` reserved: [u8; 4016] `` ,
2021-10-27 17:19:27 +03:00
- Overall header size is one page (4096 bytes)
2021-02-28 13:12:31 +03:00
* - `` digest1: [u8; 32] ``
2021-10-27 17:19:27 +03:00
- First chunk digest
2021-02-28 13:12:31 +03:00
* - `` digest2: [u8; 32] ``
2021-10-27 17:19:27 +03:00
- Second chunk digest
2021-02-28 13:12:31 +03:00
* - ...
2021-10-27 17:19:27 +03:00
- Next chunk digest ...
2021-02-28 13:12:31 +03:00
.. _dynamic-index-format:
2021-02-28 13:25:22 +03:00
Dynamic Index Format (`` .didx `` )
--------------------------------
2021-02-28 13:12:31 +03:00
All numbers are stored as little-endian.
.. list-table ::
* - `` MAGIC: [u8; 8] ``
- `` [28, 145, 78, 165, 25, 186, 179, 205] ``
* - `` uuid: [u8; 16] `` ,
- Unique ID
* - `` ctime: i64 `` ,
- Creation Time (epoch)
* - `` index_csum: [u8; 32] `` ,
2021-10-27 17:19:27 +03:00
- SHA-256 over the index (without header) `` SHA256(offset1||digest1||offset2||digest2||...) ``
2021-02-28 13:12:31 +03:00
* - `` reserved: [u8; 4032] `` ,
- Overall header size is one page (4096 bytes)
* - `` offset1: u64 ``
- End of first chunk
* - `` digest1: [u8; 32] ``
2021-10-27 17:19:27 +03:00
- First chunk digest
2021-02-28 13:12:31 +03:00
* - `` offset2: u64 ``
- End of second chunk
* - `` digest2: [u8; 32] ``
2021-10-27 17:19:27 +03:00
- Second chunk digest
2021-02-28 13:12:31 +03:00
* - ...
2021-10-27 17:19:27 +03:00
- Next chunk offset/digest