RHEL8.2-虛擬機器異常斷電導致Structure needs cleaning.問題
RHEL8.2-虛擬機器異常斷電導致Structure needs cleaning.問題
[root@esdb02 ~]# xfs_repair -L /dev/mapper/vgesdb-lvesdb
Phase 1 - find and verify superblock...
Phase 2 - using internal log
- zero log...
ALERT: The filesystem has valuable metadata changes in a log which is being
destroyed because the -L option was used.
- scan filesystem freespace and inode maps...
sb_icount 3712, counted 4160
sb_ifree 376, counted 296
sb_fdblocks 20768280, counted 20642135
- found root inode chunk
Phase 3 - for each AG...
- scan and clear agi unlinked lists...
- process known inodes and perform inode discovery...
- agno = 0
- agno = 1
data fork in ino 67445213 claims free block 8430646
data fork in ino 67445213 claims free block 8430647
data fork in ino 67445220 claims free block 8430656
data fork in ino 67445220 claims free block 8430657
correcting imap
correcting imap
correcting imap
correcting imap
correcting imap
correcting imap
data fork in ino 67446858 claims free block 8430876
data fork in ino 67446858 claims free block 8430877
data fork in ino 67446874 claims free block 8430855
data fork in ino 67446875 claims free block 8430854
data fork in ino 67446880 claims free block 8430864
data fork in ino 67446881 claims free block 8430865
data fork in ino 67451841 claims free block 8431479
data fork in ino 67451842 claims free block 8431478
data fork in ino 67451843 claims free block 8431488
data fork in ino 67451846 claims free block 8431491
data fork in ino 67451847 claims free block 8431489
data fork in ino 67451848 claims free block 8431492
- agno = 2
- agno = 3
- process newly discovered inodes...
Phase 4 - check for duplicate blocks...
- setting up duplicate extent list...
- check for inodes claiming duplicate blocks...
- agno = 0
- agno = 1
- agno = 2
- agno = 3
Phase 5 - rebuild AG headers and trees...
- reset superblock...
Phase 6 - check inode connectivity...
- resetting contents of realtime bitmap and summary inodes
- traversing filesystem ...
- traversal finished ...
- moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
Maximum metadata LSN (15:40496) is ahead of log (1:2).
Format log to cycle 18.
done
[root@esdb02 ~]#
[root@esdb02 ~]# mount -a
[root@esdb02 ~]#
[root@esdb02 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.5G 0 1.5G 0% /dev
tmpfs 1.5G 8.7M 1.5G 1% /run
tmpfs 1.5G 0 1.5G 0% /sys/fs/cgroup
/dev/mapper/vgroot-lvroot 10G 9.3G 756M 93% /
tmpfs 297M 0 297M 0% /run/user/0
/dev/nvme0n1p1 1014M 160M 855M 16% /boot
/dev/mapper/vgesdb-lvesdb 81G 2.9G 79G 4% /esdb
[root@esdb02 ~]#
========================================================
參考文獻
If you're attempting to run
, getting the error message that suggests mounting the filesystem to replay the log, and after mounting still receiving the same error message, you may need to perform a forced repair (using the
-L
flag with
xfs_repair
).
This option should be a last resort.
For example, I'll use a case where I had a corrupt root partition on my CentOS 7 install. When attempting to mount the partition, I continually received the below error message:
mount: mount /dev/mapper/centos-root on /mnt/centos-root failed: Structure needs cleaning
Unfortunately, forcing a repair would involve zeroing out (destroying) the log before attempting a repair. When using this method, there is a potential of ending up with more corrupt data than initially anticipated; however, we can use the appropriate xfs tools to see what kind of damage may be caused before making any permanent changes.
Using and , you can create a metadata image of the affected partition and perform the forced repair on the image rather than the partition itself. The benefits of this is the ability to see the damage that comes with a forced repair before performing it on the partition.
To do this, you'll need a decent sized USB or external hard drive. Start by mounting the USB drive - my USB was located at
/dev/sdb1
, yours may be named differently.
mkdir -p /mnt/usbmount /dev/sdb1 /mnt/usb
Once mounted, run
xfs_metadump
to create a copy of the partition metadata to the USB - again, your affected partition may be different. In this case, I had a corrupt root partition located at
/dev/mapper/centos-root
:
xfs_metadump /dev/mapper/centos-root /mnt/usb/centos-root.metadump
Next, you'll want to restore the metadata in to an image so that we can perform a repair and measure the damage.
xfs_mdrestore /mnt/usb/centos-root.metadump /mnt/usb/centos-root.img
I found that in rescue mode
xfs_mdrestore
is not available, and instead you'll need to be in rescue mode of a live CentOS CD.
Finally, we can perform the repair on the image:
xfs_repair -L /mnt/usb/centos-root.img
After the repair has completed and you've assessed the output and potential damage, you can determine as to whether you'd like to perform the repair against the partition.
To run the repair against the partition, simply run:
xfs_repair -L /dev/mapper/centos-root
Don't forget to check the other partitions for corruption as well. After the repairs, reboot the system and you should be able to successfully boot.
Remember that the
-L
flag should be used as a last resort where there are no other possible options to repair.
fsck -vcfy /dev/sda3 會清空資料。
在未掛載狀態下試一試這個命令: # xfs_repair /dev/sdb1 /*後面跟目標驅動器路徑*/如果提示log什麼的有問題,則使用-L引數,這會重建log,然後再使用上面一條命令進行修復。 #xfs_repair -L /dev/sdb1
1 執行debugfs -w /dev/sdb (/dev/sdb出現 該情況檔案所在的分割槽) -w says that partition will be opened in read-write mode.
2 mount /dev/sdb /mnt/other 掛載到mnt/other 目錄下
3 執行 clri path/file 移除損壞檔案節點 注意path/file 值的是相對路徑 而不是/mnt/other/****
4 退出 debugfs 執行fsck -y /mnt/other 修復該分割槽
ext4檔案系統,使用命令 fsck.ext4 /dev/md0 修復,
如果是xfs檔案系統,使用命令 xfs_repair -L /dev/md0修復,
# mount /dev/sdb1 /disk2
mount: Structure needs cleaning
我用了下列的指令解決了. 雖然我不太清楚什麼東西導致它有問題 :
# xfs_repair -n /dev/sdb1
上面指令還不能完全解決
# xfs_check /dev/sdb1
ERROR: The filesystem has valuable metadata changes in a log which needs to
be replayed. Mount the filesystem to replay the log, and unmount it before
re-running xfs_check. If you are unable to mount the filesystem, then use
the xfs_repair -L option to destroy the log and attempt a repair.
Note that destroying the log may cause corruption — please attempt a mount
of the filesystem before doing this.
用 xfs_check 指令. 它建議我用 “xfs_repair -L ”
# xfs_repair -L /dev/sdb1
這樣弄玩之後. 在用 xfs_check 檢查一次
# xfs_check /dev/sdb1
就可以掛載了
# mount /dev/sdb1 /disk2
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31520497/viewspace-2735858/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【虛擬機器資料恢復】異常斷電導致虛擬機器無法啟動的資料恢復案例虛擬機資料恢復
- 虛擬機器的常見問題虛擬機
- 【虛擬機器資料恢復】意外斷電導致XenServer虛擬機器不可用的資料恢復虛擬機資料恢復Server
- 【伺服器資料恢復】異常斷電導致虛擬機器檔案丟失不能啟動的資料恢復案例伺服器資料恢復虛擬機
- crontab設定導致的伺服器程式異常問題伺服器
- vmware虛擬機器異常關閉處理虛擬機
- 當機導致slave異常分析
- RHEL7/CentOS7虛擬機器異常關閉導致vmware tool啟動指令碼報錯CentOS虛擬機指令碼
- 非歸檔模式下異常斷電導致的資料庫無法啟動的問題修復模式資料庫
- crontab導致CPU異常的問題分析及處理
- 06.Java虛擬機器問題Java虛擬機
- 一次意外斷電導致mysql檔案損壞,啟動異常MySql
- Java 虛擬機器診斷利器Java虛擬機
- MySQL Bug導致異常當機的分析流程MySql
- J-link虛擬串列埠波特率異常問題串列埠
- 膝上型電腦常見顯示卡故障導致電腦問題分析
- 伺服器癱瘓導致虛擬機器丟失恢復過程伺服器虛擬機
- vmware虛擬機器網路中斷虛擬機
- 從原始碼分析JSONObject因版本差異導致toString格式異常問題原始碼JSONObject
- 關於虛擬機器VM聯網問題虛擬機
- Parallels Desktop虛擬機器問題彙總Parallel虛擬機
- Esxi5.5虛擬機器快照整合問題虛擬機
- 虛擬機器網路的2個問題虛擬機
- 虛擬機器下安裝問題 求助(轉)虛擬機
- 儲存癱瘓導致虛擬化平臺丟失虛擬機器該怎麼解決虛擬機
- 從ubuntu虛擬機器外部訪問虛擬機器內部資訊Ubuntu虛擬機
- 華為交換機LLDP震盪導致網路異常
- 表空間擴充套件過程 停電導致異常中斷, 無法啟動套件
- Dalvik虛擬機器、Java虛擬機器與ART虛擬機器虛擬機Java
- Java虛擬機器面試題Java虛擬機面試題
- Vmware vSphere5.0虛擬機器管理及硬體常見問題薦虛擬機
- 【虛擬機器】如何判斷CPU是否支援硬體虛擬化虛擬機
- MyBatis版本升級導致OffsetDateTime入參解析異常問題覆盤MyBatis
- CentOS 7 斷電導致 generating /run/initramfs/rdsosreport.txt 問題CentOS
- 客戶端安裝虛擬機器問題解答?客戶端虛擬機
- 大廠必問的Java虛擬機器面試題Java虛擬機面試題
- vmware ubuntu虛擬機器問題彙總解決Ubuntu虛擬機
- 本地連線虛擬機器資料庫問題虛擬機資料庫