Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: e2fsck has unsupported feature(s): FEATURE_C12 #229450

Closed
lucky9-cyou opened this issue May 2, 2023 · 8 comments
Closed

[BUG]: e2fsck has unsupported feature(s): FEATURE_C12 #229450

lucky9-cyou opened this issue May 2, 2023 · 8 comments
Labels
0.kind: bug Something is broken

Comments

@lucky9-cyou
Copy link
Contributor

Describe the bug

When I mounted my archlinux ext4 partition, add following lines in hardware-configure.nix:

fileSystems."/mnt/archlinux" =
  { device = "/dev/disk/by-uuid/83cd3978-aa18-4f38-b1cb-3d77ab8f46ea";
    fsType = "ext4";
    options = ["nofail"];
  };

I got following error:

warning: the following units failed: systemd-fsck@dev-disk-by\x2duuid-83cd3978\x2daa18\x2d4f38\x2db1cb\x2d3d77ab8f46ea.service

× systemd-fsck@dev-disk-by\x2duuid-83cd3978\x2daa18\x2d4f38\x2db1cb\x2d3d77ab8f46ea.service - File System Check on /dev/disk/by-uuid/83cd3978-aa18-4f38-b1cb-3d77ab8f46ea
     Loaded: loaded (/etc/systemd/system/systemd-fsck@.service; static)
    Drop-In: /nix/store/jw3fxhphlsclz87w4sl8iax1k7zmxfc9-system-units/systemd-fsck@.service.d
             └─overrides.conf
     Active: failed (Result: exit-code) since Tue 2023-05-02 18:12:16 CST; 51ms ago
       Docs: man:systemd-fsck@.service(8)
    Process: 4492 ExecStart=/nix/store/zbgzqym70ca90228l9z9jzzwbn0wdd22-systemd-253.3/lib/systemd/systemd-fsck /dev/disk/by-uuid/83cd3978-aa18-4f38-b1cb-3d77ab8f46ea (code=exited, status=1/FAILURE)
   Main PID: 4492 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
        CPU: 4ms

May 02 18:12:16 nixos systemd[1]: Starting File System Check on /dev/disk/by-uuid/83cd3978-aa18-4f38-b1cb-3d77ab8f46ea...
May 02 18:12:16 nixos systemd-fsck[4494]: /dev/nvme0n1p2 has unsupported feature(s): FEATURE_C12
May 02 18:12:16 nixos systemd-fsck[4494]: e2fsck: Get a newer version of e2fsck!
May 02 18:12:16 nixos systemd-fsck[4494]: /dev/nvme0n1p2: ********** WARNING: Filesystem still has errors **********
May 02 18:12:16 nixos systemd-fsck[4492]: fsck failed with exit status 12.
May 02 18:12:16 nixos systemd[1]: systemd-fsck@dev-disk-by\x2duuid-83cd3978\x2daa18\x2d4f38\x2db1cb\x2d3d77ab8f46ea.service: Main process exited, code=exited, status=1/FAILURE
May 02 18:12:16 nixos systemd[1]: systemd-fsck@dev-disk-by\x2duuid-83cd3978\x2daa18\x2d4f38\x2db1cb\x2d3d77ab8f46ea.service: Failed with result 'exit-code'.
May 02 18:12:16 nixos systemd[1]: Failed to start File System Check on /dev/disk/by-uuid/83cd3978-aa18-4f38-b1cb-3d77ab8f46ea.
warning: error(s) occurred while switching to the new configuration

And I use e2fsck 1.47.0, I didn't get this error. The output is following:

[lucky@nixos:~/Downloads/e2fsprogs-1.47.0/e2fsck]$ sudo ./e2fsck /dev/nvme0n1p2
e2fsck 1.47.0 (5-Feb-2023)
/dev/nvme0n1p2: clean, 1738331/122036224 files, 65701918/488128256 blocks

My current e2fsck version is 1.46.6. Maybe we need to update the e2fsck version with unstable channel.

@lucky9-cyou lucky9-cyou added the 0.kind: bug Something is broken label May 2, 2023
@samueljohnson
Copy link

Ditto.

Jun 17 13:10:35 asus kernel: scsi 6:0:0:0: Direct-Access     Sony     Storage Media    0100 PQ: 0 ANSI: 4
Jun 17 13:10:35 asus kernel: sd 6:0:0:0: [sdb] 61523712 512-byte logical blocks: (31.5 GB/29.3 GiB)
Jun 17 13:10:35 asus kernel: sd 6:0:0:0: [sdb] Write Protect is off
Jun 17 13:10:35 asus kernel: sd 6:0:0:0: [sdb] Mode Sense: 43 00 00 00
Jun 17 13:10:35 asus kernel: sd 6:0:0:0: [sdb] No Caching mode page found
Jun 17 13:10:35 asus kernel: sd 6:0:0:0: [sdb] Assuming drive cache: write through
Jun 17 13:10:35 asus kernel:  sdb: sdb1
Jun 17 13:10:35 asus kernel: sd 6:0:0:0: [sdb] Attached SCSI removable disk
Jun 17 13:10:35 asus systemd[1]: Found device Storage_Media SONY.
Jun 17 13:10:35 asus systemd[1]: Starting File System Check on /dev/disk/by-uuid/05911a4b-d998-4e2c-9bb4-eec762818
7e1...
Jun 17 13:10:35 asus systemd-fsck[1443]: /dev/sdb1 has unsupported feature(s): FEATURE_C12
Jun 17 13:10:35 asus systemd-fsck[1443]: e2fsck: Get a newer version of e2fsck!
Jun 17 13:10:35 asus systemd-fsck[1443]: SONY: ********** WARNING: Filesystem still has errors **********
Jun 17 13:10:35 asus systemd-fsck[1441]: fsck failed with exit status 12.
Jun 17 13:10:35 asus systemd[1]: systemd-fsck@dev-disk-by\x2duuid-05911a4b\x2dd998\x2d4e2c\x2d9bb4\x2deec7628187e1
.service: Main process exited, code=exited, status=1/FAILURE
Jun 17 13:10:35 asus systemd[1]: systemd-fsck@dev-disk-by\x2duuid-05911a4b\x2dd998\x2d4e2c\x2d9bb4\x2deec7628187e1
.service: Failed with result 'exit-code'.
Jun 17 13:10:35 asus systemd[1]: Failed to start File System Check on /dev/disk/by-uuid/05911a4b-d998-4e2c-9bb4-ee
c7628187e1.
Jun 17 13:10:35 asus systemd[1]: Dependency failed for /mnt/sony.
Jun 17 13:10:35 asus systemd[1]: Dependency failed for Local File Systems.
Jun 17 13:10:35 asus systemd[1]: local-fs.target: Job local-fs.target/start failed with result 'dependency'.
Jun 17 13:10:35 asus systemd[1]: local-fs.target: Triggering OnFailure= dependencies.
Jun 17 13:10:35 asus systemd[1]: mnt-sony.mount: Job mnt-sony.mount/start failed with result 'dependency'.

@lucky9-cyou
Copy link
Contributor Author

The update has been merged. And the unstable channel of nixpkgs has been updated too. I will close this issue.

@da-the-dev
Copy link

da-the-dev commented Jun 20, 2023

I'm trying to dualboot Arch and nixos and get this error during installation. I chose the option "Install alongside". I've tried to install the freshest e2fsck manually, but to no avail. Is it possible to dualboot this way, or should I completely reinstall?

I even tried an older version of nixos, nixos-plasma5-22.05.998.d17a56d90ec-x86_64-linux, but that also didn't work.

I tried installing on a fresh VM and everything went smoothly, so Arch must be somehow interfering with the install.

@lucky9-cyou
Copy link
Contributor Author

Perhaps you should not use the option "install alongside". I'm also dual booting arch and nixos, but I put them on different disks and created /boot and / directory for each one.

@da-the-dev
Copy link

Perhaps you should not use the option "install alongside". I'm also dual booting arch and nixos, but I put them on different disks and created /boot and / directory for each one.

Well, I wish I could do that, but my laptop doesn't have 2 disk slots, so this is still an issue.

@7c6f434c
Copy link
Member

Maybe boot from a live medium of Arch to shrink the partition there, so that NixOS install doesn't need to touch the existing / ? (BTW, I have used two separate UEFI system partitions on the same disk, this is motherboard-dependent, but with some laptops it works fine)

@MarSoft
Copy link

MarSoft commented Jul 2, 2023

If you encounter this too (especially on something like Raspberry), you can use the following workaround.
According to release notes, the feature added in version 1.47.0 is orphan_file. And it was also added to the list of default features for e2fsck.
So if a filesystem was created with e2fsck 1.47.0 then it will have this feature enabled by default.

You can disable this feature on an already-created filesystem, but it should not mounted. (You may have to boot from live-USB or something.) Disable it as follows:

  1. tune2fs -O ^orphan_file /dev/mydevice
  2. e2fsck -f /dev/mydevice

The 2nd command will find and remove the inodes related to this feature.

@bphd
Copy link

bphd commented Oct 20, 2023

If you encounter this too (especially on something like Raspberry), you can use the following workaround. According to release notes, the feature added in version 1.47.0 is orphan_file. And it was also added to the list of default features for e2fsck. So if a filesystem was created with e2fsck 1.47.0 then it will have this feature enabled by default.

You can disable this feature on an already-created filesystem, but it should not mounted. (You may have to boot from live-USB or something.) Disable it as follows:

  1. tune2fs -O ^orphan_file /dev/mydevice
  2. e2fsck -f /dev/mydevice

The 2nd command will find and remove the inodes related to this feature.

Careful as in zsh ^orphan_file develop as same as * (so basically all pwd files)

Maybe a patch should be made to give the 1.47.0 feature in 23.05. Or maybe a patch to automatically perform those two commands on any ext4 at boot, because actually 23.05 can't use those new filesystems as is

And maybe add # before the command to indicate that on default/normal/common systems, root rights will be needed to perform actions on /dev/*

Those are meant to be applied once, or each time 1.47.0 touch it, runs? Each NixOS 23.05 boot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

6 participants