系统盘恢复
· 阅读需 6 分钟
喜欢使用 闪存盘/U 盘 作为 Linux 系统盘,但 U 盘 使用寿命有限,当异常后需要对系统盘进行更换。
现状
使用 SanDisk CZ430 作为 系统盘/Root 分区
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 114.6G 0 disk
├─sda1 8:1 1 128M 0 part /boot
└─sda2 8:2 1 114.4G 0 part /
df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 113G 2.2G 106G 2% /
在使用一段时间后, U 盘 异常,系统被重新挂载为只读。
touch ~/test
touch: cannot touch '/home/admin/test': Read-only file system
dmesg 可看到异常信息,几个月前已经出问题了,因为系统还能正常使用暂且没管。
dmesg -T
[Tue Sep 7 16:48:16 2021] sd 2:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08 cmd_age=0s
[Tue Sep 7 16:48:16 2021] sd 2:0:0:0: [sda] tag#0 Sense Key : 0x7 [current]
[Tue Sep 7 16:48:16 2021] sd 2:0:0:0: [sda] tag#0 ASC=0x27 ASCQ=0x0
[Tue Sep 7 16:48:16 2021] sd 2:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 00 04 16 90 00 00 08 00
[Tue Sep 7 16:48:16 2021] blk_update_request: critical target error, dev sda, sector 267920 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 0
[Tue Sep 7 16:48:16 2021] Buffer I/O error on dev sda2, logical block 466, lost async page write