我使用parted 程序来调整我的/home
(已安装)分区的大小。/home
有 420 GB(已使用 60 GB),我将大小调整为 320 GB(现在有 100 GB 可用)。当我重新启动计算机时,我无法启动文件系统检查并在 arch 上启动紧急模式。所以我 umount /dev/sda4
(home) 运行fsck /dev/sda4
,当我尝试挂载时,我的文件系统类型错误,选项错误,/dev/sda4 上的超级块错误,系统仍然不想启动。
编辑:我需要来自该分区的数据,也许会获得访问权限并复制其他分区上的最重要数据并删除 sda4 ?但我不知道如何访问这些数据。
lsblk
:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
|-sda1 8:1 0 256M 0 part /boot
|-sda2 8:2 0 6G 0 part [SWAP]
|-sda3 8:3 0 40G 0 part /
`-sda4 8:4 0 419.4G 0 part
sr0 11:0 1 742M 0 rom
dmesg | tail
[ 67.769679] xor: using function: prefetch64-sse (6108.000 MB/sec)
[ 67.828384] Btrfs loaded
[ 140.029658] sda: sda1 sda2 sda3 sda4
[ 348.916444] sda: sda1 sda2 sda3 sda4
[ 731.875551] EXT4-fs (sda4): bad geometry: block count 109972230 exceeds size of device (85531834 blocks)
[ 737.760531] EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem
[ 737.805255] EXT4-fs (sda1): mounted filesystem without journal. Opts: (null)
[ 767.421212] EXT4-fs (sda4): bad geometry: block count 109972230 exceeds size of device (85531834 blocks)
[ 769.639095] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[ 2340.076115] EXT4-fs (sda4): bad geometry: block count 109972230 exceeds size of device (85531834 blocks)
日记的碎片
-- Logs begin at Tue 2015-10-27 15:56:01 CET, end at Mon 2016-10-17 17:16:55 CEST. --
Oct 17 17:16:46 iam systemd-journald[146]: Runtime journal (/run/log/journal/) is 8.0M, max 285.7M, 277.7M free.
-- Subject: Disk space used by the journal
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Runtime journal (/run/log/journal/) is currently using 8.0M.
-- Maximum allowed usage is set to 285.7M.
-- Leaving at least 428.6M free (of currently available 2.7G of disk space).
-- Enforced usage limit is thust 17 17:16:47 iam kernel: Urtc0
-- The start-up result is done.
Oct 17 17:16:54 iam systemd-fsck[374]: /dev/sda4: The filesystem size (according to the superblock) is 109972230 blocks
Oct 17 17:16:54 iam systemd-fsck[374]: The physical size of the device is 109945896 blocks
Oct 17 17:16:54 iam systemd-fsck[374]: Either the superblock or the partition table is likely to be corrupt!
Oct 17 17:16:54 iam systemd-fsck[374]: /dev/sda4: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
Oct 17 17:16:54 iam systemd-fsck[374]: (i.e., without -a or -p options)
Oct 17 17:16:54 iam systemd-fsck[374]: fsck failed with error code 4.
Oct 17 17:16:54 iam systemd-fsck[374]: Running request emergency.target/start/replace
Oct 17 17:16:54 iam systemd[1]: Mounting /boot...
-- Subject: Unit boot.mount has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit boot.mount has begun starting up.
Oct 17 17:16:54 iam systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 17 17:16:54 iam systemd[1]: Failed to start File System Check on /dev/sda4.
-- Subject: Unit [email protected] has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit [email protected] has failed.
--
-- The result is failed.
Oct 17 17:16:54 iam systemd[1]: Dependency failed for /home.
-- Subject: Unit home.mount has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit home.mount has failed.
-- The result is dependency.
Oct 17 17:16:54 iam systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
Oct 17 17:16:54 iam systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
Oct 17 17:16:54 iam systemd[1]: home.mount: Job home.mount/start failed with result 'dependency'.
Oct 17 17:16:54 iam systemd[1]: [email protected]: Unit entered failed state.
Oct 17 17:16:54 iam systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 17 17:16:54 iam systemd[1]: Reached target Network.
-- Subject: Unit network.target has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Userspace start-up required 11995553 microseconds.
Oct 17 17:16:55 iam systemd[468]: emergency.service: Failed at step EXEC spawning /bin/plymouth: No such file or directory
-- Subject: Process /bin/plymouth could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /bin/plymouth could not be executed and failed.
--
-- The error number returned by this process is 2.
blkid
/dev/sda1: UUID="a60f7835-d787-4794-889e-1229c3788b5a" TYPE="ext2" PARTUUID="e10910a7-01"
/dev/sda2: UUID="4d2bdad8-2c4f-45de-bc11-c02a690d2bdf" TYPE="swap" PARTUUID="e10910a7-02"
/dev/sda3: UUID="a17f1309-204d-4aea-abda-7ef7e1dcae05" TYPE="ext4" PARTUUID="e10910a7-03"
/dev/sda4: UUID="af1e2c37-517c-4d5c-8a0e-76d67b1b84ca" TYPE="ext4" PARTUUID="e10910a7-04"
/dev/sr0: UUID="2016-08-01-16-33-35-00" LABEL="ARCH_201608" TYPE="iso9660" PTUUID="38ab083f" PTTYPE="dos"
/dev/sdb1: UUID="2016-06-11-19-19-51-00" LABEL="MJRO1606" TYPE="iso9660" PTUUID="62cadc67" PTTYPE="dos" PARTUUID="62cadc67-01"
/dev/sdb2: SEC_TYPE="msdos" LABEL="MISO_EFI" UUID="F6E9-DC96" TYPE="vfat" PARTUUID="62cadc67-02"
答案1
问题是,您在没有先调整文件系统大小的情况下调整了分区大小,因此您砍掉了部分文件系统,现在它处于文件系统记录显示它比实际大小更大的状态,并且考虑到其余部分就崩溃了是有缺陷的,而实际上并不存在。
一种可能的解决方案是将分区恢复到其原始大小,但我不是指 GiB 大小,它必须与e2fsck
实际工作的块大小完全相同,所以如果分区的其余部分仍然没有改变,这应该没有问题,只需再次将其增长到最大值。
一旦分区达到原始大小,就可以运行e2fsck -f /dev/sda4
该工具,现在该工具应该修复您的文件系统。现在修复后,首先使用缩小文件系统resize2fs
,在缩小 FS 后,您可以将分区缩小到与缩小 FS 完全相同的大小。
但我有一些坏消息要告诉你,因为你调整了分区的大小,但没有调整文件系统的大小,一些文件可能已经在擦除的部分,并且可能会丢失。