linux根文件系统变成只读,Linux软件RAID 1 – 根文件系统在一个磁盘发生故障后变为只读...

当Linux系统中RAID1阵列的一个驱动器出现故障时,根文件系统意外变为只读模式。文章描述了如何在不重启系统的情况下恢复根文件系统的读写权限,并探讨了如何配置系统以防止因硬盘故障而导致文件系统锁定。在尝试重新挂载和使用LVM工具时遇到了问题,尽管其他如/boot和/data分区仍保持可写。作者寻求解决方案以确保系统在等待更换故障磁盘期间能持续运行。
摘要由CSDN通过智能技术生成

Linux软件RAID 1锁定为只读模式

设置:

RAID 1中的Centos 5.2,2 x 320 GB SATA驱动器.

> / dev / md0(/ dev / sda1 / dev / sdb1)是

/启动

> / dev / md1(/ dev / sda1

/ dev / sdb1)是一个LVM分区

包含/,/ data和swap分区

除swap之外的所有文件系统都是ext3

我们在几个系统上遇到问题,其中一个驱动器上的故障将根文件系统锁定为只读,这显然会导致问题.

[root@myserver /]# mount | grep Root

/dev/mapper/VolGroup00-LogVolRoot on / type ext3 (rw)

[root@myserver /]# touch /foo

touch: cannot touch `/foo': Read-only file system

我可以看到数组中的一个分区出现故障:

[root@myserver /]# mdadm --detail /dev/md1

/dev/md1:

[...]

State : clean,degraded

Active Devices : 1

Working Devices : 1

Failed Devices : 1

Spare Devices : 0

[...]

Number Major Minor RaidDevice State

0 0 0 0 removed

1 8 18 1 active sync /dev/sdb2

2 8 2 - faulty spare /dev/sda2

重新安装为rw失败:

[root@myserver /]# mount -n -o remount /

mount: block device /dev/VolGroup00/LogVolRoot is write-protected,mounting read-only

除非使用了–ignorelockingfailure(因为它们无法写入/ var),否则LVM工具会出错,但会将卷组显示为rw:

[root@myserver /]# lvm vgdisplay

Locking type 1 initialisation Failed.

[root@myserver /]# lvm pvdisplay --ignorelockingfailure

--- Physical volume ---

PV Name /dev/md1

VG Name VolGroup00

PV Size 279.36 GB / not usable 15.56 MB

Allocatable yes (but full)

[...]

[root@myserver /]# lvm vgdisplay --ignorelockingfailure

--- Volume group ---

VG Name VolGroup00

System ID

Format lvm2

Metadata Areas 1

Metadata Sequence No 4

VG Access read/write

VG Status resizable

[...]

[root@myserver /]# lvm lvdisplay /dev/VolGroup00/LogVolRoot --ignorelockingfailure

--- Logical volume ---

LV Name /dev/VolGroup00/LogVolRoot

VG Name VolGroup00

LV UUID PGoY0f-rXqj-xH4v-WMbw-jy6I-nE04-yZD3Gx

LV Write Access read/write

[...]

在这种情况下,/ boot(单独的RAID元设备)和/ data(同一卷组中的不同逻辑卷)仍然是可写的.从以前的出现,我知道重启会使系统备份一个读/写根文件系统和一个适当降级的RAID阵列.

所以,我有两个问题:

1)发生这种情况时,如何在没有系统重启的情况下将根文件系统恢复为读/写?

2)需要更改什么来阻止此文件系统锁定?由于单个磁盘上的RAID 1故障,我们不希望文件系统锁定,我们希望系统继续运行,直到我们可以更换坏磁盘.

编辑:我可以在teh dmesg输出中看到这个 – doe sthis表示/ dev / sda失败,然后/ dev / sdb上的单独失败导致文件系统被设置为只读?

sda: Current [descriptor]: sense key: Aborted Command

Add. Sense: Recorded entity not found

Descriptor sense data with sense descriptors (in hex):

72 0b 14 00 00 00 00 0c 00 0a 80 00 00 00 00 00

00 03 ce 85

end_request: I/O error,dev sda,sector 249477

raid1: Disk failure on sda2,disabling device.

Operation continuing on 1 devices

ata1: EH complete

SCSI device sda: 586072368 512-byte hdwr sectors (300069 MB)

sda: Write Protect is off

sda: Mode Sense: 00 3a 00 00

SCSI device sda: drive cache: write back

RAID1 conf printout:

--- wd:1 rd:2

disk 0,wo:1,o:0,dev:sda2

disk 1,wo:0,o:1,dev:sdb2

RAID1 conf printout:

--- wd:1 rd:2

disk 1,dev:sdb2

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata2.00: irq_stat 0x40000001

ata2.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 0

res 51/04:00:34:cf:f3/00:00:00:f3:40/a3 Emask 0x1 (device error)

ata2.00: status: { DRDY ERR }

ata2.00: error: { ABRT }

ata2.00: configured for UDMA/133

ata2: EH complete

sdb: Current [descriptor]: sense key: Aborted Command

Add. Sense: Recorded entity not found

Descriptor sense data with sense descriptors (in hex):

72 0b 14 00 00 00 00 0c 00 0a 80 00 00 00 00 00

01 e3 5e 2d

end_request: I/O error,dev sdb,sector 31677997

Buffer I/O error on device dm-0,logical block 3933596

lost page write due to I/O error on dm-0

ata2: EH complete

SCSI device sdb: 586072368 512-byte hdwr sectors (300069 MB)

sdb: Write Protect is off

sdb: Mode Sense: 00 3a 00 00

SCSI device sdb: drive cache: write back

ata2.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0

ata2.00: irq_stat 0x40000008

ata2.00: cmd 61/38:00:f5:d6:03/00:00:00:00:00/40 tag 0 ncq 28672 out

res 41/10:00:f5:d6:03/00:00:00:00:00/40 Emask 0x481 (invalid argument)

ata2.00: status: { DRDY ERR }

ata2.00: error: { IDNF }

ata2.00: configured for UDMA/133

sd 1:0:0:0: SCSI error: return code = 0x08000002

sdb: Current [descriptor]: sense key: Aborted Command

Add. Sense: Recorded entity not found

Descriptor sense data with sense descriptors (in hex):

72 0b 14 00 00 00 00 0c 00 0a 80 00 00 00 00 00

00 03 d6 f5

end_request: I/O error,sector 251637

ata2: EH complete

SCSI device sdb: 586072368 512-byte hdwr sectors (300069 MB)

sdb: Write Protect is off

sdb: Mode Sense: 00 3a 00 00

SCSI device sdb: drive cache: write back

Aborting journal on device dm-0.

journal commit I/O error

ext3_abort called.

EXT3-fs error (device dm-0): ext3_journal_start_sb: Detected aborted journal

Remounting filesystem read-only

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值