我有一个旧硬盘,我想检查其中的内容。我认为它以前可能是 BTRFS raid1 设置的一部分,现在被更大的驱动器取代。
当我将其与 USB 适配器连接时,我得到:
usb 7-2: new high-speed USB device number 27 using xhci_hcd
usb 7-2: New USB device found, idVendor=13fd, idProduct=0840
usb 7-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 7-2: Product: External
usb 7-2: Manufacturer: Generic
usb 7-2: SerialNumber: 57442D5743414E5532323536
usb-storage 7-2:1.0: USB Mass Storage device detected
scsi host16: usb-storage 7-2:1.0
checking bus 7, device 27: "/sys/devices/pci0000:00/0000:00:15.2/0000:05:00.0/usb7/7-2"
bus: 7, device: 27 was not an MTP device
scsi 16:0:0:0: Direct-Access Generic External 1.14 PQ: 0 ANSI: 4
sd 16:0:0:0: Attached scsi generic sg5 type 0
sd 16:0:0:0: [sdf] 976773167 512-byte logical blocks: (500 GB/465 GiB)
sd 16:0:0:0: [sdf] Write Protect is off
sd 16:0:0:0: [sdf] Mode Sense: 23 00 00 00
sd 16:0:0:0: [sdf] No Caching mode page found
sd 16:0:0:0: [sdf] Assuming drive cache: write through
sd 16:0:0:0: [sdf] Attached SCSI disk
和
fdisk -l
Disk /dev/sdf: 465,8 GiB, 500107861504 bytes, 976773167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
到目前为止一切顺利。这里缺少分区,这让我认为它是 btrfs raid 的一部分。
现在麻烦开始了:
# btrfs device scan
Scanning for Btrfs filesystems
ERROR: device scan failed '/dev/sdf' - Device or resource busy
ERROR: error -16 while registering
我不明白-16是什么意思。谷歌和 btrfs 源文件的 grep 都没有给我找到任何提示。
让我们尝试安装它:
# mount -o degraded /dev/sdf btrfs_test/
mount: /dev/sdf is already mounted or /tmp/btrfs_test busy
奇怪了,那它安装在哪里呢?
# mount | grep sdf
# lsof | grep sdf
# lsof | grep btrfs_test
# fuser -vm /dev/sdf
# grep /tmp/btrfs_test /proc/mounts
# findmnt | grep sdf
# ls -l /sys/block/sdf/holders/
total 0
任何命令都没有输出,预计 ls 的计数为 0。
答案1
事实证明,该光盘最初确实是一次突袭的一部分。
因为仍然属于该 raid 一部分的其他磁盘已安装,所以 btrfs 会感到困惑,认为该磁盘已经安装,因为它的 raid 已经安装了。