Về bài này
Tóm lược & hệ thống hóa toàn bộ Proxmox Backup Documentation — Release 4.2.0-1 (17 chương + phụ lục) thành hướng dẫn thực hành tiếng Việt. Mọi lệnh, đường dẫn, tên tham số, số liệu yêu cầu đều giữ nguyên bản gốc. Cấu trúc: Phần I hiểu bản chất → Phần II làm được việc (cài đặt · kết nối · vận hành). PBS 4.x nền Debian 13 "Trixie".
PHẦN I — Nói về Proxmox Backup
Bản chất, kiến trúc client-server, 12 tính năng, lý do backup, software stack (Rust), hỗ trợ & giấy phép.
1. Proxmox Backup Server là gì & Kiến trúc
Proxmox Backup Server (PBS) là giải pháp backup enterprise-class theo mô hình client–server, dùng để sao lưu máy ảo (VM), container và physical host. Được tối ưu đặc biệt cho nền tảng Proxmox Virtual Environment (PVE), cho phép sao lưu an toàn kể cả giữa các site từ xa, quản trị dễ dàng qua web interface. Hỗ trợ deduplication, compression và authenticated encryption (AE). Phần lớn được viết bằng Rust để đạt hiệu năng cao, dùng ít tài nguyên, mã nguồn an toàn & chất lượng. Mọi giao tiếp client–server đều qua TLS; dữ liệu có thể được mã hóa phía client trước khi gửi đi → an toàn ngay cả với target không đáng tin.
Mô hình client–server
Server
Lưu trữ dữ liệu backup và cung cấp API để tạo/quản lý datastore. API cũng cho phép quản lý đĩa và các tài nguyên phía server. Luôn cần server — không thể dùng PBS mà thiếu phần server.
Client
Dùng API để truy cập dữ liệu đã backup. Có công cụ CLI proxmox-backup-client để tạo/khôi phục file backup; ngoài ra có client tích hợp sẵn cho QEMU & LXC trong Proxmox VE.
Cấu trúc backup: Một backup có thể chứa nhiều archive. Ví dụ khi backup một VM, mỗi disk được lưu thành một archive riêng, cấu hình VM lưu thành file riêng → dễ truy cập & khôi phục đúng phần cần thiết mà không phải quét toàn bộ backup.
2. Các tính năng chính (Main Features)
Support for Proxmox VE
Hỗ trợ đầy đủ PVE — backup VM & container dễ dàng.
Performance
Toàn bộ stack viết bằng Rust → tốc độ cao, tiết kiệm bộ nhớ.
Deduplication
Loại bỏ dữ liệu trùng lặp giữa các lần backup định kỳ → giảm tối đa dung lượng.
Incremental Backups
Chỉ đọc & gửi phần delta thay đổi → giảm tải storage & network.
Data Integrity
Thuật toán checksum SHA-256 đảm bảo tính chính xác & nhất quán.
Remote Sync
Đồng bộ hiệu quả tới site từ xa — chỉ truyền delta chứa dữ liệu mới.
Compression
Zstandard (zstd) siêu nhanh — nén nhiều GB dữ liệu mỗi giây.
Encryption
Mã hóa phía client bằng AES-256 GCM (authenticated encryption); cộng thêm TLS khi truyền.
Tape Backup
Hỗ trợ mạnh backup ra tape & quản lý tape library cho lưu trữ dài hạn.
Ransomware Protection
Access control chi tiết, kiểm tra tính toàn vẹn, offsite qua sync & tape.
Web Interface
Quản trị qua giao diện web tích hợp.
Open Source · No Limits
Mã nguồn mở AGPLv3, không giới hạn nhân tạo về dung lượng hay số client.
Enterprise Support: Proxmox Server Solutions GmbH cung cấp hỗ trợ qua các Subscription Plan. Mọi mức subscription đều truy cập được Proxmox Backup Enterprise Repository; gói Basic/Standard/Premium còn có Customer Portal với thời gian phản hồi cam kết.
3. Vì sao cần backup · Software Stack · Hỗ trợ · Giấy phép
Lý do phải backup dữ liệu
- Mục đích chính: chống mất dữ liệu do hỏng phần cứng hoặc lỗi con người (xóa nhầm file/VM — ảo hóa khiến việc xóa cả VM dễ như bấm nút).
- Là bộ công cụ hữu ích để lưu tạm dữ liệu; thông lệ: full backup trước khi cài update lớn → có sự cố thì rollback.
- Yêu cầu pháp lý: một số dữ liệu (đặc biệt hồ sơ doanh nghiệp) phải lưu an toàn trong nhiều năm.
- Mất dữ liệu rất tốn kém → backup định kỳ VÀ chạy restore test thường xuyên.
Software Stack
PBS gồm nhiều thành phần:
- Server daemon: cung cấp RESTful API, tác vụ bất đồng bộ siêu nhanh, thu thập thống kê nhẹ, lập lịch, tách bạch nghiêm ngặt môi trường thực thi có/không đặc quyền.
- Web interface quản trị bằng JavaScript.
- CLI quản trị server: proxmox-backup-manager
- CLI phía client: proxmox-backup-client (chạy trên mọi môi trường Linux amd64).
Ngoài web interface, phần lớn PBS viết bằng Rust → tốc độ & hiệu quả bộ nhớ, kiểm soát chi tiết mức thấp (như quản lý bộ nhớ) mà vẫn an toàn.
Getting Help
- Enterprise Support: gói Basic/Standard/Premium → Customer Portal (phản hồi cam kết). Liên hệ [email protected].
- Community Forum: diễn đàn cộng đồng, có support team kiểm duyệt.
- Mailing Lists: kênh chính cho developer (dự án open-source, hoan nghênh đóng góp).
- Bug Tracker: https://bugzilla.proxmox.com — báo bug/feature/enhancement.
License & History
- Giấy phép GNU AGPL v3 (© 2019–2025 Proxmox Server Solutions GmbH).
- Tiền thân: công cụ vzdump của PVE — chỉ full backup, nặng nề với VM lớn.
- 10/2018 khởi động dự án (chọn Rust); 07/2020 beta đầu tiên; 11/2020 bản stable đầu tiên (có encryption, incremental, dedup).
PHẦN II — Yêu cầu & Hướng dẫn chi tiết
Cài đặt → kết nối → vận hành từng bước: yêu cầu, USB, installer, repo, datastore, RBAC, backup/restore, tape, sync, prune/GC/verify, ZFS, cert, network, notifications, kỹ thuật & FAQ.
4. Yêu cầu hệ thống (System Requirements)
Khuyến nghị dùng phần cứng server chất lượng cao khi chạy production. Để giảm rủi ro khi một host hỏng, có thể thiết lập đồng bộ datastore incremental định kỳ giữa các PBS instance với nhau.
Tối thiểu (chỉ để đánh giá)
⚠ Không dùng cho production
- CPU: 64-bit (x86-64 / AMD64), 2 core+
- RAM: 2 GB
- Đĩa cứng: > 8 GB trống
- Card mạng (NIC)
Khuyến nghị (production)
- CPU: Intel/AMD 64-bit hiện đại, ≥ 4 core
- RAM: tối thiểu 4 GiB cho OS + cache + daemon, cộng thêm ≥ 1 GiB / 1 TiB dung lượng storage
- OS storage: ≥ 32 GiB trống; dùng hardware RAID có BBU hoặc ZFS redundant
- Backup storage: ưu tiên IOPS cao — enterprise SSD tốt nhất; nếu HDD thì rất nên có ZFS special device (metadata cache) dạng mirror
- Network: NIC Multi-Gbit/s dự phòng (redundant)
Cảnh báo: ZFS đặt trên bất kỳ hardware RAID nào đều KHÔNG được hỗ trợ và có thể gây mất dữ liệu. Dùng ZFS thì cho đĩa ở chế độ HBA/IT-mode.
Trình duyệt hỗ trợ web GUI: Firefox (bản trong năm hoặc ESR mới nhất), Chrome (bản trong năm), Microsoft Edge (bản đang hỗ trợ), Safari (bản trong năm).
5. Chuẩn bị bộ cài (Installation Medium)
Tải ISO tại https://www.proxmox.com/downloads. ISO là hybrid image: vừa ghi ra DVD, vừa copy ra USB (khuyến nghị — nhanh & sẵn có). USB cần ≥ 2 GB.
KHÔNG dùng UNetbootin (không tương thích). Toàn bộ dữ liệu trên USB sẽ bị ghi đè — sao lưu trước, và unmount USB trước khi ghi. Chọn nhầm đĩa = mất dữ liệu, hãy kiểm tra dung lượng khớp USB trước khi ghi.
GNU/Linux — dd
# Tìm đúng tên thiết bị USB: lsblk # chạy trước & sau khi cắm USB # Hoặc so sánh output dmesg # Ghi ISO ra USB (cần quyền root): dd bs=1M conv=fdatasync \ if=./proxmox-backup-server_*.iso \ of=/dev/XYZ
Thay /dev/XYZ bằng tên đúng — cực kỳ cẩn thận.
macOS
# Convert ISO → DMG: hdiutil convert proxmox-*.iso \ -format UDRW -o proxmox.dmg diskutil list # tìm /dev/diskX diskutil unmountDisk /dev/diskX sudo dd if=proxmox.dmg bs=1M \ of=/dev/rdiskX
Dùng rdiskX (nhanh hơn diskX).
Windows
- Etcher (etcher.io): chạy ngay, chọn ISO & USB.
- Rufus (rufus.ie): bấm Start → chọn No khi hỏi tải Grub khác → chọn DD mode.
Sau khi có USB: cắm vào server, vào firmware bật boot từ USB (PBS < 3.1 phải tắt Secure Boot).
6. Cài đặt Server bằng Installer (khuyến nghị)
ISO gồm: installer (phân vùng đĩa với ext4/xfs/ZFS + cài OS), Debian Linux 64-bit, Proxmox kernel có ZFS, toàn bộ toolset & web GUI. Dữ liệu trên đĩa đích sẽ bị ghi đè; installer không thêm menu boot cho OS khác.
Menu boot của bộ cài
| Mục | Ý nghĩa |
|---|---|
| Install PBS (Graphical) | Cài bình thường. Mẹo: dùng bàn phím — ALT + ký tự gạch chân của nút (vd ALT+N = Next). |
| Install PBS (Console) | Wizard chế độ terminal — tương thích tốt hơn với phần cứng rất cũ/rất mới. |
| Install PBS (Terminal UI, Serial Console) | Như trên + dùng cổng serial đầu tiên cho I/O (máy headless chỉ có serial console). |
| Advanced → Debug Mode | Mở console tại nhiều bước để gỡ lỗi; thoát console bằng CTRL-D. Có thể dùng để sửa ZFS rpool degraded hay bootloader. |
| Advanced → Rescue Boot | Boot bản cài hiện có bằng kernel từ ISO khi lỗi bootloader/BIOS. |
| Advanced → Test Memory (memtest86+) | Kiểm tra RAM (phải tắt Secure Boot trong UEFI mới chạy được). |
8 bước trong wizard
EULA
Đọc & chấp nhận thỏa thuận người dùng cuối.
Chọn đĩa đích (Target Disk)
Mặc định dùng cả server & xóa hết dữ liệu → chắc chắn không còn dữ liệu quan trọng.
Filesystem & Advanced Options
Nút Options chọn filesystem: mặc định ext4 (dùng LVM), xfs (LVM), hoặc ZFS (có software RAID cho hệ không có RAID controller — chọn đĩa trong Options). Xem thêm LVM/ZFS options bên dưới.
Location · Time Zone · Keyboard
Location dùng chọn download server gần → update nhanh. Thường tự nhận diện.
Root Password & Email
Mật khẩu ≥ 8 ký tự (khuyến nghị ≥ 12, gồm hoa/thường/số/ký tự đặc biệt). Email nhận thông báo (update, lỗi cron...).
Network Configuration
NIC đang UP có chấm đầy trước tên. Khi cài chỉ đặt được IPv4 HOẶC IPv6 (không cả hai) — dual-stack thì thêm IP sau khi cài.
Summary
Rà soát lại mọi thiết lập, dùng Previous nếu cần sửa.
Install & Reboot
Installer format đĩa & copy gói (vài phút). Xong thì rút USB & khởi động lại (thường tự động sau vài giây). Lỗi cài? Xem TTY2 bằng CTRL+ALT+F2.
LVM options (ext4/xfs)
Tạo VG pbs + LV root, swap.
- hdsize: tổng dung lượng đĩa được dùng (chừa trống để phân vùng thêm).
- swapsize: mặc định = RAM, tối thiểu 4 GB, tối đa 8 GB, không quá hdsize/8; đặt 0 để không tạo swap.
- minfree: dung lượng để trống trong VG pbs — mặc định 16 GB (nếu >128GB) hoặc hdsize/8 (nếu ≤128GB).
ZFS options (pool rpool)
Không tạo swap (có thể tạo zvol sau — dễ gặp vấn đề).
- ashift: bằng sector-size đĩa (2^ashift = sector-size).
- compress, checksum, copies: bật nén / thuật toán checksum / số bản sao (không thay redundancy mức đĩa).
- hdsize: chỉ áp dụng cho đĩa bootable (đĩa/mirror đầu với RAID0/1/10; mọi đĩa với RAID-Z).
Tip RAM cho ZFS: 4GB + 1GB/1TB raw. ZIL (write cache) trên SSD: zpool add <pool> log </dev/ssd>.
Sau khi cài & reboot — truy cập web GUI
Trỏ trình duyệt tới https://<IP>:8007 (vd https://pbs.yourdomain.tld:8007). Đăng nhập user root, realm Linux PAM standard authentication, mật khẩu đã đặt. Sau đó: upload subscription key (để dùng Enterprise repo) hoặc cấu hình public repo; kiểm tra lại IP/hostname/timezone.
7. Cài trên Debian · Proxmox VE · Unattended · Client
Trên Debian có sẵn
# Sau khi cấu hình repo (mục 8): apt update # Gói tối thiểu (giữ kernel Debian): apt install proxmox-backup-server # HOẶC như installer (kernel Proxmox + ZFS): apt install proxmox-backup
Web GUI: https://<ip>:8007. Lưu ý: base/local storage/network phải tự cấu hình đúng (không tầm thường với LVM/ZFS).
Trên Proxmox VE
apt update apt install proxmox-backup-server
KHÔNG khuyến nghị cài backup server ngay trên hypervisor. An toàn hơn là server vật lý riêng — hypervisor hỏng vẫn truy cập được backup.
Unattended
Cài tự động bare-metal qua answer file (có filter chọn đĩa/NIC); sau đó dùng Ansible cấu hình tiếp. Chuẩn bị ISO theo hướng dẫn wiki.
Cài Backup Client (Debian & bản static)
# Sau khi cấu hình repo client (mục 8): apt update apt install proxmox-backup-client # Bản static — chạy trên mọi Linux x86-64 hiện đại, có thể copy sang máy non-Debian: apt install proxmox-backup-client-static
Bản static xung đột với gói thường (cùng file /usr/bin/proxmox-backup-client).
8. Debian Package Repositories (APT)
Cấu hình trong /etc/apt/sources.list hoặc file .list/.sources trong /etc/apt/sources.list.d/. Hai định dạng: single-line (file .list) và deb822 (file .sources, nhiều stanza). Debian Trixie khuyến nghị dùng deb822 — hiện đại hóa bằng apt modernize-sources.
① Enterprise (khuyến nghị production — cần subscription)
# /etc/apt/sources.list.d/pbs-enterprise.sources Types: deb URIs: https://enterprise.proxmox.com/debian/pbs Suites: trixie Components: pbs-enterprise Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
Ổn định nhất; báo email cho root@pam khi có gói mới. Tắt bằng thêm dòng Enabled: false.
② No-Subscription (test/non-prod, không cần key)
# /etc/apt/sources.list.d/proxmox.sources Types: deb URIs: http://download.proxmox.com/debian/pbs Suites: trixie Components: pbs-no-subscription Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
Không cần subscription; gói chưa test kỹ như Enterprise → không khuyến nghị production.
③ Test (mới nhất — dev)
# thêm stanza vào proxmox.sources Types: deb URIs: http://download.proxmox.com/debian/pbs Suites: trixie Components: pbs-test Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
④ Client-only (máy Linux non-Proxmox)
# Debian 13 Trixie — /etc/apt/sources.list.d/pbs-client.sources Types: deb URIs: http://download.proxmox.com/debian/pbs-client Suites: trixie Components: main Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg # Debian 12/11/10 (single-line .list): # deb http://download.proxmox.com/debian/pbs-client bookworm main
SecureApt — cài verification key (khi cài trên Debian)
# Tải & cài key cho bản Proxmox nền Trixie: wget https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg \ -O /usr/share/keyrings/proxmox-archive-keyring.gpg # Kiểm tra checksum: sha256sum /usr/share/keyrings/proxmox-archive-keyring.gpg # = 136673be77aba35dcce385b28737689ad64fd785a797e57897589aed08db6e45 md5sum /usr/share/keyrings/proxmox-archive-keyring.gpg # = 77c8b1166d15ce8350102ab1bca2fcbf
Cài từ ISO thì key có sẵn. Path phải khớp dòng Signed-By: trong stanza. Sau khi gói proxmox-archive-keyring quản lý file này, checksum có thể thay đổi (bình thường — đừng sửa tay).
Sau proxy HTTP: vào Configuration → Authentication đặt HTTP proxy dạng [http://]<host>[:port] (có thể kèm auth: http://user:[email protected]:12345) — dùng cho cả apt & kiểm tra subscription. Ngoài ra cần thêm Debian base repo (debian.sources: suites trixie, trixie-updates, trixie-security).
9. Thuật ngữ (Terminology)
Backup Content — các loại nội dung trong 1 backup
| Thành phần | Mô tả |
|---|---|
| <name>.img (Image Archive) | Backup dạng block/ổ đĩa (VM images). Dùng chunk cố định kích thước. |
| <name>.pxar (File Archive) | Proxmox File Archive — backup dạng file/thư mục (container, host files). Dùng chunk động. |
| BLOBs (Binary Data) | Dữ liệu nhị phân nhỏ (vd file cấu hình), có thể nén & mã hóa. |
| catalog.pcat1 | Catalog — "mục lục" nội dung archive để duyệt/tìm nhanh khi restore. |
| index.json (Manifest) | Danh sách toàn bộ archive trong backup + checksum + kích thước. |
- Backup Namespace: "thư mục ảo" tách biệt trong 1 datastore để tránh trùng tên & phân quyền chi tiết, vẫn dùng chung chunk store (dedup toàn datastore). Lồng tối đa 8 cấp.
- Backup Type: vm (máy ảo QEMU), ct (container LXC), host (file trên host vật lý).
- Backup ID: định danh nhóm (vd VMID 100, hoặc tên host).
- Backup Time: thời điểm backup, định dạng RFC3339 UTC (vd 2022-01-01T00:01:00Z).
- Backup Group: <type>/<id> — tất cả snapshot của một VM/CT/host (vd vm/100).
- Backup Snapshot: một lần backup cụ thể — <type>/<id>/<time> (vd vm/100/2022-01-01T00:01:00Z).
10. Giao diện Web (Graphical User Interface)
GUI xây trên ExtJS 6.x, chạy trên TLS, hỗ trợ nhiều realm xác thực & đa ngôn ngữ. Đăng nhập tại https://<ip>:8007. Có thể bật Consent Banner (văn bản cảnh báo trước đăng nhập) tại Configuration → Other → General → Consent Text (lưu base64 trong /etc/proxmox-backup/node.cfg).
Dashboard
Tổng quan hoạt động, dùng phần cứng, tasks, thông tin subscription, nút Show Fingerprint.
Configuration
Access Control, Remotes, S3 Endpoints, Traffic Control, Certificates, Encryption Keys, Notifications, Subscription.
Administration
Server Status, Services, Updates, Repositories, Syslog, Tasks, Disks (Directory & ZFS).
Tape Backup
Content, Inventory, Changers, Drives, Media Pools, Encryption Keys, Backup Jobs.
Datastore
Mỗi datastore có: Summary, Content, Prune & GC, Sync Jobs, Verify Jobs, Options, Permissions.
Login
Chọn realm (PAM/PBS/LDAP/AD), hỗ trợ 2FA. Ticket phiên có hạn ~2 giờ.
11. Backup Storage — Disk Management & Datastore
11.1 Quản lý đĩa
# Liệt kê đĩa & xem SMART: proxmox-backup-manager disk list proxmox-backup-manager disk smart-attributes sdX # Khởi tạo GPT: proxmox-backup-manager disk initialize sdX # Tạo filesystem ext4 + thêm luôn thành datastore: proxmox-backup-manager disk fs create store1 --disk sdX \ --filesystem ext4 --add-datastore true # Tạo ZFS pool (mirror): proxmox-backup-manager disk zpool create zpool1 \ --devices sdX,sdY --raidlevel mirror
11.2 Datastore
Datastore là nơi lưu backup, cấu hình tại /etc/proxmox-backup/datastore.cfg. Bên trong có file .lock và thư mục .chunks/ (các thư mục hex 0000–ffff chứa chunk). Filesystem phải chịu được ≥ 65.538 thư mục con (2¹⁶ chunk namespace + . & ..).
# Tạo datastore (GUI: Datastore → Add Datastore): proxmox-backup-manager datastore create store1 /backup/disk1/store1 proxmox-backup-manager datastore list proxmox-backup-manager datastore show store1 # Đặt lịch Garbage Collection: proxmox-backup-manager datastore update store1 --gc-schedule 'Tue 04:27'
Removable Datastore (ổ rời)
# mount tại /mnt/datastore/<name> proxmox-backup-manager datastore \ unmount store1
S3 Backend (đám mây)
... s3 endpoint create my-s3-ep \ --access-key '...' --secret-key '...' \ --region eu-central-1 ... datastore create my-s3 /mnt/.../cache \ --backend type=s3,client=my-s3-ep,bucket=...
Namespaces & Tuning options
# Di chuyển group / namespace giữa các namespace: proxmox-backup-client group move <type>/<id> --ns <src> --target-ns <dst> --repository <repo> # Tuning datastore (hiệu năng/an toàn ghi): proxmox-backup-manager datastore update store1 \ --tuning 'sync-level=filesystem,chunk-order=inode'
| Tham số tuning | Giá trị & ý nghĩa |
|---|---|
| chunk-order | inode (mặc định, đọc theo thứ tự inode — nhanh trên HDD) / none. |
| sync-level | none / filesystem (mặc định) / file — mức đảm bảo dữ liệu xuống đĩa. |
| gc-cache-capacity | Số slot LRU cache cho GC — mặc định 1.048.576, tối đa 8.388.608. |
| default-verification-workers / -readers | Mặc định 4 luồng verify / 1 luồng đọc. |
12. Chống Ransomware & Phục hồi (chuẩn 3-2-1)
Quy tắc 3-2-1
3 bản sao dữ liệu · 2 loại media khác nhau · 1 bản off-site. PBS hỗ trợ off-site qua Remote Sync và Tape Backup.
Built-in Protection
PBS không ghi đè block đã tồn tại → chunk cũ được bảo toàn, không bị mã hóa lại.
- Access management chặt: mỗi host/cluster dùng API token riêng, cấp quyền tối thiểu (vd chỉ trên /datastore/tank/pve-abc-cluster). Sync job cấu hình không xóa snapshot khi nguồn biến mất.
- Ransomware Detection: restore test định kỳ + verify job kiểm tra checksum SHA-256.
- Best practices: cập nhật firmware/phần mềm (vá Spectre/Meltdown); mạng an toàn (logging, monitoring, VLAN); giữ backup dài hạn (nhiều tuần/tháng) để tránh ransomware ngủ đông chỉ còn bản đã nhiễm.
13. User · API Token · RBAC · 2FA · Realm
User lưu tại /etc/proxmox-backup/user.cfg. Superuser mặc định là root@pam. Có 5 realm: pam, pbs (Proxmox Backup auth server), openid, ldap, ad (Active Directory).
# Tạo user & API token: proxmox-backup-manager user create john@pbs --email [email protected] proxmox-backup-manager user generate-token john@pbs client1 # → tạo token id john@pbs!client1 ; SECRET chỉ hiện MỘT LẦN, lưu ngay! # Gán quyền (ACL) & xem quyền hiệu lực: proxmox-backup-manager acl update /datastore/store1 DatastoreBackup --auth-id john@pbs proxmox-backup-manager acl list proxmox-backup-manager user permissions john@pbs
Access Roles (14 vai trò dựng sẵn)
| Role | Quyền |
|---|---|
| Admin / NoAccess / Audit | Toàn quyền / chặn hết / chỉ xem. |
| DatastoreAdmin | Toàn quyền trên datastore (tạo/xóa/backup/restore/prune). |
| DatastoreBackup | Backup & restore backup mà mình sở hữu. |
| DatastoreReader | Xem & restore (read-only). |
| DatastorePowerUser / DatastoreAudit | Backup+xem theo group / chỉ xem cấu hình & nội dung. |
| RemoteAdmin / RemoteSyncOperator / RemoteAudit | Quản lý remote / chạy sync kéo về / xem remote. |
| TapeAdmin / TapeOperator / TapeReader / TapeAudit | Quản trị tape / vận hành (không sửa cấu hình) / đọc & restore / chỉ xem. |
Two-Factor Authentication
Hỗ trợ TOTP, WebAuthn/FIDO2, Recovery Keys, YubiKey OTP. Khóa (lockout): 8 lần sai TOTP, 100 lần sai FIDO2 → mở khóa qua CLI.
Realm LDAP / Active Directory
Cấu hình bind-dn, base-dn, server; đồng bộ user bằng proxmox-backup-manager ldap sync / ad sync.
14. Backup Client — vận hành backup/restore (CLI)
14.1 Repository & biến môi trường
Định dạng repo: [[user@]server[:port]:]datastore (vd root@[email protected]:8007:store1). Đặt sẵn để khỏi gõ lại:
export PBS_REPOSITORY="root@[email protected]:store1" export PBS_PASSWORD="..." # mật khẩu / secret token export PBS_FINGERPRINT="64:d3:ff:..." # vân tay cert server export PBS_ENCRYPTION_PASSWORD="..." # mật khẩu key mã hóa
14.2 Tạo backup · loại trừ · mã hóa
# Backup thư mục thành file archive (.pxar) — kiểu host: proxmox-backup-client backup root.pxar:/ --repository store1 # Backup ổ đĩa dạng block (.img) & nhiều archive cùng lúc: proxmox-backup-client backup data.img:/dev/sdb etc.pxar:/etc # Loại trừ file/thư mục: dùng .pxarexclude hoặc --exclude # .pxarexclude hỗ trợ glob: * ** ? [] ! (phủ định) / (neo thư mục) # Change Detection Mode (backup file): legacy | data | metadata # metadata: chỉ đọc lại file có metadata đổi → nhanh nhất (tách mpxar/ppxar)
# Mã hóa phía client AES-256-GCM — tạo key rồi backup có --keyfile: proxmox-backup-client key create ./enc.key # key mặc định: ~/.config/proxmox-backup/encryption-key.json proxmox-backup-client backup root.pxar:/ --keyfile ./enc.key --crypt-mode encrypt # Master key (RSA) — thu hồi/khôi phục key mã hóa; in paperkey (QR) để cất giữ: proxmox-backup-client key create-master-key proxmox-backup-client key paperkey ./enc.key --output-format text
14.3 Khôi phục · mount · quản lý
# Liệt kê snapshot & restore: proxmox-backup-client snapshot list proxmox-backup-client restore host/mymachine/2024-01-01T00:00:00Z root.pxar /target/ # restore ra stdout dùng dấu - (vd đổ vào ổ đĩa) # Restore tương tác (catalog shell): cd, ls, find, restore-selected, restore --pattern proxmox-backup-client catalog shell <snapshot> root.pxar # Mount archive qua FUSE (đọc trực tiếp không cần restore hết): proxmox-backup-client mount <snapshot> root.pxar /mnt/xxx # Prune (giữ theo chính sách) · GC · benchmark · đổi chủ sở hữu: proxmox-backup-client prune host/mymachine --keep-daily 7 --keep-weekly 4 --dry-run proxmox-backup-client garbage-collect proxmox-backup-client benchmark proxmox-backup-client change-owner host/mymachine john@pbs
Ticket đăng nhập giữ ~2 giờ (login/logout thủ công). prune chỉ xóa metadata snapshot — chunk chỉ bị xóa sau garbage collection. Đặt snapshot protected update ... true để khóa snapshot khỏi bị prune.
15. Tích hợp Proxmox VE (kết nối PBS làm storage)
Qua Web UI của PVE
Datacenter → Storage → Add → Proxmox Backup Server. Nhập: ID, Server (IP PBS), Datastore, Username (vd root@pam), Password, Fingerprint cert. Sau đó backup VM/CT chọn storage này.
Qua CLI của PVE
pvesm add pbs my-pbs \ --server 192.168.1.10 \ --datastore store1 \ --username root@pam \ --password \ --fingerprint 64:d3:ff:...
Lấy fingerprint trên PBS: proxmox-backup-manager cert info | grep Fingerprint hoặc Dashboard → Show Fingerprint.
16. Công cụ dòng lệnh pxar
pxar tạo & thao tác archive định dạng Proxmox File Archive (độc lập, không cần server).
# Tạo archive (loại trừ theo pattern kiểu gitignore): pxar create archive.pxar /source --exclude '*.tmp' # Giải nén (có thể chỉ 1 phần với --pattern / --files-from): pxar extract archive.pxar /target --pattern 'etc/**' # Liệt kê nội dung & mount: pxar list archive.pxar pxar mount archive.pxar /mnt/point
17. Tape Backup (lưu trữ dài hạn)
Chuẩn LTO (Ultrium): bền ~30 năm, ~12 TB/cartridge, media "nguội" cất off-site được, có sẵn engine mã hóa AES-GCM phần cứng. Hỗ trợ LTO-5 trở lên (LTO-4 best-effort). PBS dùng driver tape riêng viết bằng Rust — không dùng driver tape của kernel Linux. LTO-8 đọc/ghi tới ~360 MB/s (đầy 1 tape 12TB tối thiểu ~9 giờ). Dữ liệu PBS đã nén nên không bật nén của tape.
LTO-9+: media mới phải Media Optimization lần đầu (40–120 phút/tape). Format lần đầu dùng proxmox-tape format --drive your-drive --fast 0 (chậm, xóa sạch + tối ưu media). Luôn dùng path bền /dev/tape/by-id/ (tránh /dev/sg0 đổi sau reboot).
Quick Start & cấu hình
# 1) Cấu hình phần cứng (changer nếu có library, rồi drive): proxmox-tape changer scan proxmox-tape changer create sl3 --path /dev/tape/by-id/scsi-CC2C52 proxmox-tape drive scan proxmox-tape drive create mydrive --path /dev/tape/by-id/scsi-12345-sg proxmox-tape drive update mydrive --changer sl3 --changer-drivenum 0 # 2) Tạo media pool (allocation + retention): proxmox-tape pool create daily proxmox-tape pool update daily --allocation daily --retention 7days # 3) Dán nhãn tape (standalone hoặc cả library): proxmox-tape label --changer-id <label> --pool daily proxmox-tape barcode-label --pool daily # 4) Tạo & chạy backup job: proxmox-tape backup-job create job2 --store vmstore1 --pool daily --drive mydrive --schedule daily proxmox-tape backup-job run job2
| Khái niệm | Ý nghĩa |
|---|---|
| Media Pool | Nhóm tape logic; định allocation policy (job được ghi nối bao lâu) & retention policy (giữ dữ liệu bao lâu). |
| Media Set | Nhóm tape ghi liên tục — đơn vị restore cơ bản; cần đủ mọi tape trong set để restore (dedup rải khắp set). |
| Allocation | continue (1 set lớn, tiết kiệm, restore chậm) / always (mỗi job 1 set mới) / Calendar Event (vd weekly). |
| Retention | overwrite / thời hạn (vd 2 weeks) / keep (không ghi đè — dùng cho WORM). |
Mã hóa · Restore · Disaster Recovery
# Tạo/khôi phục key mã hóa tape (mật khẩu → khôi phục được key): proxmox-tape key create --hint "tape pw 2020" proxmox-tape key restore # nạp lại key từ tape # Xem nội dung & restore cả media set (hoặc 1 snapshot): proxmox-tape media content proxmox-tape restore <media-set-uuid> mystore # Restore catalog từ tape khi mất DB: proxmox-tape catalog
Disaster Recovery: cài PBS mới → tạo datastore (Administration → Storage/Disks) → thêm changer & drive (proxmox-tape drive/changer scan) → nạp tape, Restore Catalog qua Inventory → Content → Restore chọn media set/snapshot → chọn drive & datastore đích. WORM: dùng pool retention keep, đặt tên & pool riêng, không trộn với tape thường.
18. Remote & Sync Jobs (nhân bản off-site)
Remote = một PBS khác + user; lưu tại /etc/proxmox-backup/remote.cfg. Sync Job mặc định kéo (pull) nội dung remote về local (có thể đẩy — push). Chỉ truyền delta → hiệu quả cho offsite (chuẩn 3-2-1).
# Thêm remote (lấy fingerprint từ remote trước): proxmox-backup-manager cert info | grep Fingerprint # chạy trên remote proxmox-backup-manager remote create pbs2 --host pbs2.mydomain.example \ --auth-id sync@pam --password 'SECRET' --fingerprint 64:d3:ff:... # Tạo & chạy sync job (pull): proxmox-backup-manager sync-job create pbs2-local --remote pbs2 \ --remote-store local --store local --schedule 'Wed 02:30' proxmox-backup-manager sync-job run pbs2-local # Xóa snapshot đã biến mất ở remote · giới hạn băng thông: ... sync-job update <id> --remove-vanished --rate-in 20MiB
- Group filter: --group-filter type:ct, group:vm/100, regex:'^vm/1\d{2,3}$', hoặc exclude:regex:....
- Namespace: --remote-ns, --ns, --max-depth (0 = không đệ quy). Tự tạo/xóa namespace theo scope.
- --worker-threads 1–32 (mặc định 1) — song song hóa nhiều group, tốt cho đường trễ cao.
- Push: cần remote hỗ trợ namespace (≥ v2.2); nội dung đẩy thuộc sở hữu user cấu hình trên remote → dùng remote + user riêng cho mỗi push job.
- Encrypt/Decrypt khi sync: gán --active-encryption-key (push, mã hóa snapshot chưa mã hóa) hoặc --associated-key (pull, giải mã / xoay vòng key).
- Quyền: pull cần Remote.Read + Datastore.Backup (thêm Datastore.Prune nếu remove-vanished).
19. Bảo trì: Prune · Garbage Collection · Verify
19.1 Pruning (giữ lại theo chính sách)
Prune chỉ xóa metadata snapshot (chunk vẫn còn tới khi GC chạy). Các tùy chọn xử lý theo thứ tự:
| Tùy chọn | Giữ lại |
|---|---|
| keep-last N | N snapshot gần nhất. |
| keep-hourly/daily/weekly N | N giờ/ngày/tuần gần nhất (mỗi mốc giữ bản mới nhất). Tuần theo ISO (Mon→Sun). |
| keep-monthly/yearly N | N tháng/năm gần nhất (mỗi mốc giữ bản mới nhất). |
Ví dụ retention 10 năm (backup hằng ngày): keep-last 3 · keep-daily 13 · keep-weekly 8 · keep-monthly 11 · keep-yearly 9. Có Prune Simulator trong GUI để thử. Tạo Prune Job: GUI tab Prune & GC → Add hoặc proxmox-backup-manager prune-job create.
19.2 Garbage Collection (giải phóng dung lượng)
GC theo cơ chế mark & sweep 2 pha: Mark đọc mọi index, cập nhật atime chunk đang dùng; Sweep xóa chunk có atime cũ hơn mốc (mốc = writer backup cũ nhất, hoặc 24h05m trước khi GC chạy). Grace period 24 giờ (do relatime). Khuyến nghị lịch hằng tuần.
proxmox-backup-manager garbage-collection start store1 proxmox-backup-manager garbage-collection status store1 # Đặt/huỷ lịch: proxmox-backup-manager datastore update store1 --gc-schedule 'daily' proxmox-backup-manager datastore update store1 --delete gc-schedule
19.3 Verification
proxmox-backup-manager verify store1 \ --read-threads 1 --verify-threads 4 \ --ignore-verified false
Kiểm tra SHA-256. Nên có job re-verify hằng tháng để phát hiện bit rot. Threads 1–32.
19.4 Maintenance Mode
# read-only | offline proxmox-backup-manager datastore \ update store1 --maintenance-mode offline
Chặn read/write mới, cho tác vụ đang chạy hoàn tất → an toàn khi bảo trì storage.
20. Host System: ZFS · Bootloader · Certificate · Metrics
PBS dựa trên Debian → mọi thao tác quản trị Debian đều áp dụng.
20.1 ZFS on Linux
# Tạo pool & dataset, xem trạng thái: zpool create -f -o ashift=12 <pool> mirror /dev/sdX /dev/sdY zpool status ; zfs create <pool>/data ; zfs set compression=lz4 <pool> # Giới hạn ARC (RAM) — vd 8 GiB, đặt trong /etc/modprobe.d/zfs.conf: options zfs zfs_arc_max=8589934592 # 8 * 2^30 = 8 GiB
Thêm cache/log device: zpool add <pool> log <ssd> / cache <ssd>. RAM nên có ~4GB + 1GB/1TB raw. HDD datastore rất nên có special device mirror chứa metadata.
20.2 Host Bootloader
# Đồng bộ ESP, quản lý kernel: proxmox-boot-tool status proxmox-boot-tool refresh proxmox-boot-tool kernel list proxmox-boot-tool kernel pin <ver>
Phân vùng: BIOS Boot + ESP + storage. Bootloader: systemd-boot (ZFS) hoặc Grub. Hỗ trợ Secure Boot (PBS ≥ 3.1).
20.3 Certificate (ACME/Let's Encrypt)
# Mặc định self-signed; hoặc dùng ACME # Configuration → Certificates → ACME # challenge http-01 hoặc dns-01 (wildcard) # tự động gia hạn; hoặc upload cert tùy chỉnh proxmox-backup-manager cert info
Cert API/SMTP: /etc/proxmox-backup/proxy.pem.
20.4 Metrics & Daemons & CLI tools
External metric server: InfluxDB (HTTP & UDP plugin). Daemon: proxmox-backup-proxy (nghe TCP 8007) & proxmox-backup (nội bộ 127.0.0.1:82).
| CLI tool | Chức năng |
|---|---|
| proxmox-backup-client | Tạo/khôi phục backup phía client. |
| proxmox-backup-manager | Quản trị server (datastore, user, sync, GC, network, cert...). |
| proxmox-tape · pmt · pmtx | Quản lý tape / điều khiển drive / điều khiển changer mức thấp. |
| pxar · proxmox-file-restore | Thao tác archive / khôi phục file lẻ từ backup. |
| proxmox-backup-debug | Chẩn đoán & khôi phục khi không có PBS đang chạy (inspect file/chunk, recover). |
21. Network Management & Traffic Control
# Cấu hình interface/bond/VLAN/bridge (GUI hoặc CLI), rồi apply: proxmox-backup-manager network create vmbr0 --type bridge ... proxmox-backup-manager network changes # xem thay đổi đang chờ proxmox-backup-manager network reload # áp dụng # Traffic Control — giới hạn băng thông theo mạng & khung giờ (Token Bucket): proxmox-backup-manager traffic-control create rule0 \ --network 192.168.1.0/24 --rate-in 50MiB --rate-out 50MiB --timeframe 'mon..fri 8-17'
Đổi tên thiết bị mạng cố định: file systemd .link hoặc proxmox-network-interface-pinning generate.
22. Notifications (thông báo)
Mô hình: Events → Matchers → Targets. Sự kiện (gc, prune, sync, verification, tape-backup, package-updates, acme...) khớp matcher (theo calendar / field / severity) rồi gửi tới target.
Targets
Sendmail, SMTP, Gotify, Webhook (templating Handlebars: helper url-encode, escape, json).
Matchers & Mode
Khớp calendar/field (exact/regex)/severity. Mode: mặc định vs legacy-sendmail. Ghi đè template tại /etc/proxmox-backup/notification-templates/default/. System mail chuyển tiếp về email root.
23. Kỹ thuật: Chunk & Deduplication hoạt động thế nào
Datastore cấu trúc <root>/<type>/<id>/<time>/. Dữ liệu chia thành chunk, snapshot chỉ tham chiếu chunk (index) → nhiều snapshot dùng lại chunk giống nhau = deduplication.
Fixed-Sized Chunks
Cho block/VM image (~4 MiB).
Dynamically Sized
Cho file — rolling hash (Buzhash) tìm ranh giới chunk → chèn/xóa file vẫn dedup tốt.
Encrypted Chunks
Digest theo SHA-256 của plaintext + key; verify chunk mã hóa chỉ dùng CRC-32.
Restore không cần PBS đang chạy: dùng proxmox-backup-debug inspect file/chunk và ... recover để dựng lại dữ liệu trực tiếp từ chunk store.
24. FAQ (Câu hỏi thường gặp)
PBS dựa trên distro nào? Chạy 32-bit được không?
Dựa trên Debian Linux. Không chạy CPU 32-bit — chỉ 64-bit (x86-64/AMD64).
Client hỗ trợ nền tảng nào?
Các bản Linux hiện đại (amd64). Có bản statically linked chạy trên mọi Linux x86-64 hiện đại.
Backup là full, incremental hay dedup?
Cả ba: mỗi backup vừa là "full" (khôi phục độc lập), vừa incremental (chỉ gửi delta) & deduplicated (dùng lại chunk) nhờ kiến trúc chunk store.
Có kiểm tra được tính toàn vẹn? Có phải tin remote server không?
Có — verify bằng SHA-256. Không cần tin remote nếu mã hóa phía client (dữ liệu mã hóa trước khi rời máy) + TLS khi truyền.
Nâng cấp point release / major release & đồng bộ datastore đi nơi khác?
Point release: apt update && apt full-upgrade. Major release: theo hướng dẫn upgrade chính thức. Copy/đồng bộ datastore sang nơi khác bằng Sync Job giữa các PBS.
✅ Checklist triển khai tổng hợp
- 1Kiểm tra yêu cầu phần cứng (≥4 core, ≥4 GiB + 1 GiB/TiB, SSD/ZFS special device). Không ZFS trên hardware RAID.
- 2Tạo USB (dd/Etcher/Rufus DD mode) → cài Server bằng installer (ext4/xfs/ZFS) → truy cập https://IP:8007.
- 3Cấu hình repository (Enterprise nếu có sub, hoặc No-Subscription) + SecureApt → apt update.
- 4Tạo datastore (disk → GPT → fs/ZFS → datastore). Cân nhắc namespace & tuning.
- 5Tạo user + API token, gán role (DatastoreBackup...), bật 2FA cho tài khoản quản trị.
- 6Kết nối: thêm PBS làm storage trong Proxmox VE (fingerprint) hoặc dùng proxmox-backup-client. Bật mã hóa client-side.
- 7Lập lịch Prune + GC (hằng tuần) + Verify (hằng tháng). Thiết lập Sync offsite và/hoặc Tape (chuẩn 3-2-1).
- 8Cấu hình Notifications (email/SMTP), cert ACME, và chạy restore test định kỳ. Xong!
Nguồn: Toàn bộ nội dung tóm lược & hệ thống hóa từ Proxmox Backup Documentation — Release 4.2.0-1 (Proxmox Support Team). Tham khảo tài liệu gốc & phụ lục A (cú pháp lệnh đầy đủ) / phụ lục B (file cấu hình) để tra cứu chi tiết mọi tham số.