文件系统随机变为只读

文件系统随机变为只读

一段时间以来,我的操作系统似乎一直在随机切换到只读模式。解决此问题的典型方法是从实时 USB 启动并运行fsck /dev/sda3/,然后我就可以正常启动了。现在我已经厌倦了这个问题,我想彻底修复它,但我认为这只是我的硬盘驱动器的问题,因为它已经使用了 10 多年,没有办法完全恢复。有一次,在启动到实时 USB 时,我运行了它sudo badblocks -v /dev/sda > ~/bad_sectors.txt,然后sudo e2fsck -l bad_sectors.txt /dev/sda以为它会将坏扇区(大约有 1000 个)标记为不可用,但无济于事。以下是dmesg --follow | grep sda从切换到只读时的输出:

[13347.507892] sd 0:0:0:0: [sda] tag#20 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=4s
[13347.507900] sd 0:0:0:0: [sda] tag#20 Sense Key : Medium Error [current]
[13347.507905] sd 0:0:0:0: [sda] tag#20 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.507910] sd 0:0:0:0: [sda] tag#20 CDB: Read(10) 28 00 44 d6 17 00 00 01 00 00
[13347.507912] I/O error, dev sda, sector 1154881384 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 0
[13347.507951] sd 0:0:0:0: [sda] tag#21 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=4s
[13347.507956] sd 0:0:0:0: [sda] tag#21 Sense Key : Medium Error [current]
[13347.507960] sd 0:0:0:0: [sda] tag#21 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.507964] sd 0:0:0:0: [sda] tag#21 CDB: Read(10) 28 00 44 d6 18 00 00 01 00 00
[13347.507967] I/O error, dev sda, sector 1154881536 op 0x0:(READ) flags 0x80700 phys_seg 2 prio class 0
[13347.507984] sd 0:0:0:0: [sda] tag#23 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.507988] sd 0:0:0:0: [sda] tag#23 Sense Key : Medium Error [current]
[13347.507992] sd 0:0:0:0: [sda] tag#23 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.507996] sd 0:0:0:0: [sda] tag#23 CDB: Write(10) 2a 00 5b 10 cc d8 00 00 08 00
[13347.507999] I/O error, dev sda, sector 1527827672 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508005] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978459)
[13347.508013] Buffer I/O error on device sda3, logical block 189801883
[13347.508032] sd 0:0:0:0: [sda] tag#24 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.508037] sd 0:0:0:0: [sda] tag#24 Sense Key : Medium Error [current]
[13347.508041] sd 0:0:0:0: [sda] tag#24 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.508046] sd 0:0:0:0: [sda] tag#24 CDB: Write(10) 2a 00 5b 10 cc e8 00 00 08 00
[13347.508049] I/O error, dev sda, sector 1527827688 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508054] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978461)
[13347.508060] Buffer I/O error on device sda3, logical block 189801885
[13347.508072] sd 0:0:0:0: [sda] tag#25 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.508076] sd 0:0:0:0: [sda] tag#25 Sense Key : Medium Error [current]
[13347.508080] sd 0:0:0:0: [sda] tag#25 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.508085] sd 0:0:0:0: [sda] tag#25 CDB: Write(10) 2a 00 5b 10 cc f8 00 00 08 00
[13347.508087] I/O error, dev sda, sector 1527827704 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508093] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978463)
[13347.508098] Buffer I/O error on device sda3, logical block 189801887
[13347.508108] sd 0:0:0:0: [sda] tag#26 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.508113] sd 0:0:0:0: [sda] tag#26 Sense Key : Medium Error [current]
[13347.508117] sd 0:0:0:0: [sda] tag#26 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.508121] sd 0:0:0:0: [sda] tag#26 CDB: Write(10) 2a 00 5b 10 cd 30 00 00 08 00
[13347.508124] I/O error, dev sda, sector 1527827760 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508129] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978470)
[13347.508134] Buffer I/O error on device sda3, logical block 189801894
[13347.508145] sd 0:0:0:0: [sda] tag#27 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.508149] sd 0:0:0:0: [sda] tag#27 Sense Key : Medium Error [current]
[13347.508153] sd 0:0:0:0: [sda] tag#27 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.508158] sd 0:0:0:0: [sda] tag#27 CDB: Write(10) 2a 00 5b 10 cd b0 00 00 08 00
[13347.508160] I/O error, dev sda, sector 1527827888 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508166] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978486)
[13347.508171] Buffer I/O error on device sda3, logical block 189801910
[13347.508181] sd 0:0:0:0: [sda] tag#28 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.508185] sd 0:0:0:0: [sda] tag#28 Sense Key : Medium Error [current]
[13347.508189] sd 0:0:0:0: [sda] tag#28 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.508193] sd 0:0:0:0: [sda] tag#28 CDB: Write(10) 2a 00 5b 10 ce 28 00 00 08 00
[13347.508195] I/O error, dev sda, sector 1527828008 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508199] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978501)
[13347.508204] Buffer I/O error on device sda3, logical block 189801925
[13347.508212] sd 0:0:0:0: [sda] tag#29 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.508215] sd 0:0:0:0: [sda] tag#29 Sense Key : Medium Error [current]
[13347.508217] sd 0:0:0:0: [sda] tag#29 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.508219] sd 0:0:0:0: [sda] tag#29 CDB: Write(10) 2a 00 5b 10 ce 68 00 00 08 00
[13347.508220] I/O error, dev sda, sector 1527828072 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508223] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978509)
[13347.508225] Buffer I/O error on device sda3, logical block 189801933
[13347.508257] sd 0:0:0:0: [sda] tag#30 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=2s
[13347.508259] sd 0:0:0:0: [sda] tag#30 Sense Key : Medium Error [current]
[13347.508261] sd 0:0:0:0: [sda] tag#30 Add. Sense: Unrecovered read error - auto reallocate failed
[13347.508264] sd 0:0:0:0: [sda] tag#30 CDB: Write(10) 2a 00 5b 10 ce 80 00 00 08 00
[13347.508265] I/O error, dev sda, sector 1527828096 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13347.508267] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190978512)
[13347.508270] Buffer I/O error on device sda3, logical block 189801936
[13356.046988] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
[13356.046998] sd 0:0:0:0: [sda] tag#0 Sense Key : Medium Error [current]
[13356.047006] sd 0:0:0:0: [sda] tag#0 Add. Sense: Unrecovered read error - auto reallocate failed
[13356.047014] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 44 d6 17 68 00 00 08 00
[13356.047022] I/O error, dev sda, sector 1154881384 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[13360.283068] sd 0:0:0:0: [sda] tag#3 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=4s
[13360.283077] sd 0:0:0:0: [sda] tag#3 Sense Key : Medium Error [current]
[13360.283084] sd 0:0:0:0: [sda] tag#3 Add. Sense: Unrecovered read error - auto reallocate failed
[13360.283090] sd 0:0:0:0: [sda] tag#3 CDB: Read(10) 28 00 3c 07 a7 00 00 00 f8 00
[13360.283094] I/O error, dev sda, sector 1007134704 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
[13360.283168] sd 0:0:0:0: [sda] tag#6 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=4s
[13360.283178] sd 0:0:0:0: [sda] tag#6 Sense Key : Medium Error [current]
[13360.283186] sd 0:0:0:0: [sda] tag#6 Add. Sense: Unrecovered read error - auto reallocate failed
[13360.283195] sd 0:0:0:0: [sda] tag#6 CDB: Read(10) 28 00 2d d0 aa b0 00 00 08 00
[13360.283200] I/O error, dev sda, sector 768649904 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
[13360.283261] sd 0:0:0:0: [sda] tag#16 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=4s
[13360.283267] sd 0:0:0:0: [sda] tag#16 Sense Key : Medium Error [current]
[13360.283273] sd 0:0:0:0: [sda] tag#16 Add. Sense: Unrecovered read error - auto reallocate failed
[13360.283278] sd 0:0:0:0: [sda] tag#16 CDB: Write(10) 2a 00 5b 10 e5 88 00 00 08 00
[13360.283276] EXT4-fs error (device sda3): __ext4_find_entry:1612: inode #23726091: comm gnome-shell: reading directory lblock 0
[13360.283282] I/O error, dev sda, sector 1527833992 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13360.283290] Aborting journal on device sda3-8.
[13360.283292] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190979249)
[13360.283300] Buffer I/O error on device sda3, logical block 189802673
[13360.283322] sd 0:0:0:0: [sda] tag#17 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=4s
[13360.283326] sd 0:0:0:0: [sda] tag#17 Sense Key : Medium Error [current]
[13360.283329] sd 0:0:0:0: [sda] tag#17 Add. Sense: Unrecovered read error - auto reallocate failed
[13360.283332] sd 0:0:0:0: [sda] tag#17 CDB: Write(10) 2a 00 5b 10 e5 98 00 00 08 00
[13360.283335] I/O error, dev sda, sector 1527834008 op 0x1:(WRITE) flags 0x0 phys_seg 1 prio class 0
[13360.283339] EXT4-fs warning (device sda3): ext4_end_bio:342: I/O error 10 writing to inode 55050469 starting block 190979251)
[13360.283344] Buffer I/O error on device sda3, logical block 189802675
[13360.283931] EXT4-fs error (device sda3): ext4_journal_check_start:83: comm kworker/u8:1: Detected aborted journal
[13360.388651] EXT4-fs error (device sda3) in ext4_reserve_inode_write:5706: Journal has aborted
[13360.388667] EXT4-fs error (device sda3) in ext4_reserve_inode_write:5706: Journal has aborted
[13360.388717] EXT4-fs error (device sda3) in ext4_writepages:2792: Journal has aborted
[13360.445469] EXT4-fs (sda3): Remounting filesystem read-only
[13360.500964] EXT4-fs (sda3): ext4_writepages: jbd2_start: 1023 pages, ino 55061148; err -30
[13360.689931] EXT4-fs error (device sda3): ext4_dirty_inode:5902: inode #2883594: comm alacritty: mark_inode_dirty error
[13360.689957] EXT4-fs error (device sda3): ext4_dirty_inode:5902: inode #2883594: comm kworker/u8:0: mark_inode_dirty error
[13360.689975] EXT4-fs error (device sda3) in ext4_orphan_add:188: Journal has aborted
[13360.745451] EXT4-fs error (device sda3) in ext4_dirty_inode:5903: Journal has aborted
[13360.863574] EXT4-fs error (device sda3) in ext4_reserve_inode_write:5706: Journal has aborted
[13360.864710] EXT4-fs (sda3): ext4_writepages: jbd2_start: 727 pages, ino 55050469; err -30
[13361.001962] EXT4-fs (sda3): failed to convert unwritten extents to written extents -- potential data loss!  (inode 2883594, error -30)
[13364.946444] sd 0:0:0:0: [sda] tag#5 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
[13364.946449] sd 0:0:0:0: [sda] tag#5 Sense Key : Medium Error [current]
[13364.946453] sd 0:0:0:0: [sda] tag#5 Add. Sense: Unrecovered read error - auto reallocate failed
[13364.946457] sd 0:0:0:0: [sda] tag#5 CDB: Read(10) 28 00 3c 07 a7 f0 00 00 08 00
[13364.946458] I/O error, dev sda, sector 1007134704 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[13368.761151] sd 0:0:0:0: [sda] tag#10 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=3s
[13368.761157] sd 0:0:0:0: [sda] tag#10 Sense Key : Medium Error [current]
[13368.761161] sd 0:0:0:0: [sda] tag#10 Add. Sense: Unrecovered read error - auto reallocate failed
[13368.761165] sd 0:0:0:0: [sda] tag#10 CDB: Read(10) 28 00 3c 07 a7 f0 00 00 08 00
[13368.761167] I/O error, dev sda, sector 1007134704 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0

输出结果如下lsblk

NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda             8:0    0 931.5G  0 disk
├─sda1          8:1    0   498M  0 part  /boot/efi
├─sda2          8:2    0     4G  0 part  /recovery
├─sda3          8:3    0   923G  0 part  /
└─sda4          8:4    0     4G  0 part
  └─cryptswap 253:0    0     4G  0 crypt [SWAP]
sr0            11:0    1  1024M  0 rom

相关内容