9

xfs文件系统修复 xfs_repair

 3 years ago
source link: http://abcdxyzk.github.io/blog/2021/07/20/xfs_repair/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

xfs文件系统修复 xfs_repair

2021-07-20 16:53:00

https://blog.csdn.net/theoldsod2000/article/details/105988902/

因为断电等原因可能无法开机,提示

Failed to start Remount Root and Kenal File System

可以通过xfs_repair命令进行修复。

[root@localhost ~]# xfs_repair
Usage: xfs_repair [options] device

Options:
  -f           The device is a file
  -L           Force log zeroing. Do this as a last resort.
  -l logdev    Specifies the device where the external log resides.
  -m maxmem    Maximum amount of memory to be used in megabytes.
  -n           No modify mode, just checks the filesystem for damage.
  -P           Disables prefetching.
  -r rtdev     Specifies the device where the realtime section resides.
  -v           Verbose output.
  -c subopts   Change filesystem parameters - use xfs_admin.
  -o subopts   Override default behaviour, refer to man page.
  -t interval  Reporting interval in seconds.
  -d           Repair dangerously.
  -V           Reports version and exits.

xfs_repair最重要的是指定要修复的设备

如果是LVM管理分区的

可以通过 ls -l /dev/mapper 来查看可用的设备。

一般可以看到2到3个链接文件,centos-home -> ../dm-1, centos-root->../dm-0

执行xfs_repair /dev/dm-0 正常情况下,这个分区就修复好了,再接着执行 xfs_repair /dev/dm-1,正常情况下,这个分区也会修复好。

如果不是LVM分区管理的,可以 通过 ls /dev 查看,一般会有sda,sda1,sda2.

可以执行 xfs_repair /dev/sda1 和 xfs_repair /dev/sda2 进行修复。

如果修复失败,可以加上 -L 参数,这样可能会丢失部分数据。

修复的过程中可能会出错,提示找不到superblock。

下面这篇文章很清楚的讲述了superblock,inode,block的关系,可以帮助我们理解

https://blog.csdn.net/Ohmyberry/article/details/80427492

dm是device mapper的意思,主要涉及的linux下卷的管理。卷管理通过映射的方法建立了逻辑卷。每个逻辑卷相当于一个分区。

Posted by kk

2021-07-20 16:53:00system, base

« Linux下挂载lvm 重名问题 resuce 模式中mount fail »

wx_ok.pngali_ok.png


Recommend

  • 13
    • dimitrik.free.fr 4 years ago
    • Cache

    MySQL Performance : XFS -vs- EXT4 Story

    MySQL Performance : XFS -vs- EXT4 Story 2020-05-13 22:15 | MySQL, Performance, InnoDB, Benchmarks, DoubleWrite, XFS, EXT4 by Dimitri This post was rema...

  • 11
    • kernel.taobao.org 4 years ago
    • Cache

    New tricks for XFS

    LWN原文链接:https://lwn.net/Articles/747633/ XFS文件系统进入内核已有15个年头,并且在那之前它就已经被用在运行IRIX的生产系统上5年之久。但是,就像Dave Chinner在他linux.conf.au 2018的演讲上一...

  • 13

    EXT4 vs XFS for Oracle, which one performs better? 02/10/2019[UPDATE] Since publishing this post I received requests to benchmark ASM and Oracle Enterprise Linux. An updated post...

  • 12

    Bare Systemd Method to Create an XFS Mount Back to the Blog

  • 10
    • www.lujun9972.win 3 years ago
    • Cache

    xfs文件系统管理

    创建XFS文件系统 使用 mkfs.xfs 可以将存储设备格式化为XFS格式 dd if=/dev/zero of=~/xfs.img bs=1M count=4096 mkfs.xfs ~/xfs.img meta-data=/home/lujun9972/xfs.img isize=512...

  • 5

    emptyDir支持三种类型的,通过设置 medium 字段 : 文件:默认情况 Memory:占用内存资源 HugePages sizeLimit默认行为 同时支持通过sizeLimit设置限制的大小,但是这个大小默认情况下(

  • 8

        下图是ext4 vs xfs文件系统的对比测试结果数据,横坐标是测试模式,纵坐标是测试耗时,越小越好。     从结果来看:     1. 初始化模式下,ext4性能并没有比xfs来得高     2. 随机读写模式下,ext4性能比xfs将近高一倍     3....

  • 12
    • computingforgeeks.com 2 years ago
    • Cache

    How To Resize XFS / Btrfs file systems on Linux

    Btrfs file systems on LinuxA Linux file system can be defined as a structured collection of files on a partition or disk. This is an in-built layer in the Linux Operating system that handles data management in the s...

  • 5

    XFS online filesystem scrubbing and repair This article brought to you by LWN subscribersSubscribers to LWN.net made this article — and everything that surrounds it...

  • 4
    • bajie.dev 1 year ago
    • Cache

    Xfs文件系统下增加inode

    Xfs文件系统下增加inode 2023-12-21 1 分钟阅读 终于遇到了inode不够了,细碎文件爆棚了,导致inode不够了。 XFS 文件系统本质上是没有 inode 的限制的 只有一个缺省的限制,使用现有文件系统的 25% 来存储 inode...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK