USB HDD ext4 更改为只读 - 有什么问题? - 适用于其他系统

USB HDD ext4 更改为只读 - 有什么问题? - 适用于其他系统

我已将 Seagate 外置硬盘 (FreeAgent 750GB) 连接到树莓派上的 Open Media Vault。一旦尝试进行任何写入操作,驱动器就会重新安装为只读。该机器是 raspberryPi v.1 B+ (r0OMV 4.1.13+)。不过,我可以将相同的驱动器连接到我的(manjaro 4.3.6-1-MANJARO)笔记本电脑上并写入数据,没有任何问题。

任何想法表示赞赏。鉴于这是一个在其他系统上工作正常的磁盘,我不想简单地购买新磁盘,因为它可能与 raspberryPi 和 OMV 存在相同的问题。我可以重复我已经完成的以下步骤,并且再次得到完全相同的结果。只是说 - 该磁盘在同一台树莓派机器上运行一周左右,并且仍然可以在我的笔记本电脑上运行良好。该磁盘已使用 7 年。到目前为止我的故障排除步骤是:

1)卸载并执行fsck:

root@r0OMV:~#  e2fsck /dev/sda1
e2fsck 1.42.5 (29-Jul-2012)
ForteBKP: recovering journal
ForteBKP contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
ForteBKP: 11/45793280 files (0.0% non-contiguous), 2924481/183143385 blocks

我可以安装它后立即:

mount -a

然后挂载显示:

/dev/sda1 on /media/49fb4a0f-c826-4a7c-877a-76c98dba5b2c type ext4 (rw,noexec,relatime,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group,_netdev)

如果我尝试 mkdir 我会收到错误:

mkdir: cannot create directory `/media/49fb4a0f-c826-4a7c-877a-76c98dba5b2c/touch': Read-only file system

并安装显示:

/dev/sda1 on /media/49fb4a0f-c826-4a7c-877a-76c98dba5b2c type ext4 (ro,noexec,relatime,data=ordered,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group,_netdev)

当发生这种情况时,系统日志输出是:

Mar  5 12:08:48 r0OMV kernel: [49725.089841] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: user_xattr,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl
Mar  5 12:08:50 r0OMV kernel: [49727.055478] blk_update_request: critical target error, dev sda, sector 0
Mar  5 12:08:55 r0OMV kernel: [49732.679403] blk_update_request: critical target error, dev sda, sector 730073112
Mar  5 12:08:55 r0OMV kernel: [49732.679520] Aborting journal on device sda1-8.
Mar  5 12:08:56 r0OMV kernel: [49733.120506] EXT4-fs error (device sda1): ext4_journal_check_start:56: Detected aborted journal
Mar  5 12:08:56 r0OMV kernel: [49733.134090] EXT4-fs (sda1): Remounting filesystem read-only

2) 采取的其他措施: 我调查过高清参数和智能控制

root@r0OMV:~# hdparm -I /dev/sda1
/dev/sda1:
ATA device, with non-removable media
    Model Number:       ST3750640AS                             
    Serial Number:      5QD40Q51
    Firmware Revision:  3.AFM   
Standards:
    Supported: 7 6 5 4 
    Likely used: 7
Configuration:
    Logical     max current
    cylinders   16383   16383
    heads       16  16
    sectors/track   63  63
... the rest of output seems normal and I cut it for the sake of brevity

root@r0OMV:~# hdparm -r0 /dev/sda1
/dev/sda1:
 setting readonly to 0 (off)
 readonly      =  0 (off)

root@r0OMV:~# hdparm -W /dev/sda1
/dev/sda1:
 write-caching =  0 (off)

但这并没有产生任何结果。

智能控制经过长时间的测试我发现结果是

smartctl -H /dev/sda 
smartctl 5.41 2011-06-09 r3365 [armv6l-linux-4.1.13+] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
190 Airflow_Temperature_Cel 0x0022   051   034   045    Old_age   Always   In_the_past 49 (92 106 63 32)

当我检查标志时,其余参数都在正常范围内,-a我发现我最近所做的测试似乎没问题。

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Aborted by host               80%     15285         -
# 2  Extended offline    Aborted by host               90%     15285         -
# 3  Extended offline    Aborted by host               80%     15285         -
# 4  Short offline       Completed without error       00%     15285         -
# 5  Extended offline    Aborted by host               70%     15276         -
# 6  Extended offline    Completed without error       00%     15157     

答案1

我有一个 USB 适配器也有类似的行为。听起来很奇怪,安装 ext3 是因为 ext2(意味着不记录日志)允许磁盘工作。也许这是一个选择。

相关内容