Weird legacy datasets found on ZFS on Manjaro!

Hi everyone,

I setup my computer in the same way as described here: Installing Manjaro on encrypted ZFS root pool!.

Now while deleting some snapshots I have found this:

[[email protected] ~]$ sudo zfs list
NAME                                                                                              USED  AVAIL     REFER  MOUNTPOINT
rpool_kpu8nj                                                                                      127G  1.62T      192K  none
rpool_kpu8nj/HOME                                                                                 113G  1.62T      192K  none
rpool_kpu8nj/HOME/manjaro                                                                         113G  1.62T      113G  /home
rpool_kpu8nj/HOME/manjaro/root                                                                   2.32M  1.62T     2.32M  /root
rpool_kpu8nj/ROOT                                                                                14.4G  1.62T      192K  none
rpool_kpu8nj/ROOT/manjaro                                                                        14.4G  1.62T     14.2G  /
rpool_kpu8nj/ROOT/manjaro/1381e16bb9f2c4e968bddeaac207a8baaa0b53c2e4473faaa9a956d96e0596a4       5.58M  1.62T     5.57M  legacy
rpool_kpu8nj/ROOT/manjaro/3eea964ff1ab746087edaecbc9676e214cb80f619806a0787ec6f04ccb80f235        408K  1.62T     19.6M  legacy
rpool_kpu8nj/ROOT/manjaro/4b52e4dc1e912aa926e888120d5ae7a93beaf20c222e83616d6da1bd87fa5d0c        388K  1.62T      202M  legacy
rpool_kpu8nj/ROOT/manjaro/9a348db73d6fde9887f6289c47137912f0b1a2b0b9a1d3c60d63bb6c0f4afafb       14.8M  1.62T     19.6M  legacy
rpool_kpu8nj/ROOT/manjaro/a405b491b4cb4b02f8b42b96f95246e67029127dc05cdeb4c9ed082d37d8d98e        184M  1.62T      202M  legacy
rpool_kpu8nj/ROOT/manjaro/dfdf87a94c704ef917efax7cdf078242367cf21c3a12c89a157d6a4ff51c5a25       6.37M  1.62T      204M  legacy
rpool_kpu8nj/ROOT/manjaro/dfdf87a94c704ef917efax7cdf078242367cf21c3a12c89a157d6a4ff51c5a25-init   408K  1.62T      202M  legacy

These are all legacy datasets of which one has -init appended to its name. I do not know if I can delete these or where they are coming from. Has anyone an idea?

Thank you in advance!

Did you try a

zfs get all rpool_kpu8nj/ROOT/manjaro/ddhwhshehshshh2633626

On one to see what it is?

Never done root, nor clones, but they don’t look like snapshots created by any app I’ve seen.

Otherwise is some app creating a dataset for each app in the root directory?
That sounds like a fun idea In principal until you have to list them…

1 Like

Given the small sizes, they aren’t perhaps system snapshots for boot-recovery?

I don’t/haven’t run majaro, but that would be my guess based on what/where they are.

1 Like

Actually not bad advice. I could see that all of these datasets have been created on 17.02.2021. I checked my .bashhistory and could not find anything. I have not logged that I installed any software on this day and the next Manjaro update was only a few days later.

I just mounted one of them and it contains this:

[[email protected] mount]$ ls -al
total 205
drwxr-xr-x 23 root root   26 17. Feb 22:05 .
drwxr-xr-x  8 root root    8  5. Mär 12:58 ..
drwxr-xr-x  3 root root    3 16. Feb 20:18 app
drwxr-xr-x  2 root root  289 16. Feb 07:30 bin
drwxr-xr-x  2 root root    2 16. Feb 07:30 config
drwxrwxr-x  2 root root    3 16. Feb 20:15 defaults
drwxr-xr-x  4 root root    5 17. Feb 22:05 dev
-rwxr-xr-x  1 root root    0 17. Feb 22:05 .dockerenv
-rwxrwxr-x  1 root root 3625 16. Feb 07:29 docker-mods
drwxrwxr-x 28 root root   55 17. Feb 22:05 etc
drwxr-xr-x  2 root root    2 16. Feb 07:30 home
-rwxr-xr-x  1 root root  389 13. Mai 2020  init
drwxr-xr-x  6 root root   30 16. Feb 20:18 lib
drwxr-xr-x  2 root root    5 12. Mai 2020  libexec
drwxr-xr-x  5 root root    5 16. Feb 07:30 media
drwxr-xr-x  2 root root    2 16. Feb 07:30 mnt
drwxr-xr-x  2 root root    2 16. Feb 07:30 opt
dr-xr-xr-x  2 root root    2 16. Feb 07:30 proc
drwx------  3 root root    3 16. Feb 20:17 root
drwxr-xr-x  2 root root    2 16. Feb 07:30 run
drwxr-xr-x  2 root root   69 16. Feb 07:30 sbin
drwxr-xr-x  2 root root    2 16. Feb 07:30 srv
drwxr-xr-x  2 root root    2 16. Feb 07:30 sys
drwxrwxrwt  2 root root    2 16. Feb 20:18 tmp
drwxrwxr-x  9 root root    9 16. Feb 20:18 usr
drwxr-xr-x 12 root root   13 16. Feb 07:30 var

The .dockerenv file as well as the fact that some of the files are dated may 2020 let me think that docker my be the culprit. My system has not been running since may and this seems like some imported filesystem.

1 Like

I think it is docker, just reading up on it and found this:

  • The btrfs and zfs storage drivers are used if they are the backing filesystem (the filesystem of the host on which Docker is installed). These filesystems allow for advanced options, such as creating “snapshots”, but require more maintenance and setup. Each of these relies on the backing filesystem being configured correctly. - Docker storage drivers | Docker Documentation

Edit: Yes it is indeed docker. If you leave it unconfigured it defaults to the zfs driver and just creates new datasets in the same dataset where /var/lib/docker is located at. Since the docker folder was located in my root dataset it started to create it’s own legacy datasets there. I stopped docker, recursivly removed all legacy datasets, created a new dataset with mountpoint set to /var/lib/docker and pulled an image. This is the result:

rpool_kpu8nj/ROOT/manjaro                                                                          15.1G  1.50T     14.8G  /
rpool_kpu8nj/ROOT/manjaro/docker                                                                    244M  1.50T     1.94M  /var/lib/docker
rpool_kpu8nj/ROOT/manjaro/docker/5c6ed244cdb7b84816afbb80e5a745107f5e53ae45cd2cc21eb868fb668a469d   242M  1.50T      242M  legacy
rpool_kpu8nj/ROOT/manjaro/docker/c76c2ad7fa573f32a127d3b6579d7b969fcb4d6b40a4b328c410ba29f9adaf9a   312K  1.50T      242M  legacy

Wow, that is both really clever, and really annoying, but glad you shared it!

And well done tracking it down, you deserve to Mark your post as a solution

1 Like

I can’t mark it as a solution. I can make it a wiki and report it, but marking it as a solution is not an option for me :face_with_raised_eyebrow:.

Edit: Additionally I will have to think about if I want to keep the zfs docker driver or switch back to another one. On the one hand I can imagine docker utilizing the ZFS feature set can be a huge performance plus, on the other hand the more I use docker every time I list my datasets I will have a cluttered output.

1 Like

Well, guess I fail at discourse.
Now I just want to find out what makes a thing solve-able. Maybe it needs a question mark in the title. Oh well, I can understand all the datasets being annoying