我今天启动了我的笔记本电脑并得到了这个:
我应该做些什么?谢谢
我在 VMWare 虚拟机中运行 Ubuntu 18.04。发生了一些事情,导致显然存在 I/O 问题。每次我启动机器时,大约 1 分钟后,整个文件系统/dev/sda1
就会进入只读模式,大概是由内核设置的。
我已经重新启动,当我重新启动时,我被带到一个 initramfs 提示符,然后我尝试了有关如何修复“sudo:无法打开...只读文件系统”的建议?除了重新挂载,因为如果内核确实将其放入 ro 以保护数据完整性,我不想这样做。
当我运行时fsck -yf /dev/sda1
,它修复了一些 inode 错误和其他一些问题,然后我再次运行,同样的事情,最后,没有更多错误......我继续启动过程,大约 1 或 2 分钟后,整个文件系统锁定再次。我什至不能插入一个驱动器来复制文件,因为它不能安装在只读文件系统上。我不能去网站上传我的文件,因为浏览器不能在只读文件系统上工作,等等......
我现在想要做的是备份数据,所以我想知道我怎么能做到这一点,因为这是一个 VMWare 虚拟机,它不是在裸机上。在裸机上,我可能会插入一个 LiveCD 并尝试启动它,但我不确定如何为 VMWare 执行此操作,以及是否有替代选项。该磁盘是一个虚拟 VMWare 磁盘,我的底层硬件没有物理问题,因为我的其他 VM 和主机都很好。
每当我尝试运行以下命令时:
sudo apt-get install
sudo apt-get upgrade
sudo apt-get update
我立即收到以下错误消息:
apt-get: error while loading shared libraries: liblz4.so.1: cannot open shared object file: No such file or directory.
当我使用 apt 而不是 apt-get 时,情况相同。
PS:我不知道这个问题是否与我面临的另一个问题有关,我系统中的每个文件都变为只读,唯一的解决方案是运行 fsck /dev/sda9
. 这种情况时不时地发生在任何随机时间。
当我跑
sudo dosfsck -w -r -l -a -v -t /dev/disk2s2
它似乎只是在初始日志消息之后挂起。它正在执行非常低的磁盘 I/O(在一小时内读取 50MB)并且 CPU 使用率接近 0。以下是我得到的日志:
fsck.fat 4.1 (2017-01-24)
Checking we can access the last sector of the filesystem
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
71:42/55, 72:45/4e, 73:48/54, 74:20/49, 75:20/54, 76:20/4c, 77:20/45
, 78:20/44
Not automatically fixing this.
Boot sector contents:
System ID "BSD 4.4"
Media byte 0xf8 (hard disk)
512 bytes per logical sector
32768 bytes per cluster
32 reserved sectors
First FAT starts at byte 16384 (sector 32)
2 FATs, 32 bit entries
244100096 bytes per FAT (= 476758 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 488216576 (sector 953548)
61024972 data clusters (1999666282496 bytes)
32 sectors/track, 255 heads
409640 hidden sectors
3906551768 sectors total
请注意,我的磁盘是 FAT32 格式。这是正常的吗?我什么时候可以期待它完成?有没有办法看到它的进展?
我陷入了这个问题。桌面计算机上的fsck命令显示挂载根目录的文件系统错误。所以,我创建了 Ubuntu 的可启动 U 盘,并让它启动。然后,我尝试通过在 USB 记忆棒上执行fsck来修复文件系统错误,因为fsck无法修复已安装的目录。但是,U 盘上的fsck没有显示错误。我应该如何修复这个文件系统错误?
(台式电脑上的fsck )
$ sudo fsck -nf /dev/nvme0n1p2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
Warning! /dev/nvme0n1p2 is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
Pass 1: Checking inodes, blocks, and sizes
Inodes that were part of a corrupted orphan linked list found. Fix? no
Inode 6816186 was part of the orphaned inode list. IGNORED.
Inode 6816770 was part of the orphaned inode list. IGNORED.
Inode 6883264 was part of the orphaned inode list. IGNORED.
Inode 6883789 was part of the orphaned inode list. IGNORED.
Inode 6887919 was part of the orphaned inode list. IGNORED.
Inode 6887920 was part of the orphaned inode list. IGNORED.
Inode 6887925 was part of the orphaned inode list. IGNORED.
Inode 6887929 was part of the orphaned inode list. IGNORED.
Deleted inode 6887947 has zero dtime. Fix? no
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -(9588738--9588745) -(9588760--9588764) -(9597955--9597964) -(9998851--9998855) -(27306830--27306834) -(27307548--27307557) -34598400
Fix? no
Free blocks count wrong (43144465, counted=43144229).
Fix? no
Inode bitmap differences: -6816186 -6816770 -6883264 -6883789 -(6887919--6887920) -6887925 -6887929 -6887947
Fix? no
Free inodes count wrong (14401240, counted=14401183).
Fix? no
/dev/nvme0n1p2: ********** WARNING: Filesystem still has errors **********
/dev/nvme0n1p2: 557352/14958592 files (0.5% non-contiguous), 16670447/59814912 blocks
(可启动 U 盘上的fsck )
ubuntu@ubuntu:~$ sudo fsck -fy /dev/nvme0n1p2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
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
/dev/nvme0n1p2: 557879/14958592 files (0.6% non-contiguous), 16680714/59814912 blocks
ubuntu@ubuntu:~$ sudo fsck -fn /dev/nvme0n1p2
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
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
/dev/nvme0n1p2: 557879/14958592 files (0.6% non-contiguous), 16680714/59814912 blocks
ubuntu@ubuntu:~$
供参考:
适用于桌面和可启动 U 盘的 Ubuntu 18.04 LTS
xterm 可以打开时,终端窗口无法打开。我认为文件系统错误可能会影响此打开失败。
我一直遇到系统进入只读状态的问题。我可以进行其他问题中描述的修复(例如Read-only filesystem error),这可以修复它〜一天。但是每天在启动时问题都会回来。
我的问题不是如何修复它,而是有什么方法可以让我诊断出可能是什么特定软件导致了这种情况?
编辑:
在下面添加 syslog 输出,通过对这些错误消息进行一些搜索,我的理解是没有什么特别的这样做;它只是反复找不到好块(即死驱动器)?
Jun 26 10:03:53 mal NetworkManager[1298]: <info> [1593180233.9376] manager: NetworkManager state is now CONNECTED_GLOBAL
Jun 26 10:04:03 mal systemd[1]: NetworkManager-dispatcher.service: Succeeded.
Jun 26 10:04:24 mal anacron[1290]: Job `cron.daily' terminated
Jun 26 10:04:24 mal anacron[1290]: Normal exit (1 job run)
Jun 26 10:04:24 mal systemd[1]: anacron.service: Succeeded.
Jun 26 10:05:01 mal CRON[7965]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jun 26 10:07:00 mal systemd-resolved[1282]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with reduced feature level UDP.
Jun 26 10:07:07 mal kernel: [ 529.845356] ata1.00: READ LOG DMA EXT failed, trying PIO
Jun 26 10:07:07 mal kernel: [ 529.846653] ata1.00: exception Emask 0x0 SAct 0x1000000 SErr 0x0 action 0x0
Jun 26 10:07:07 mal kernel: [ 529.846656] ata1.00: irq_stat 0x40000008
Jun 26 10:07:07 mal kernel: [ 529.846659] ata1.00: failed command: READ FPDMA QUEUED
Jun 26 10:07:07 mal kernel: [ 529.846663] ata1.00: cmd 60/08:c0:e8:47:91/00:00:14:00:00/40 tag 24 ncq dma 4096 in
Jun 26 10:07:07 mal kernel: [ 529.846663] res 41/40:00:ec:47:91/00:00:14:00:00/00 Emask 0x409 (media error) <F>
Jun 26 10:07:07 mal kernel: [ 529.846665] ata1.00: status: { DRDY ERR }
Jun 26 10:07:07 mal kernel: [ 529.846666] ata1.00: error: { UNC }
Jun 26 10:07:07 mal kernel: [ 529.852714] ata1.00: configured for UDMA/133
Jun 26 10:07:07 mal kernel: [ 529.852746] sd 0:0:0:0: [sda] tag#24 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jun 26 10:07:07 mal kernel: [ 529.852749] sd 0:0:0:0: [sda] tag#24 Sense Key : Medium Error [current]
Jun 26 10:07:07 mal kernel: [ 529.852752] sd 0:0:0:0: [sda] tag#24 Add. Sense: Unrecovered read error - auto reallocate failed
Jun 26 10:07:07 mal kernel: [ 529.852755] sd 0:0:0:0: [sda] tag#24 CDB: Read(10) 28 00 14 91 47 e8 00 00 08 00
Jun 26 10:07:07 mal kernel: [ 529.852758] blk_update_request: I/O error, dev sda, sector 345065452 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Jun 26 10:07:07 mal kernel: [ 529.852779] ata1: EH complete
Jun 26 10:07:07 mal kernel: [ 529.852805] EXT4-fs warning (device sda2): htree_dirblock_to_tree:997: inode #10763504: lblock 0: comm duplicity: error -5 reading directory block
Jun 26 10:07:07 mal kernel: [ 529.950532] ata1.00: exception Emask 0x0 SAct 0x3 SErr 0x0 action 0x0
Jun 26 10:07:07 mal kernel: [ 529.950534] ata1.00: irq_stat 0x40000008
Jun 26 10:07:07 mal kernel: [ 529.950536] ata1.00: failed command: READ FPDMA QUEUED
Jun 26 10:07:07 mal kernel: [ 529.950538] ata1.00: cmd 60/08:00:e8:47:91/00:00:14:00:00/40 tag 0 ncq dma 4096 in
Jun 26 10:07:07 mal kernel: [ 529.950538] res 41/40:00:ec:47:91/00:00:14:00:00/00 Emask 0x409 (media error) <F>
Jun 26 10:07:07 mal kernel: [ 529.950539] ata1.00: status: { DRDY ERR }
Jun 26 10:07:07 mal kernel: [ 529.950540] ata1.00: error: { UNC }
Jun 26 10:07:07 mal kernel: [ 529.956788] ata1.00: configured for UDMA/133
Jun 26 10:07:07 mal kernel: [ 529.956808] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
Jun 26 10:07:07 mal kernel: [ 529.956810] sd 0:0:0:0: [sda] tag#0 Sense Key : Medium Error [current]
Jun 26 10:07:07 mal kernel: [ 529.956811] sd 0:0:0:0: [sda] tag#0 Add. Sense: Unrecovered read error - auto reallocate failed
Jun 26 10:07:07 mal kernel: [ 529.956813] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 14 91 47 e8 00 00 08 00
Jun 26 10:07:07 mal kernel: [ 529.956814] blk_update_request: I/O error, dev sda, sector 345065452 op 0x0:(READ) flags 0x3000 phys_seg 1 prio class 0
Jun 26 10:07:07 mal kernel: [ 529.956838] ata1: EH complete
Jun 26 10:07:07 mal kernel: [ 529.956840] EXT4-fs error (device sda2): __ext4_find_entry:1531: inode #10763504: comm deja-dup: reading directory lblock 0
6 月 29 日更新
边注; 自从我从桌面拔下 Kindle 后,这个错误已经 3 天多没有发生了。我不知道这是否与它有关;但只是在这里为更多了解的人提一下。
从 live CD 启动:检查驱动器的输出
此外, smartctl 输出。我似乎无法-t long
真正完成测试,但简短的测试似乎很好。
ubuntu@ubuntu:~$ sudo smartctl -a /dev/sda2
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-26-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Marvell based SanDisk SSDs
Device Model: SanDisk SSD PLUS 1000GB
Serial Number: 190532802370
LU WWN Device Id: 5 001b44 8b92df610
Firmware Version: UH5100RL
User Capacity: 1,000,207,286,272 bytes [1.00 TB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2 T13/2015-D revision 3
SATA Version is: SATA 3.2, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Mon Jun 29 23:21:35 2020 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 120) seconds.
Offline data collection
capabilities: (0x15) SMART execute Offline immediate.
No Auto Offline data collection support.
Abort Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
No Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 182) minutes.
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 3921
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 353
165 Total_Write/Erase_Count 0x0032 100 100 000 Old_age Always - 1045
166 Min_W/E_Cycle 0x0032 100 100 --- Old_age Always - 4
167 Min_Bad_Block/Die 0x0032 100 100 --- Old_age Always - 0
168 Maximum_Erase_Cycle 0x0032 100 100 --- Old_age Always - 14
169 Total_Bad_Block 0x0032 100 100 --- Old_age Always - 1688
170 Unknown_Attribute 0x0032 100 100 --- Old_age Always - 0
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
173 Avg_Write/Erase_Count 0x0032 100 100 000 Old_age Always - 4
174 Unexpect_Power_Loss_Ct 0x0032 100 100 000 Old_age Always - 17
184 End-to-End_Error 0x0032 100 100 --- Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 34
188 Command_Timeout 0x0032 100 100 --- Old_age Always - 0
194 Temperature_Celsius 0x0022 065 055 000 Old_age Always - 35 (Min/Max 17/55)
199 SATA_CRC_Error 0x0032 100 100 --- Old_age Always - 0
230 Perc_Write/Erase_Count 0x0032 100 100 000 Old_age Always - 610 80 610
232 Perc_Avail_Resrvd_Space 0x0033 100 100 005 Pre-fail Always - 100
233 Total_NAND_Writes_GiB 0x0032 100 100 --- Old_age Always - 4201
234 Perc_Write/Erase_Ct_BC 0x0032 100 100 000 Old_age Always - 16347
241 Total_Writes_GiB 0x0030 100 100 000 Old_age Offline - 6893
242 Total_Reads_GiB 0x0030 100 100 000 Old_age Offline - 3558
244 Thermal_Throttle 0x0032 000 100 --- Old_age Always - 0
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 3921 -
# 2 Extended offline Fatal or unknown error 90% 3920 0
# 3 Short offline Completed without error 00% 3919 -
# 4 Extended offline Fatal or unknown error 90% 3889 0
# 5 Extended offline Self-test routine in progress 90% 3888 -
# 6 Extended offline Self-test routine in progress 90% 3888 -
# 7 Extended offline Self-test routine in progress 90% 3888 -
# 8 Extended offline Self-test routine in progress 90% 3888 -
# 9 Extended offline Self-test routine in progress 90% 3888 -
#10 Extended offline Self-test routine in progress 90% 3888 -
#11 Extended offline Self-test routine in progress 90% 3888 -
#12 Extended offline Self-test routine in progress 90% 3888 -
#13 Extended offline Self-test routine in progress 90% 3888 -
#14 Extended offline Self-test routine in progress 90% 3888 -
#15 Extended offline Self-test routine in progress 90% 3888 -
#16 Extended offline Self-test routine in progress 90% 3888 -
#17 Extended offline Self-test routine in progress 90% 3888 -
#18 Extended offline Self-test routine in progress 90% 3888 -
#19 Extended offline Self-test routine in progress 90% 3888 -
#20 Extended offline Self-test routine in progress 90% 3888 -
#21 Extended offline Self-test routine in progress 90% 3888 -
Selective Self-tests/Logging not supported
通常当我启动我的系统时,我会被带到 Busybox initramfs 屏幕。我要做:
fsck /dev/sda2
让它恢复正常(几个修复选项,比如缺少 inode,来吧。我应该记下错误,也许下次我会这样做并在这里更新)。有时,在我登录时会发生这种情况。所有文件系统都变为只读(apt update返回错误)并且必须再次调用fsck进行救援。这主要发生在我使用 Skype 之后,但这可能不相关。我的硬盘驱动器出现故障了吗?(SMART 状态显示正常)。或者是别的什么?
PS:我最近也切换到了 Ubuntu 20.04,在此之前没有发生这种情况。
我的 ThinkPad T420 上运行着 Ubuntu 20.04(最近从 19.10 升级),几天后我遇到了 Ubuntu 停止启动的问题,屏幕上只显示
/dev/mapper/ubuntu--vg-root: clean, 1737827/15081472 files, 51603057/60309504 bl
ocks
_
并在下一行闪烁提示。
没有错误消息,提示不接受任何输入,对特殊键(如 Esc、F 键、Strg + C、Enter)没有反应……如果我等待,则不会发生其他任何事情。
当它第一次发生时,经过几次关机/启动循环后,Ubuntu 登录屏幕出现了。所以这似乎是一个随机的烦恼。但是由于我昨天必须重新启动(经过一些更新),所以我很不走运。每次尝试时,启动都会在此屏幕停止。
我发现了大量关于如何解决不同类型问题的建议/dev/mapper/ubuntu--vg-root
(Ubuntu 启动到 busybox,Ubuntu 启动到 initramfs,...),但是所有这些问题都伴随着相关的错误消息,提示出了什么问题。它们都不完全适合我的问题。因此,我随机尝试了一些似乎合适的建议,以获取有关该问题和可能修复的更多信息,但到目前为止没有运气。
所以我希望你们中的一个人知道更多关于这个问题的信息,并且可以帮助我解决它。
我在系统上试过的:
sudo apt update && sudo apt upgrade lvm2
--> 升级 LVM2 告诉我当前版本(2.03.07-1ubuntu1)已经安装卸下 SSD 并将其放回原处(以排除连接问题)-> 没有帮助
然后我从现场棒启动并尝试了以下操作:
mount /dev/mapper/ubuntu--vg-root /mnt
工作,我可以访问文件系统,所以显然它不是许多帖子所说的加密分区。我能够将我的主目录完整备份到外部 USB 驱动器(耶!)udisksctl unlock -b /dev/sda5
确认分区未加密 --> “对象 /org/freedesktop/UDisks2/block_devices/sda5 不是加密设备。”在我的实验中,有一件事引起了我的注意:
我是fsck /dev/mapper/ubuntu--vg-root
从现场棒上做的:
ubuntu@ubuntu:~$ sudo su
root@ubuntu:/home/ubuntu# fsck /dev/mapper/ubuntu--vg-root
fsck from util-linux 2.34
e2fsck 1.45.5 (07-Jan-2020)
/dev/mapper/ubuntu--vg-root: clean, 1737833/15081472 files, 51605368/60309504 blocks
root@ubuntu:/home/ubuntu#
当它在引导期间挂起时,它会提供与 ubuntu 显示的相同的输出。所以我假设 Ubuntu 在启动时执行 fsck 时卡住了。但为什么?
这可能不是 ubuntu-vg-root 的问题,而是在引导过程中出现的任何问题?我如何知道接下来会发生什么?
我希望你们中的一个人对这件事有更多的了解,并能给我一个提示。
在此先感谢弗雷德