{"id":467749,"date":"2025-07-19T21:00:05","date_gmt":"2025-07-19T21:00:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=467749"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=467749","title":{"rendered":"<span>\u041a\u0430\u043a \u044f \u0434\u0435\u043b\u0430\u044e \u0431\u0435\u043a\u0430\u043f\u044b \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Linux: \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e rsync + btrfs \u0441 zstd \u0441\u0436\u0430\u0442\u0438\u0435\u043c<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0411\u0435\u043a\u0430\u043f\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u0436\u043d\u043e &#8212; \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0431\u0435\u043a\u0430\u043f\u044b, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041c\u043d\u043e\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u0443\u0436\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0432\u044b \u0431\u0443\u0434\u044c\u0442\u0435 \u0443\u043c\u043d\u0435\u0435.<\/p>\n<p>\u041c\u043e\u0439 <a href=\"https:\/\/gitlab.com\/vitaly-zdanevich\/full-backup\/-\/blob\/master\/full-backup.sh?ref_type=heads\" rel=\"noopener noreferrer nofollow\">\u0441\u043a\u0440\u0438\u043f\u0442<\/a>:<\/p>\n<pre><code class=\"bash\"># Start this script from the git folder of this script # This script accept path to the partition to backup (mounted) # Use this script NOT from the system you want to backup - boot from another system  if [ -z \"$1\" ]; then echo \"Missing path of the source (what to backup)\" exit 1 fi  BEFORE=$(df -h)  STARTED=$(date)  DATE=`date \"+%Y-%m-%d\"`  p=$(pwd)  cd $1 # Because rsync --exclude-from accepts only relative pathes, not absolute  rsync --archive --acls --xattrs --delete --progress --verbose --exclude-from=$p\/exclude.txt --filter=':- .gitignore' --link-dest=$p\/last --mkpath $1 $p\/$DATE  ln --symbolic --force --no-dereference $DATE last  echo \"Started at:   \" $STARTED echo \"Current time: \" $(date)  echo \"Before:  $BEFORE  Now: \"  df -h  cd -  # How to restore: # # rsync --archive --acls --xattrs --progress --verbose &lt;from&gt; &lt;to&gt; # \/etc\/fstab: alter UUID # grub install (if new SSD) https:\/\/wiki.gentoo.org\/wiki\/Grub: #     grub-install # Note that if SSD is more than 2 GB - you cannot use MBR, only GPT with EFI partition (Thinkpag T430 supports UEFI boot) # emerge-webrsync # emerge --sync guru   # Documentation: # https:\/\/jumpcloud.com\/blog\/how-to-backup-linux-system-rsync # https:\/\/wiki.archlinux.org\/title\/rsync<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 &#8212; \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043d\u0435\u0442, \u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c) \u043d\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hard_link\" rel=\"noopener noreferrer nofollow\">\u0445\u0430\u0440\u0434\u043b\u0438\u043d\u043a\u043e\u0432<\/a> \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0431\u0435\u043a\u0430\u043f\u0430 &#8212; \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f &#8212; \u043c\u0435\u0441\u0442\u0430 \u0432 \u043d\u043e\u0432\u043e\u043c \u0431\u0435\u043a\u0430\u043f\u0435 \u043e\u043d \u043d\u0435 \u0437\u0430\u0439\u043c\u0451\u0442 &#8212; \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0435\u043a\u0430\u043f\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b, \u043d\u043e \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0445\u0430\u0440\u0434\u043b\u0438\u043d\u043a\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0431\u0435\u043a\u0430\u043f\u0430. \u0425\u0430\u0440\u0434\u043b\u0438\u043d\u043a\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u042d\u0442\u043e \u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u043f\u043e\u0434 \u0441\u043b\u043e\u0432\u043e\u043c &#171;\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e&#187;.<\/p>\n<p>\u0418\u0437 <a href=\"https:\/\/linux.die.net\/man\/1\/rsync\" rel=\"noopener noreferrer nofollow\">man<\/a>:<\/p>\n<blockquote>\n<p>&#8212;link-dest=DIR\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 hardlink to files in DIR when unchanged<\/p>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043c\u0435\u0441\u0442\u0430 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 &#8212; \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0431\u0435\u043a\u0430\u043f\u0438\u0442\u044c \u043a\u0435\u0448 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043c\u043e\u0439 <strong>exclude.txt:<\/strong><\/p>\n<pre><code>dev\/* proc\/* sys\/* run\/* # \u0415\u0441\u043b\u0438 \u0432\u0441\u0451-\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0440\u0430\u043d\u044c\u0448\u0435 \u044f \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u043b  var\/db\/repos\/gentoo var\/db\/repos\/guru var\/cache\/distfiles\/  tmp\/* var\/tmp  lost+found mnt\/*  home\/vitaly\/.npm\/ home\/vitaly\/.cache\/  home\/vitaly\/.zoom\/  home\/vitaly\/.mozilla\/firefox\/*\/storage home\/vitaly\/.config\/google-chrome\/ home\/vitaly\/.config\/chromium\/ home\/vitaly\/.config\/Microsoft\/Microsoft Teams\/ home\/vitaly\/.config\/teams-for-linux\/ home\/vitaly\/.config\/Slack\/ home\/vitaly\/.thumbnails\/  home\/vitaly\/.cache\/ home\/vitaly\/.local\/share\/TelegramDesktop\/tdata\/user_data\/cache\/ home\/vitaly\/.local\/share\/TelegramDesktop\/tdata\/user_data\/media_cache\/ home\/vitaly\/.local\/share\/Steam\/ home\/vitaly\/.googleearth\/Cache\/ home\/vitaly\/.local\/share\/OMaps\/ home\/vitaly\/.config\/Audius\/Cache\/ home\/vitaly\/.config\/YandexMusic\/Cache\/ home\/vitaly\/.config\/vesktop\/sessionData\/Cache\/ home\/vitaly\/.config\/bilibili\/Cache\/ home\/vitaly\/.local\/share\/Trash\/  home\/vitaly\/go\/pkg\/mod\/cache\/ home\/vitaly\/.cargo\/registry\/  home\/vitaly\/record\/out\/  home\/vitaly\/Desktop\/unreal-5-4-4\/<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0438\u0437 .gitignore \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u043f\u043a\u0438.<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <code>df -h<\/code> \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 &#8212; \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442\u0430 \u0437\u0430\u043d\u044f\u043b \u0431\u0435\u043a\u0430\u043f.<\/p>\n<p>\u0411\u0435\u043a\u0430\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b; \u043d\u0443 \u0438\u043b\u0438 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e &#8212; \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0435\u0434\u044c \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u0430 \u0438\u0445 \u0431\u0435\u043a\u0430\u043f\u0438\u0442\u044c \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442.<\/p>\n<p>\u0411\u0435\u043a\u0430\u043f\u043b\u044e \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u044b\u0439 HDD \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Btrfs\" rel=\"noopener noreferrer nofollow\">BTRFS<\/a> &#8212; \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/btrfs.readthedocs.io\/en\/latest\/Compression.html\" rel=\"noopener noreferrer nofollow\">ZSTD<\/a> \u0441\u0436\u0430\u0442\u0438\u0435.<\/p>\n<pre><code>sudo apt install btrfs-progs -y # https:\/\/details.nl\/install-and-use-btrfs-on-ubuntu-20-04-lts  sudo mkfs.btrfs \/dev\/sdX # Partitions are not needed  sudo mount -o compress-force=zstd:15 \/dev\/sdX \/mnt # Max compression level is 15 # \u0414\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0441\u0436\u0430\u0442\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 fstab<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0431\u0435\u043a\u0430\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0436\u0430\u043b\u043e\u0441\u044c:<\/p>\n<pre><code>sudo apt install btrfs-compsize sudo compsize \/mnt<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<pre><code>   Processed 54036 files, 42027 regular extents (42028 refs), 27150 inline.    Type       Perc     Disk Usage   Uncompressed Referenced    TOTAL       73%      211G         289G         289G    zstd        28%       42M         148M         148M    none       100%      174G         174G         174G<\/code><\/pre>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0442\u0443\u0442 <code>Perc<\/code> &#8212; \u0447\u0435\u043c \u043d\u0438\u0436\u0435 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<p>\u0414\u043b\u044f <a href=\"https:\/\/gitlab.com\/vitaly-zdanevich-configs\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> &#8212; \u0438 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u043b\u044f \u0431\u0435\u043a\u0430\u043f\u0430 \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0417\u043d\u0430\u044e \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0431\u0435\u043a\u0430\u043f\u0430, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043a\u0430 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u043a\u0430\u043f \u0447\u0435\u0440\u0435\u0437 rsync \u0432 btrfs \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0436\u0430\u0442\u0438\u0435\u043c.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/929182\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0435\u043a\u0430\u043f\u0430 \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">87.5% <\/span><span class=\"tm-article-poll__answer-label\">\u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/span><span class=\"tm-article-poll__answer-votes\">7<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 87.5%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">12.5% <\/span><span class=\"tm-article-poll__answer-label\">\u041f\u043b\u043e\u0445\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 (\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043b\u0443\u0447\u0448\u0435)<\/span><span class=\"tm-article-poll__answer-votes\">1<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 12.5%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 8 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 12 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/929182\/\"> https:\/\/habr.com\/ru\/articles\/929182\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0411\u0435\u043a\u0430\u043f\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u0436\u043d\u043e &#8212; \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0431\u0435\u043a\u0430\u043f\u044b, \u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0435\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041c\u043d\u043e\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u0443\u0436\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u0432\u044b \u0431\u0443\u0434\u044c\u0442\u0435 \u0443\u043c\u043d\u0435\u0435.<\/p>\n<p>\u041c\u043e\u0439 <a href=\"https:\/\/gitlab.com\/vitaly-zdanevich\/full-backup\/-\/blob\/master\/full-backup.sh?ref_type=heads\" rel=\"noopener noreferrer nofollow\">\u0441\u043a\u0440\u0438\u043f\u0442<\/a>:<\/p>\n<pre><code class=\"bash\"># Start this script from the git folder of this script # This script accept path to the partition to backup (mounted) # Use this script NOT from the system you want to backup - boot from another system  if [ -z \"$1\" ]; then echo \"Missing path of the source (what to backup)\" exit 1 fi  BEFORE=$(df -h)  STARTED=$(date)  DATE=`date \"+%Y-%m-%d\"`  p=$(pwd)  cd $1 # Because rsync --exclude-from accepts only relative pathes, not absolute  rsync --archive --acls --xattrs --delete --progress --verbose --exclude-from=$p\/exclude.txt --filter=':- .gitignore' --link-dest=$p\/last --mkpath $1 $p\/$DATE  ln --symbolic --force --no-dereference $DATE last  echo \"Started at:   \" $STARTED echo \"Current time: \" $(date)  echo \"Before:  $BEFORE  Now: \"  df -h  cd -  # How to restore: # # rsync --archive --acls --xattrs --progress --verbose &lt;from&gt; &lt;to&gt; # \/etc\/fstab: alter UUID # grub install (if new SSD) https:\/\/wiki.gentoo.org\/wiki\/Grub: #     grub-install # Note that if SSD is more than 2 GB - you cannot use MBR, only GPT with EFI partition (Thinkpag T430 supports UEFI boot) # emerge-webrsync # emerge --sync guru   # Documentation: # https:\/\/jumpcloud.com\/blog\/how-to-backup-linux-system-rsync # https:\/\/wiki.archlinux.org\/title\/rsync<\/code><\/pre>\n<p>\u0422\u0443\u0442 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (\u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 &#8212; \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043d\u0435\u0442, \u0447\u0442\u0435\u043d\u0438\u0435\/\u0437\u0430\u043f\u0438\u0441\u044c) \u043d\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hard_link\" rel=\"noopener noreferrer nofollow\">\u0445\u0430\u0440\u0434\u043b\u0438\u043d\u043a\u043e\u0432<\/a> \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0431\u0435\u043a\u0430\u043f\u0430 &#8212; \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f &#8212; \u043c\u0435\u0441\u0442\u0430 \u0432 \u043d\u043e\u0432\u043e\u043c \u0431\u0435\u043a\u0430\u043f\u0435 \u043e\u043d \u043d\u0435 \u0437\u0430\u0439\u043c\u0451\u0442 &#8212; \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u0431\u0435\u043a\u0430\u043f\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b, \u043d\u043e \u0447\u0430\u0441\u0442\u044c \u0438\u0437 \u043d\u0438\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0445\u0430\u0440\u0434\u043b\u0438\u043d\u043a\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0431\u0435\u043a\u0430\u043f\u0430. \u0425\u0430\u0440\u0434\u043b\u0438\u043d\u043a\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b. \u042d\u0442\u043e \u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u043f\u043e\u0434 \u0441\u043b\u043e\u0432\u043e\u043c &#171;\u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e&#187;.<\/p>\n<p>\u0418\u0437 <a href=\"https:\/\/linux.die.net\/man\/1\/rsync\" rel=\"noopener noreferrer nofollow\">man<\/a>:<\/p>\n<blockquote>\n<p>&#8212;link-dest=DIR\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 hardlink to files in DIR when unchanged<\/p>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043c\u0435\u0441\u0442\u0430 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 &#8212; \u043c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0431\u0435\u043a\u0430\u043f\u0438\u0442\u044c \u043a\u0435\u0448 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043c\u043e\u0439 <strong>exclude.txt:<\/strong><\/p>\n<pre><code>dev\/* proc\/* sys\/* run\/* # \u0415\u0441\u043b\u0438 \u0432\u0441\u0451-\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0440\u0430\u043d\u044c\u0448\u0435 \u044f \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u043b  var\/db\/repos\/gentoo var\/db\/repos\/guru var\/cache\/distfiles\/  tmp\/* var\/tmp  lost+found mnt\/*  home\/vitaly\/.npm\/ home\/vitaly\/.cache\/  home\/vitaly\/.zoom\/  home\/vitaly\/.mozilla\/firefox\/*\/storage home\/vitaly\/.config\/google-chrome\/ home\/vitaly\/.config\/chromium\/ home\/vitaly\/.config\/Microsoft\/Microsoft Teams\/ home\/vitaly\/.config\/teams-for-linux\/ home\/vitaly\/.config\/Slack\/ home\/vitaly\/.thumbnails\/  home\/vitaly\/.cache\/ home\/vitaly\/.local\/share\/TelegramDesktop\/tdata\/user_data\/cache\/ home\/vitaly\/.local\/share\/TelegramDesktop\/tdata\/user_data\/media_cache\/ home\/vitaly\/.local\/share\/Steam\/ home\/vitaly\/.googleearth\/Cache\/ home\/vitaly\/.local\/share\/OMaps\/ home\/vitaly\/.config\/Audius\/Cache\/ home\/vitaly\/.config\/YandexMusic\/Cache\/ home\/vitaly\/.config\/vesktop\/sessionData\/Cache\/ home\/vitaly\/.config\/bilibili\/Cache\/ home\/vitaly\/.local\/share\/Trash\/  home\/vitaly\/go\/pkg\/mod\/cache\/ home\/vitaly\/.cargo\/registry\/  home\/vitaly\/record\/out\/  home\/vitaly\/Desktop\/unreal-5-4-4\/<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0438\u0437 .gitignore \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u043f\u043a\u0438.<\/p>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <code>df -h<\/code> \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 &#8212; \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442\u0430 \u0437\u0430\u043d\u044f\u043b \u0431\u0435\u043a\u0430\u043f.<\/p>\n<p>\u0411\u0435\u043a\u0430\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b; \u043d\u0443 \u0438\u043b\u0438 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e &#8212; \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0435\u0434\u044c \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u0430 \u0438\u0445 \u0431\u0435\u043a\u0430\u043f\u0438\u0442\u044c \u0441\u043c\u044b\u0441\u043b\u0430 \u043d\u0435\u0442.<\/p>\n<p>\u0411\u0435\u043a\u0430\u043f\u043b\u044e \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u044b\u0439 HDD \u043e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Btrfs\" rel=\"noopener noreferrer nofollow\">BTRFS<\/a> &#8212; \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/btrfs.readthedocs.io\/en\/latest\/Compression.html\" rel=\"noopener noreferrer nofollow\">ZSTD<\/a> \u0441\u0436\u0430\u0442\u0438\u0435.<\/p>\n<pre><code>sudo apt install btrfs-progs -y # https:\/\/details.nl\/install-and-use-btrfs-on-ubuntu-20-04-lts  sudo mkfs.btrfs \/dev\/sdX # Partitions are not needed  sudo mount -o compress-force=zstd:15 \/dev\/sdX \/mnt # Max compression level is 15 # \u0414\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0441\u0436\u0430\u0442\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 fstab<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0431\u0435\u043a\u0430\u043f\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u0436\u0430\u043b\u043e\u0441\u044c:<\/p>\n<pre><code>sudo apt install btrfs-compsize sudo compsize \/mnt<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<pre><code>   Processed 54036 files, 42027 regular extents (42028 refs), 27150 inline.    Type       Perc     Disk Usage   Uncompressed Referenced    TOTAL       73%      211G         289G         289G    zstd        28%       42M         148M         148M    none       100%      174G         174G         174G<\/code><\/pre>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u0442\u0443\u0442 <code>Perc<\/code> &#8212; \u0447\u0435\u043c \u043d\u0438\u0436\u0435 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<p>\u0414\u043b\u044f <a href=\"https:\/\/gitlab.com\/vitaly-zdanevich-configs\" rel=\"noopener noreferrer nofollow\">\u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0430\u043c\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e git \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439<\/a> &#8212; \u0438 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u043b\u044f \u0431\u0435\u043a\u0430\u043f\u0430 \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0417\u043d\u0430\u044e \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0431\u0435\u043a\u0430\u043f\u0430, \u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u043a\u0430 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e &#8212; \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0431\u0435\u043a\u0430\u043f \u0447\u0435\u0440\u0435\u0437 rsync \u0432 btrfs \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0436\u0430\u0442\u0438\u0435\u043c.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/929182\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0431\u0435\u043a\u0430\u043f\u0430 \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">87.5% <\/span><span class=\"tm-article-poll__answer-label\">\u0425\u043e\u0440\u043e\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/span><span class=\"tm-article-poll__answer-votes\">7<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 87.5%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">12.5% <\/span><span class=\"tm-article-poll__answer-label\">\u041f\u043b\u043e\u0445\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 (\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043b\u0443\u0447\u0448\u0435)<\/span><span class=\"tm-article-poll__answer-votes\">1<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 12.5%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 8 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.   \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 12 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/929182\/\"> https:\/\/habr.com\/ru\/articles\/929182\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-467749","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=467749"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/467749\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=467749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=467749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=467749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}