You are not logged in.

#1 2021-12-26 21:49:43

Tid91
Member
Registered: 2013-12-01
Posts: 35
Website

[SOLVED] ZFS On root - Invalid or corrupt cachefile - Can't be deleted

I'm trying to reproduced the following configuration: https://openzfs.github.io/openzfs-docs/ … index.html. I'm experimenting on a server having 3x2Tb Hard disks and booting the archiso with QEMU from a rescue distribution, if I mount the filesystem:

zfs mount rpool/arch/ROOT/default
zfs mount bpool/arch/BOOT/default
zfs mount -a

I can't delete the

zpool.cache

file:

root@archiso ~ # rm -f /mnt/etc/zfs/zpool.cache
rm: cannot remove '/mnt/etc/zfs/zpool.cache': Operation not permitted

When booting, I get the `invalid or corrupt cachefile` and rpool can't be found. Help?

More details belows

Pools

:

   pool: bpool
     id: 6912980947795575950
  state: ONLINE
status: Some supported features are not enabled on the pool.
        (Note that they may be intentionally disabled if the
        'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
 config:

        bpool                                ONLINE
          mirror-0                           ONLINE
            ata-QEMU_HARDDISK_QM00001-part2  ONLINE
            ata-QEMU_HARDDISK_QM00002-part2  ONLINE
            ata-QEMU_HARDDISK_QM00003-part2  ONLINE

   pool: rpool
     id: 10636382966620723855
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        rpool                                ONLINE
          raidz1-0                           ONLINE
            ata-QEMU_HARDDISK_QM00001-part3  ONLINE
            ata-QEMU_HARDDISK_QM00002-part3  ONLINE
            ata-QEMU_HARDDISK_QM00003-part3  ONLINE
rpool properties
NAME   PROPERTY                       VALUE                          SOURCE
rpool  size                           5.44T                          -
rpool  capacity                       0%                             -
rpool  altroot                        /mnt                           local
rpool  health                         ONLINE                         -
rpool  guid                           10636382966620723855           -
rpool  version                        -                              default
rpool  bootfs                         rpool/arch/ROOT/default        local
rpool  delegation                     on                             default
rpool  autoreplace                    off                            default
rpool  cachefile                      none                           local
rpool  failmode                       wait                           default
rpool  listsnapshots                  off                            default
rpool  autoexpand                     off                            default
rpool  dedupratio                     1.00x                          -
rpool  free                           5.44T                          -
rpool  allocated                      2.15G                          -
rpool  readonly                       off                            -
rpool  ashift                         9                              local
rpool  comment                        -                              default
rpool  expandsize                     -                              -
rpool  freeing                        0                              -
rpool  fragmentation                  0%                             -
rpool  leaked                         0                              -
rpool  multihost                      off                            default
rpool  checkpoint                     -                              -
rpool  load_guid                      9665454758158715337            -
rpool  autotrim                       on                             local
rpool  compatibility                  off                            default
rpool  feature@async_destroy          enabled                        local
rpool  feature@empty_bpobj            active                         local
rpool  feature@lz4_compress           active                         local
rpool  feature@multi_vdev_crash_dump  enabled                        local
rpool  feature@spacemap_histogram     active                         local
rpool  feature@enabled_txg            active                         local
rpool  feature@hole_birth             active                         local
rpool  feature@extensible_dataset     active                         local
rpool  feature@embedded_data          active                         local
rpool  feature@bookmarks              enabled                        local
rpool  feature@filesystem_limits      enabled                        local
rpool  feature@large_blocks           enabled                        local
rpool  feature@large_dnode            active                         local
rpool  feature@sha512                 enabled                        local
rpool  feature@skein                  enabled                        local
rpool  feature@edonr                  enabled                        local
rpool  feature@userobj_accounting     active                         local
rpool  feature@encryption             enabled                        local
rpool  feature@project_quota          active                         local
rpool  feature@device_removal         enabled                        local
rpool  feature@obsolete_counts        enabled                        local
rpool  feature@zpool_checkpoint       enabled                        local
rpool  feature@spacemap_v2            active                         local
rpool  feature@allocation_classes     enabled                        local
rpool  feature@resilver_defer         enabled                        local
rpool  feature@bookmark_v2            enabled                        local
rpool  feature@redaction_bookmarks    enabled                        local
rpool  feature@redacted_datasets      enabled                        local
rpool  feature@bookmark_written       enabled                        local
rpool  feature@log_spacemap           active                         local
rpool  feature@livelist               enabled                        local
rpool  feature@device_rebuild         enabled                        local
rpool  feature@zstd_compress          active                         local
rpool  feature@draid                  enabled                        local
bpool properties
bpool  size                           3.75G                          -
bpool  capacity                       1%                             -
bpool  altroot                        /mnt                           local
bpool  health                         ONLINE                         -
bpool  guid                           6912980947795575950            -
bpool  version                        -                              default
bpool  bootfs                         -                              default
bpool  delegation                     on                             default
bpool  autoreplace                    off                            default
bpool  cachefile                      none                           local
bpool  failmode                       wait                           default
bpool  listsnapshots                  off                            default
bpool  autoexpand                     off                            default
bpool  dedupratio                     1.00x                          -
bpool  free                           3.69G                          -
bpool  allocated                      66.5M                          -
bpool  readonly                       off                            -
bpool  ashift                         9                              local
bpool  comment                        -                              default
bpool  expandsize                     -                              -
bpool  freeing                        0                              -
bpool  fragmentation                  0%                             -
bpool  leaked                         0                              -
bpool  multihost                      off                            default
bpool  checkpoint                     -                              -
bpool  load_guid                      17756357937596149379           -
bpool  autotrim                       on                             local
bpool  compatibility                  grub2                          local
bpool  feature@async_destroy          enabled                        local
bpool  feature@empty_bpobj            active                         local
bpool  feature@lz4_compress           active                         local
bpool  feature@multi_vdev_crash_dump  disabled                       local
bpool  feature@spacemap_histogram     active                         local
bpool  feature@enabled_txg            active                         local
bpool  feature@hole_birth             active                         local
bpool  feature@extensible_dataset     enabled                        local
bpool  feature@embedded_data          active                         local
bpool  feature@bookmarks              enabled                        local
bpool  feature@filesystem_limits      enabled                        local
bpool  feature@large_blocks           enabled                        local
bpool  feature@large_dnode            disabled                       local
bpool  feature@sha512                 disabled                       local
bpool  feature@skein                  disabled                       local
bpool  feature@edonr                  disabled                       local
bpool  feature@userobj_accounting     disabled                       local
bpool  feature@encryption             disabled                       local
bpool  feature@project_quota          disabled                       local
bpool  feature@device_removal         disabled                       local
bpool  feature@obsolete_counts        disabled                       local
bpool  feature@zpool_checkpoint       disabled                       local
bpool  feature@spacemap_v2            disabled                       local
bpool  feature@allocation_classes     disabled                       local
bpool  feature@resilver_defer         disabled                       local
bpool  feature@bookmark_v2            disabled                       local
bpool  feature@redaction_bookmarks    disabled                       local
bpool  feature@redacted_datasets      disabled                       local
bpool  feature@bookmark_written       disabled                       local
bpool  feature@log_spacemap           disabled                       local
bpool  feature@livelist               disabled                       local
bpool  feature@device_rebuild         disabled                       local
bpool  feature@zstd_compress          disabled                       local
bpool  feature@draid                  disabled                       local
Datasets:
root@archiso ~ # zfs list
NAME                                              USED  AVAIL     REFER  MOUNTPOINT
bpool                                            66.4M  3.56G       24K  /mnt/boot
bpool/arch                                       66.1M  3.56G       24K  none
bpool/arch/BOOT                                  66.0M  3.56G       24K  none
bpool/arch/BOOT/default                          66.0M  3.56G     66.0M  /mnt/boot
rpool                                            1.43G  3.51T     30.6K  /mnt
rpool/arch                                       1.43G  3.51T     30.6K  none
rpool/arch/DATA                                   623K  3.51T     30.6K  none
rpool/arch/DATA/default                           593K  3.51T     30.6K  /mnt
rpool/arch/DATA/default/home                     30.6K  3.51T     30.6K  /mnt/home
rpool/arch/DATA/default/root                     56.6K  3.51T     39.3K  /mnt/root
rpool/arch/DATA/default/srv                      30.6K  3.51T     30.6K  /mnt/srv
rpool/arch/DATA/default/usr                      63.9K  3.51T     30.6K  /mnt/usr
rpool/arch/DATA/default/usr/local                33.3K  3.51T     33.3K  /mnt/usr/local
rpool/arch/DATA/default/var                       380K  3.51T     30.6K  /mnt/var
rpool/arch/DATA/default/var/games                30.6K  3.51T     30.6K  /mnt/var/games
rpool/arch/DATA/default/var/lib                   214K  3.51T     30.6K  /mnt/var/lib
rpool/arch/DATA/default/var/lib/AccountsService  30.6K  3.51T     30.6K  /mnt/var/lib/AccountsService
rpool/arch/DATA/default/var/lib/docker           30.6K  3.51T     30.6K  /mnt/var/lib/docker
rpool/arch/DATA/default/var/lib/libvirt          30.6K  3.51T     30.6K  /mnt/var/lib/libvirt
rpool/arch/DATA/default/var/lib/lxc              30.6K  3.51T     30.6K  /mnt/var/lib/lxc
rpool/arch/DATA/default/var/lib/nfs              30.6K  3.51T     30.6K  /mnt/var/lib/nfs
rpool/arch/DATA/default/var/lib/postgres         30.6K  3.51T     30.6K  /mnt/var/lib/postgres
rpool/arch/DATA/default/var/log                  43.3K  3.51T     43.3K  /mnt/var/log
rpool/arch/DATA/default/var/spool                30.6K  3.51T     30.6K  /mnt/var/spool
rpool/arch/DATA/default/var/www                  30.6K  3.51T     30.6K  /mnt/var/www
rpool/arch/ROOT                                  1.43G  3.51T     30.6K  none
rpool/arch/ROOT/default                          1.43G  3.51T     1.43G  /mnt

Last edited by Tid91 (2021-12-27 00:35:03)

Offline

#2 2021-12-27 00:34:38

Tid91
Member
Registered: 2013-12-01
Posts: 35
Website

Re: [SOLVED] ZFS On root - Invalid or corrupt cachefile - Can't be deleted

Thanks to some help in chat, the problem was the guide I followed here where they set the zpool.cache as immutable, and that hangs everything. Changing back that file to being mutable fixes my boot problem.

Thanks to @drake in Archlinux chat and @zdykstra on #zfsonlinux

Last edited by Tid91 (2021-12-27 00:35:20)

Offline

Board footer

Powered by FluxBB