差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
btrfs [2018/12/28 23:06] jz |
btrfs [2023/06/11 01:10] (目前版本) jz |
||
---|---|---|---|
行 20: | 行 20: | ||
</code> | </code> | ||
- | ===== Device ===== | + | ===== Create Raid1 ===== |
<code> | <code> | ||
btrfs fi show | btrfs fi show | ||
btrfs device add /dev/xxx / | btrfs device add /dev/xxx / | ||
btrfs balance start -dconvert=raid1 -mconvert=raid1 / | btrfs balance start -dconvert=raid1 -mconvert=raid1 / | ||
+ | </code> | ||
+ | |||
+ | ===== Replace ===== | ||
+ | Replace | ||
+ | <code> | ||
+ | echo 1 | sudo tee /sys/block/sdb/device/delete | ||
+ | btrfs filesystem show /mountpoint | ||
+ | btrfs replace start -B <devid> /dev/new-disk /mountpoint | ||
+ | btrfs replace status /mountpoint | ||
+ | iostat -d 1 -m <target-dev> | ||
+ | </code> | ||
+ | |||
+ | Balance | ||
+ | <code> | ||
+ | btrfs fi usage -T /mountpoint | ||
+ | btrfs device usage /mountpoint | ||
+ | btrfs filesystem balance | ||
+ | </code> | ||
+ | |||
+ | Replace and Disable reading from failed disk | ||
+ | <code> | ||
+ | btrfs replace start -r 5 /dev/nvme0n5 /mnt/raid10/ | ||
</code> | </code> | ||
http://www.moocowproductions.org/2014/12/04/fully-online-raid1-to-raid10-migration-using-btrfs/ | http://www.moocowproductions.org/2014/12/04/fully-online-raid1-to-raid10-migration-using-btrfs/ | ||
+ | https://wiki.tnonline.net/w/Btrfs/Replacing_a_disk |