笔记本电脑(联想 T520)掉到地上后,我的硬盘(Crucial_CT240M500SSD3)在启动时开始发出咔嗒声,并在启动时开始收到以下消息:
2100: Detection error on HDD0 (Main HDD)
因此我推测我的磁盘已损坏,并且无法进入 Ubuntu 的登录屏幕,因为它总是启动到紧急模式。
You are in emergency mode.
After logging in, type "journalctl -xb" to view system logs,
"systemctl reboot" to reboot, "systemctl default"
or ^D to try again to boot into default mode".
我的主要目标是检索个人数据并将其保存到外部磁盘。
问题是我的/home
目录是空的。我找到了很多方法来解决此问题,但都没有效果,我不知道还能尝试什么。
在我的 中,我有和/etc/fstab
的单独条目,但是在安装 Ubuntu 期间我没有为 home 创建单独的分区(至少没有手动创建):/
/home
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb1 during installation
UUID=99d3a843-b520-41c0-bc80-e64fb67439c8 / ext4 errors=remount-ro 0 1
# /home was on /dev/sda1 during installation
UUID=f0b370b3-90d8-46ca-956f-f620b5c40536 /home ext4 defaults 0 2
# swap was on /dev/sdb5 during installation
UUID=0e4c9122-3317-4478-bc6b-852415505118 none swap sw 0 0
journalctl -xb
UUID安装/home
失败的代码片段
...
dec 10 12:11:18 jp-pc kernel: input: HDA NVidia HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1/input17
dec 10 12:11:18 jp-pc systemd[1]: Received SIGRTMIN+20 from PID 384 (plymouthd).
dec 10 12:11:27 jp-pc kernel: thinkpad_acpi: EC reports that Thermal Table has changed
dec 10 12:12:45 jp-pc systemd[1]: dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.device: Job dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.device/start timed out.
dec 10 12:12:45 jp-pc systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.device.
-- Subject: Unit dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.device has failed
-- Defined-By: systemd
-- ...
--
-- Unit dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.device has failed.
--
-- The result is RESULT.
dec 10 12:12:45 jp-pc systemd[1]: Dependency failed for /home.
-- Subject: Unit home.mount has failed
-- Defined-By: systemd
-- ...
--
-- Unit home.mount has failed.
--
-- The result is RESULT.
dec 10 12:12:45 jp-pc systemd[1]: Dependency failed for Local File Systems.
-- Subject: Unit local-fs.target has failed
-- Defined-By: systemd
-- ..
--
-- Unit local-fs.target has failed.
--
-- The result is RESULT.
dec 10 12:12:45 jp-pc systemd[1]: Dependency failed for Clean up any mess left by 0dns-up.
-- Subject: Unit dns-clean.service has failed
-- Defined-By: systemd
-- ...
--
-- Unit dns-clean.service has failed.
--
-- The result is RESULT.
dec 10 12:12:45 jp-pc systemd[1]: dns-clean.service: Job dns-clean.service/start failed with result 'dependency'.
dec 10 12:12:45 jp-pc systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
dec 10 12:12:45 jp-pc systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
dec 10 12:12:45 jp-pc systemd[1]: home.mount: Job home.mount/start failed with result 'dependency'.
dec 10 12:12:45 jp-pc systemd[1]: Dependency failed for File System Check on /dev/disk/by-uuid/f0b370b3-90d8-46ca-956f-f620b5c40536.
-- Subject: Unit systemd-fsck@dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.service has failed
-- Defined-By: systemd
-- ...
--
-- Unit systemd-fsck@dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.service has failed.
--
-- The result is RESULT.
dec 10 12:12:45 jp-pc systemd[1]: systemd-fsck@dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.service: Job systemd-fsck@dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.service/start failed with result 'dependency'.
dec 10 12:12:45 jp-pc systemd[1]: dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.device: Job dev-disk-by\x2duuid-f0b370b3\x2d90d8\x2d46ca\x2d956f\x2df620b5c40536.device/start failed with result 'timeout'.
...
fdisk
说分区不是从物理扇区边界开始的(我注意到 sda2 和 sda5 位于同一间隔):
$ fdisk -l
Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
Disk model: Crucial_CT240M50
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x021adb68
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 429799423 429797376 204.9G 83 Linux
/dev/sda2 429801470 468860927 39059458 18.6G 5 Extended
/dev/sda5 429801472 468860927 39059456 18.6G 82 Linux swap / Solaris
Partition 2 does not start on physical sector boundary.
blkid
(为方便阅读,删除了循环条目):
$ blkid
/dev/sda1: UUID="99d3a843-b520-41c0-bc80-e64fb67439c8" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="021adb68-01"
/dev/sda5: UUID="0e4c9122-3317-4478-bc6b-852415505118" TYPE="swap" PARTUUID="021adb68-05"
/dev/sda2
缺少,但是当我明确调用时:
$ blkid /dev/sda2
/dev/sda2: PTUUID:"d5620a3d" PTTYPE="dos" PARTUUID="021adb68-02"
lsblk
在 LiveOS 中(删除了循环条目以提高可读性)
$ lsblk -o NAME,RM,SIZE,TYPE,MOUNTPOINT,UUID
NAME RM SIZE RO TYPE MOUNTPOINT UUID
sda 0 223.6G 0 disk
├─sda1 0 204.9G 0 part /home/xx/mnt 99d3a843-b520-41c0-bc80-e64fb67439c8
├─sda2 0 1K 0 part
└─sda5 0 18.6G 0 part 0e4c9122-3317-4478-bc6b-852415505118
sr0 1 1024M 0 rom
在 中没有/home
(取自/etc/fstab
)的 UUID 条目/dev/disks/by-uuid/
。只有sda1
和sda5
。
如果需要任何其他信息,请告诉我。
我已经尝试过的:
- 在紧急模式下:
$ mount -o rw,remount /
$ mount -a
mount: /home: can't find UUID=f0b370b3-90d8-46ca-956f-f620b5c40536.
fsck
在我运行的LiveOS 中/dev/sda1
发现了很多坏扇区,但现在它恢复正常了。
$ fsck /dev/sda2
fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/sda2
Could this be a zero-length partition?
fsck.ext3
和的错误相同fsck.ext4
- 注释掉
/home
部分内容/etc/fstab
会带我进入 Ubuntu 登录屏幕,但输入密码后它冻结了。我认为这是因为/home
系统没有正确安装