1

I used parted program to resize my /home (mounted) partition. /home had 420 GB (60 GB used) and I resized to 320 GB (now is 100 GB free). And when I reboot computer I have had failed to start file system check and booted emergency mode on arch. So I umount /dev/sda4 (home) run fsck /dev/sda4 and when I have tried to mount I had wrong fs type, bad option, bad superblock on /dev/sda4 and system still don't want to boot.

EDIT: I need data from this partition, maybe will do get access and copy most important data on other partition and delete sda4 ? But i don't know how to get access to these data.

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)

pieces of journal

-- 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]: systemd-fsck@dev-sda4.service: 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 systemd-fsck@dev-sda4.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit systemd-fsck@dev-sda4.service 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]: systemd-fsck@dev-sda4.service: Unit entered failed state.
Oct 17 17:16:54 iam systemd[1]: systemd-fsck@dev-sda4.service: 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"
  • Have you expand your filesystem? lsblk -f – user192526 Oct 17 '16 at 15:06
  • nope I only resized sda4 – Klemens Oct 17 '16 at 15:31
  • I need the Filesystem. As root or with sudo. I am not familiar with Archblkid – user192526 Oct 17 '16 at 16:15
  • I added blkid respond above – Klemens Oct 17 '16 at 16:34
  • For security. Your /home was 420 GB, and is now 320 GB. My english is not good. Have you a backup from your data ? sudo resize2fs -p /dev/sda4 320 GB. And after that make filesystemcheck sudo fsck.ext4 /dev/sda4. Both from a Livesession. – user192526 Oct 17 '16 at 16:47
4

The problem is that you resized the partition without resizing the file system first, so you chopped part of the file system out and it now is in a state where the file system record says it's bigger than it actually is and goes belly up thinking the rest is faulty, when actually isn't there.

One possible solution is to grow your partition back to its original size, but I'm not talking in GiB size, it must be exactly the size in blocks for e2fsck to actually work, so this should be no problem if the rest of the partition is still there unaltered, just grow it to the max again.

Once the partition is it's original size run e2fsck -f /dev/sda4 and now the tool should repair your file system. After being repaired now first shrink the file system using resize2fs and after the FS is shunked you can shrink the partition to the exact same size you shrunked the FS.

But I have some bad news for you, since you resized the partition but not the file system, some files might have been in the wiped part, and might be lost.

  • Thanks a lot ! I successful mounted /home and I didn't lost any data ;) – Klemens Oct 18 '16 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.