顯示具有 rsync 標籤的文章。 顯示所有文章
顯示具有 rsync 標籤的文章。 顯示所有文章

2025/08/17

almalinux 10 出來一段時間了
想說來升級一下
依照官方的步驟



出現四個問題

Upgrade has been inhibited due to the following problems:
    1. Detected XFS filesystems incompatible with target kernel.
    2. Current x86-64 microarchitecture is unsupported in RHEL10
    3. Deprecated DHCP plugin configured

解決方法

第4點

ifcfg-* files located in /etc/sysconfig/network-scripts/
檔案裡要加上

第3點

sed -i'.bak' 's/^dhcp=dhclient//g' /usr/lib/NetworkManager/conf.d/10-dhcp-dhclient.conf

第2點

rhel 10 cpu 硬体最低支援是 x86-64-v3

檢查 cpu 支援指令

/usr/lib64/ld-linux-x86-64.so.2 --help

Subdirectories of glibc-hwcaps directories, in priority order:
  x86-64-v4
  x86-64-v3 (supported, searched)
  x86-64-v2 (supported, searched)

第1點

Title: Detected XFS filesystems incompatible with target kernel.
Summary: XFS v4 format has been deprecated and it has been removed from the target k
ernel. Such filesystems cannot be mounted by target system kernel and so the upgrade
 cannot proceed successfully. Following XFS filesystems have v4 format:
    - /
    - /home
Related links:
    - Backing up an XFS file system: https://red.ht/rhel-9-xfs-backup
    - Restoring an XFS file system from backup: https://red.ht/rhel-9-xfs-restore-fr
om-backup
Remediation: [hint] Migrate XFS v4 filesystems to new XFS v5 format. For filesystems
 hosting data, perform a back up, reformat, and restore procedure. Refer to official
 documentation for details. For filesystems hosting the system a clean installation
is recommended instead.

由於這台是centos 7 升上來的 所以 xfs 是 v4
如果要再升到almalinux 10 必須要升到 xfs v5
如何檢查 xfs是 v4 還是 v5


If the output is crc=0, it's a v4 filesystem. If it's crc=1, you have a v5 filesystem.


無法直接升級 只能備分 mkfs.xfs 再匯回資料

 rsync -avxHAX --progress /data/ /mnt/backup/data_backup/

umount /data

mkfs.xfs /dev/vda1

mount -t xfs /dev/vda1 /data

rsync -avxHAX --progress  /mnt/backup/data_backup/ /data/

2024/09/24

最近要在win上複制 一千五百萬多萬筆的小檔
試過
teracopy
fastcopy
robocopy
copy
cp
效能都很差
rsync
tar -T 
也跑不太出來
目前感覺上用 tar 好像好一點

改用 parallel 最多設定 252

2024/09/16

之前換nas的時侯發生 filesystem有問題的情況
使用 xfs_repair 修完後 出現有user的mail不見的情況
當時是使用 PhotoRec 撈了好几天 把資料還給user 
而且也無法確認是否完整

這几天在使用rsync 備分 /home 時 
出現好几次做到一半就會卡住的情況
看了一下才發現竟然出現 超級大檔案 

-rw-------  1 user mailnull 9007199254766339 Aug  4  2023 1691146737.V811I2821a77dbM603030.mail:2,S

只能砍了
而且砍完就正常了
反正就一邊做一邊發現問題一邊砍

2018/01/28

最近因為有大檔案同步的需求
所以找了二個解決方案 rsync bigsync
同時試了一下
樣本都是一個49G的檔案 來源目的都一樣
直接上數据

rsync

sent 49,088,096,429 bytes  received 35 bytes  95,039,876.99 bytes/sec
total size is 49,076,114,830  speedup is 1.00

real    8m36.099s
user    3m35.524s
sys     1m17.008s

bigsync

Total read = 45.706 Gb
Total write = 45.706 Gb
Total blocks changed = 3121
Elapsed 10m13s

看起來rsync還是快一點

另外bigsync可以調整每次處理的block大小

順便貼一下數据

500M

Total read = 45.706 Gb
Total write = 45.706 Gb
Total blocks changed = 94
Elapsed 10m32s

1000M

Total read = 45.706 Gb
Total write = 45.706 Gb
Total blocks changed = 47
Elapsed 10m30s

看起來和default 15M並沒有什麼差別

再來看一下如果檔案有小變化時 二方的結果
這次測一個10G的檔

rsync

sent 10,876,360,204 bytes  received 35 bytes  65,718,188.76 bytes/sec
total size is 10,873,705,357  speedup is 1.00

real    2m44.831s
user    0m48.460s
sys     0m18.184s

看來rsync並不會把檔案切割計算

bigsync

Total read = 10.127 Gb
Total write = 4 Mb
Total blocks changed = 1
Elapsed 1m33s

結論 

如果需求是每次都要同步全新的檔 用 rsync比較快

如果目的檔案已存在 只要同步差異處 用bigsync 可以節省比較多時間


https://rsync.samba.org/
https://github.com/egorFiNE/bigsync

2013/08/10

在rsync大量資料時
如几百G或上T
常常會有中斷的情況
此時就需要使用續傳
指令如下

rsync -avzP   /src          /dst
                  原目錄  目的目錄

http://my.huhoo.net/archives/2008/12/rsync.html

2012/12/16

如果要使用ssh來rsync又不想產生key
可以使用sshpass

http://www.cyberciti.biz/faq/noninteractive-shell-script-ssh-password-provider/

2012/09/25

移机時使用rsync -av 可以保留檔案的 使用者及權限的屬性

2012/05/06

為了要備份mail
選擇使用rsync
但因為資料資料將近1T
而且都是小檔案(maildir格式)
一開始要全部rsync時總會做到一半就斷了
只好再次rsync
前後好几次
終於完成第一次全部的rsync
接下來每次只要rsync異動的部分
約半小時
使用crontab每天二點來做

指令如下

if [ -d /mnt/mail ]; then

        #echo "ok"
        /usr/bin/rsync -av --delete --size-only /home /mnt/mail > /root/rsync_log
fi

使用if來check的原因是為了避免如果nas沒mount到
會把/mnt塞爆

2012/05/02


今天測了一下rsync
參數不管怎麼下
結果好像都差不多

time rsync -v -u --inplace /var/lib/vz/images/204/vm-204-disk.qcow2 /mnt/pve/nfs_49/dns_dos/
vm-204-disk.qcow2

sent 5921015635 bytes  received 31 bytes  43061932.12 bytes/sec
total size is 5920292864  speedup is 1.00

real    2m16.284s
user    0m47.094s
sys     0m22.522s

=======================================================================

 time rsync -avy /var/lib/vz/images/204/vm-204-disk.qcow2 /mnt/pve/nfs_49/dns_dos/
sending incremental file list
vm-204-disk.qcow2

sent 5921015639 bytes  received 31 bytes  37593750.29 bytes/sec
total size is 5920292864  speedup is 1.00

real    2m37.259s
user    0m49.275s
sys     0m24.471s

=======================================================================

time rsync -av /var/lib/vz/images/204/vm-204-disk.qcow2 /mnt/pve/nfs_49/dns_dos/
sending incremental file list
vm-204-disk.qcow2

sent 5921015639 bytes  received 31 bytes  41844633.71 bytes/sec
total size is 5920292864  speedup is 1.00

real    2m20.808s
user    0m45.490s
sys     0m21.791s