0

我有一个 2 驱动器 RAID1 BTFS 设置。/dev/sda 给我错误和超时。由于超时,平衡单人花费了太长时间。

我还没有替代品,但我想让系统可用,直到驱动器到达邮局。

我想要:

  • 余额为单身,或
  • 挂载读写

但我也不知道该怎么做。

安装两个驱动器后,它看起来像这样:

# btrfs fi show
Label: 'DATA'  uuid: cd9cb7cf-7343-4331-af7a-66e65eae8aea
    Total devices 2 FS bytes used 83.51GiB
    devid    1 size 931.51GiB used 77.01GiB path /dev/sda
    devid    2 size 931.51GiB used 77.01GiB path /dev/sdb

以下是错误:


# btrfs device stats /data
[/dev/sda].write_io_errs    0
[/dev/sda].read_io_errs     153
[/dev/sda].flush_io_errs    0
[/dev/sda].corruption_errs  0
[/dev/sda].generation_errs  0
[/dev/sdb].write_io_errs    0
[/dev/sdb].read_io_errs     0
[/dev/sdb].flush_io_errs    0
[/dev/sdb].corruption_errs  0
[/dev/sdb].generation_errs  0

但我无法删除错误设备

# btrfs device delete /dev/sda /data
ERROR: error removing device '/dev/sda': unable to go below two devices on raid1

所以我卸载它并让它消失:

# umount /data
# echo 1 | tee /sys/block/sda/device/delete
1
# ls /dev/sd*
/dev/sdb  /dev/sdc  /dev/sdc1

然后重新安装它。我需要以降级的方式重新挂载它,因为否则 btrfs 会抱怨它缺少驱动器,所以我这样做了,但是我得到“由于缺少太多设备,不允许可写挂载”

# mount -t btrfs /dev/sdb /data -o degraded
mount: /data: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.

dmesg
[ 1785.390430] BTRFS info (device sdb): flagging fs with big metadata feature
[ 1785.390434] BTRFS info (device sdb): allowing degraded mounts
[ 1785.390436] BTRFS info (device sdb): disk space caching is enabled
[ 1785.390438] BTRFS info (device sdb): has skinny extents
[ 1785.393150] BTRFS warning (device sdb): devid 1 uuid cf63f5e6-fe55-4741-80a7-49ee2e3e45d1 is missing
[ 1785.396331] BTRFS info (device sdb): bdev /dev/sda errs: wr 0, rd 153, flush 0, corrupt 0, gen 0
[ 1785.403412] BTRFS warning (device sdb): chunk 248063721472 missing 1 devices, max tolerance is 0 for writable mount
[ 1785.403414] BTRFS warning (device sdb): writable mount is not allowed due to too many missing devices
[ 1785.476657] BTRFS error (device sdb): open_ctree failed

所以我以只读方式安装

# mount -t btrfs /dev/sdb /data -o degraded

一切看起来都不错

# btrfs fi show  --all-devices
warning, device 1 is missing
Label: 'DATA'  uuid: cd9cb7cf-7343-4331-af7a-66e65eae8aea
    Total devices 2 FS bytes used 83.51GiB
    devid    2 size 931.51GiB used 77.01GiB path /dev/sdb
    *** Some devices missing

但我无法移除设备,或重新平衡为单一设备,因为它是只读的:

# btrfs device remove 1 /data
ERROR: error removing devid 1: Read-only file system

# btrfs balance start -mconvert=single -dconvert=single /data
ERROR: error during balancing '/data': Read-only file system
There may be more info in syslog - try dmesg | tail
keith@zoomer:~$ uname -a
Linux zoomer 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
keith@zoomer:~$ btrfs --version
btrfs-progs v5.4.1
4

0 回答 0