无法挂载 XFS — 坏超级块

无法挂载 XFS — 坏超级块

请记住,我是个菜鸟,不太清楚自己在做什么。我们有一台 Dell PowerEdge 420,配有 716iS iSCSI 磁盘阵列。在使用磁盘期间网络连接断开,我们无法再挂载。我尝试了 xfs_check /dev/sdf

Phase 1 - find and verify superblock...
bad primary superblock - bad magic number !!!

attempting to find secondary superblock...
.....<> .....
found candidate secondary superblock
unable to verify superblock continuing...
.....<> .....

但它永远无法找到有效的超级块。同样:

xfs_repair -n /dev/sdf
Phase 1 - find and verify superblock...
bad primary superblock - bad magic number !!!

attempting to find secondary superblock...

这没有找到有效的超级块。

我该怎么做才能恢复该文件系统?

编辑:util fdisk 不支持 GPT。请使用 GNU Parted。parted 如下:parted -l /dev/sdf

  Model: DELL PERC H310 (scsi)
  Disk /dev/sda: 500GB
  Sector size (logical/physical): 512B/512B
  Partition Table: msdos

  Number  Start   End    Size   Type     File system  Flags
   1      1049kB  525MB  524MB  primary  ext4         boot
   2      525MB   500GB  499GB  primary               lvm


  Model: JetStor JetStor -VOL1 - (scsi)
  Disk /dev/sdb: 39.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  39.0TB  39.0TB               primary


  Model: JetStor JetStor -VOL2 (scsi)
  Disk /dev/sdc: 52.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  52.0TB  52.0TB               primary


  Model: JetStor JetStor -VOL1 - (scsi)
  Disk /dev/sdd: 39.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  39.0TB  39.0TB               primary


  Model: JetStor JetStor -VOL2 (scsi)
  Disk /dev/sde: 52.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  52.0TB  52.0TB               primary


  Model: AC&Ncorp JetStor (scsi)
  Disk /dev/sdf: 52.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  52.0TB  52.0TB               primary


  Error: /dev/mapper/mpathcp1: unrecognised disk label

  Model: Linux device-mapper (multipath) (dm)
  Disk /dev/mapper/mpathc: 52.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  52.0TB  52.0TB               primary


  Model: Linux device-mapper (linear) (dm)
  Disk /dev/mapper/vg_cfile-lv_var: 105GB
  Sector size (logical/physical): 512B/512B
  Partition Table: loop

  Number  Start  End    Size   File system  Flags
   1      0.00B  105GB  105GB  ext4


  Model: Linux device-mapper (linear) (dm)
  Disk /dev/mapper/vg_jet716s_vol2-lv_jet716sV2a: 37.7TB
  Sector size (logical/physical): 512B/512B
  Partition Table: loop

  Number  Start  End     Size    File system  Flags
   1      0.00B  37.7TB  37.7TB  xfs


  Model: Linux device-mapper (linear) (dm)
  Disk /dev/mapper/vg_jet716s-lv_jet716s_jet: 39.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: loop

  Number  Start  End     Size    File system  Flags
   1      0.00B  39.0TB  39.0TB  xfs


  Error: /dev/mapper/mpathbp1: unrecognised disk label

  Error: /dev/mapper/mpathdp1: unrecognised disk label

  Model: Linux device-mapper (multipath) (dm)
  Disk /dev/mapper/mpathb: 39.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  39.0TB  39.0TB               primary


  Model: Linux device-mapper (multipath) (dm)
  Disk /dev/mapper/mpathd: 52.0TB
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start   End     Size    File system  Name     Flags
   1      1049kB  52.0TB  52.0TB               primary


  Model: Linux device-mapper (linear) (dm)
  Disk /dev/mapper/vg_cfile-lv_swap: 33.8GB
  Sector size (logical/physical): 512B/512B
  Partition Table: loop

  Number  Start  End     Size    File system     Flags
   1      0.00B  33.8GB  33.8GB  linux-swap(v1)


  Model: Linux device-mapper (linear) (dm)
  Disk /dev/mapper/vg_cfile-lv_root: 53.7GB
  Sector size (logical/physical): 512B/512B
  Partition Table: loop

  Number  Start  End     Size    File system  Flags
   1      0.00B  53.7GB  53.7GB  ext4

编辑2:这是文件-s。

file -s /dev/sdf{,1,2,3,4,5,6}
    /dev/sdf:  x86 boot sector; partition 1: ID=0xee, starthead 0, startsector 1, 4294967295 sectors, extended partition table (last)\011, code offset 0x0
    /dev/sdf1: cannot open `/dev/sdf1' (No such file or directory)
    /dev/sdf2: cannot open `/dev/sdf2' (No such file or directory)
    /dev/sdf3: cannot open `/dev/sdf3' (No such file or directory)
    /dev/sdf4: cannot open `/dev/sdf4' (No such file or directory)
    /dev/sdf5: cannot open `/dev/sdf5' (No such file or directory)
    /dev/sdf6: cannot open `/dev/sdf6' (No such file or directory)

编辑 3:这是多路径 -l 的输出

      mpathd (35001b4d0189b4801) dm-2 JetStor,JetStor -VOL2
      size=47T features='0' hwhandler='0' wp=rw
      `-+- policy='round-robin 0' prio=0 status=active
        |- 7:0:0:1 sdc 8:32 active undef running
        `- 7:0:1:1 sde 8:64 active undef running
      mpathc (32029001378917600) dm-9 AC&Ncorp,JetStor
      size=47T features='0' hwhandler='0' wp=rw
      `-+- policy='round-robin 0' prio=0 status=active
        `- 8:0:0:0 sdf 8:80 active undef running
      mpathb (35001b4d0189b4800) dm-3 JetStor,JetStor -VOL1 -
      size=35T features='0' hwhandler='0' wp=rw
      `-+- policy='round-robin 0' prio=0 status=active
        |- 7:0:0:0 sdb 8:16 active undef running
        `- 7:0:1:0 sdd 8:48 active undef running 

以及 /etc/multipath.conf 的内容

      # This is a basic configuration file with some examples, for device mapper
      # multipath.
      # For a complete list of the default configuration values, see
      # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.defaults
      # For a list of configuration options with descriptions, see
      # /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf.annotated
      #
      # REMEMBER: After updating multipath.conf, you must run
      #
      # service multipathd reload
      #
      # for the changes to take effect in multipathd

      ## By default, devices with vendor = "IBM" and product = "S/390.*" are
      ## blacklisted. To enable mulitpathing on these devies, uncomment the
      ## following lines.
      #blacklist_exceptions {
      #       device {
      #               vendor  "IBM"
      #               product "S/390.*"
      #       }
      #}

      ## Use user friendly names, instead of using WWIDs as names.
      #defaults {
      #       user_friendly_names yes
      #}

      ##
      ## Here is an example of how to configure some standard options.
      ##
      # 5/21/14: uncommented this
      defaults {
              udev_dir                /dev
              polling_interval        10
              path_selector           "round-robin 0"
              path_grouping_policy    multibus
              getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
              prio                    alua
              path_checker            readsector0
              rr_min_io               100
              max_fds                 8192
              rr_weight               priorities
              failback                immediate
              no_path_retry           fail
              user_friendly_names     yes
      }
      ##
      ## The wwid line in the following blacklist section is shown as an example
      ## of how to blacklist devices by wwid.  The 2 devnode lines are the
      ## compiled in default blacklist. If you want to blacklist entire types
      ## of devices, such as all scsi devices, you should use a devnode line.
      ## However, if you want to blacklist specific devices, you should use
      ## a wwid line.  Since there is no guarantee that a specific device will
      ## not change names on reboot (from /dev/sda to /dev/sdb for example)
      ## devnode lines are not recommended for blacklisting specific devices.
      ##
      #blacklist {
      #       wwid 26353900f02796769
      #       devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
      #       devnode "^hd[a-z]"
      #}
      #multipaths {
      #       multipath {
      #               wwid                    3600508b4000156d700012000000b0000
      #               alias                   yellow
      #               path_grouping_policy    multibus
      #               path_checker            readsector0
      #               path_selector           "round-robin 0"
      #               failback                manual
      #               rr_weight               priorities
      #               no_path_retry           5
      #       }
      #       multipath {
      #               wwid                    1DEC_____321816758474
      #               alias                   red
      #       }
      #}
      #devices {
      #       device {
      #               vendor                  "COMPAQ  "
      #               product                 "HSV110 (C)COMPAQ"
      #               path_grouping_policy    multibus
      #               getuid_callout          "/lib/udev/scsi_id --whitelisted --device=/dev/%n"
      #               path_checker            readsector0
      #               path_selector           "round-robin 0"
      #               hardware_handler        "0"
      #               failback                15
      #               rr_weight               priorities
      #               no_path_retry           queue
      #       }
      #       device {
      #               vendor                  "COMPAQ  "
      #               product                 "MSA1000         "
      #               path_grouping_policy    multibus
      #       }
      #}

      blacklist {
      }

这上面有另一个 SCSI 阵列,这可能是它更换设备的原因。

答案1

如果没有更多信息,很难说,但有几种可能性。如果可以的话,我会发表评论。

最坏情况:你被骗了。从备份中恢复。你有备份,对吧?

最佳情况:/dev/sdf 不再是设备名称。检查 iSCSI LUN ID,看看它是否被重新分配给另一个设备名称。您是否在使用硬件 iSCSI 适配器或软件?尝试fdisk -l /dev/sdf在此处发布输出也可能会有所帮助。

编辑:谢谢。我发现你最新的输出有几个问题:

Model: AC&Ncorp JetStor (scsi) Disk /dev/sdf: 52.0TB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1049kB 52.0TB 52.0TB primary Error: /dev/mapper/mpathcp1: unrecognised disk label

首先,阵列跨设备改变模型很奇怪。 /dev/sdf 是由不同的存储阵列提供的吗?

其次,可能更重要的是,您似乎已配置多路径。您可以运行multipath -l并粘贴输出吗?此外,您可以粘贴 的内容/etc/multipath.conf吗?

答案2

好的,发布此命令的结果。根据需要更改设备: sudo xfsdump -f /dev/sdb1 | grep -i superblock

我想指出我的个人经验,Ubuntu 已经有一段时间没有很好的 XFS 支持了,你可能会发现下载一个旧的 warty warthog 副本并使用 livecd 会非常有帮助。

您可能会收到如下回复:

找不到有效的文件系统超级块。

如果是这样,请不要放弃。您可以尝试sudo mkfs.xfs -N /dev/sdb1 列出有关文件系统的详细信息,而无需写入任何更改。希望您会在该列表末尾看到类似以下内容:... 超级块备份:32768、98304、163840、229376、294912、819200、884736、1605632、2654208

这是一个备选超级块的列表(示例:您的列表可能会有所不同)。然后,您可以采用反复试验的方法,使用超级块列表,使用 mkfs、fsck 和 mknode 重建您的 XFS 文件系统。

在我写一个长答案之前,先发回来自 的详细信息xfsdump,以及mkfs.xfs

相关内容