重新挂载为读写

重新挂载为读写

昨天我的 CentOS Linux 7 (Core) 服务器出现硬盘问题。硬盘现已更换,但主分区处于只读模式。

我正在尝试让主分区再次可用(使其可读写)但遇到了很多问题。

挂载为 rw

我尝试过mount -n -o remount,rw /但结果却是:

mount: / not mounted or bad option

       In some cases useful info is found in syslog - try
       dmesg | tail or so

dmesg | tail导致:

[  177.305240] Loading iSCSI transport class v2.0-870.
[  177.419722] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[  177.446940] NFSD: starting 90-second grace period (net ffffffffa32fca00)
[  233.475427] systemd-readahead[2002]: Failed to open pack file: Read-only file system
[  267.629924] nfsd4: failed to purge old clients from recovery directory v4recovery
[  428.141830] EXT4-fs (md2): error count since last fsck: 1
[  428.141889] EXT4-fs (md2): initial error at time 1542775899: ext4_xattr_block_get:298: inode 6947097
[  428.142014] EXT4-fs (md2): last error at time 1542775899: ext4_xattr_block_get:298: inode 6947097
[  748.786866] EXT4-fs (md2): Couldn't remount RDWR because of unprocessed orphan inode list.  Please umount/remount instead
[  770.787648] EXT4-fs (md2): Couldn't remount RDWR because of unprocessed orphan inode list.  Please umount/remount instead

e2fsck

我尝试使用以下方法修复孤立的 inode 列表:

e2fsck -f /dev/md2
e2fsck 1.42.9 (28-Dec-2013)
/dev/md2 has unsupported feature(s): metadata_csum
e2fsck: Get a newer version of e2fsck!

由于文件系统处于只读模式,我无法下载较新版本的e2fsck

tune2fs

我尝试tune2fs -O ^metadata_csum /dev/md2并得到:

tune2fs 1.42.9 (28-Dec-2013)
tune2fs: Filesystem has unsupported read-only feature(s) while trying to open /dev/md2
Couldn't find valid filesystem superblock.

我怎样才能让该分区再次被读写?

谢谢

答案1

您需要从足够新的救援系统启动,以支持您正在使用的文件系统功能。但是,考虑到文件系统显然已损坏,即使(我假设)您使用的是提供冗余的 RAID 级别,也要做好文件系统无法恢复的准备。是时候预热备份了。

相关内容