XaiJu
bcachefs
bcachefs

patreon


Update and new bcachefs fs usage command

Replication tests are finally all passing! This means that device removal and write error handling (for replicated writes) should finally be fully working.

Those two codepaths have in common that they need to modify pointers to existing btree nodes - removing the pointer to the device that either failed to write or is being removed - which is a particularly tricky operation, partially due to the btree node cache being physically indexed. Also fixed a whole bunch of bugs in the code that tracks replicas in the superblock recently, which is relevant to anyone who's using multiple devices.

The only thing left before replication is ready for real use is a tool to rereplicate degraded data (i.e. find all data in a filesystem that has fewer replicas than the desired number of replicas and write more copies). Also want a scrub tool, but that won't be much extra work once there's a userspace interface for these kinds of "do stuff with existing data" jobs.

There's also a new "bcachefs fs usage" command, which reports a whole bunch of information about disk usage. Example output (apologies for formatting):

Filesystem 96e038ff-b680-4d3d-b5fa-8b0ecf4f1ebe:

Size:                       7.4G

Used:                       1.2M

By replicas:                  1x          2x          3x          4x

  btree:                       0      640.0K           0           0

  data:                        0           0           0           0

  cached:                      0           0           0           0

  reserved:                    0           0           0           0

  online reserved:             0


Device 0 usage:                     /dev/sdb   readwrite

                            data     buckets  fragmented

  sb:                     132.0K           2      124.0K

  journal:                 16.0M         128           0

  btree:                  640.0K           5           0

  data:                        0           0           0

  cached:                      0           0           0


Device 1 usage:                     /dev/sdc   readwrite

                            data     buckets  fragmented

  sb:                     132.0K           2      124.0K

  journal:                 16.0M         128           0

  btree:                  640.0K           5           0

  data:                        0           0           0

  cached:                      0           0           0

Comments

Yes. One ssd and one spinner (I thought I had replied already, but I don't see it here...)

I have a fairly small patch that makes this a little more user-friendly. Are you interested? If so, I have a git account already, so I could do a PR?

Is it a multi device filesystem?

Kent Overstreet

Ah, that did it, thanks. Still have the other error though: [root@bcachefs-test ~]# bcachefs list /dev/sda1 error opening /dev/sda1: Cannot allocate memory

Pass it a path where the filesystem is mounted, like you would df

Kent Overstreet

Okay, made sure there was nothing stale on the spinner (/dev/sda). Created the same ssd+spinner filesystem and mounted it. Same two problems. Is this CentOS 7 related?

Hmmm, that SSD had been being used for a ZFS pool. I see this: /dev/sda1: LABEL="tank" UUID="6128373464424778028" UUID_SUB="10325141586781680955" TYPE="zfs_member" I wonder if something stale was left? Let me try blowing everything on that SSD away and retry this...

Not sure where to ask this. Just built and booted latest bcachefs on centos 7. I got a filesystem mounted with a spinner as background and an ssd as promote and foreground targets. It seems to be running okay, except if I try 'bcachefs fs usage', I get: bcachefs fs usage BCH_IOCTL_QUERY_UUID ioctl error: Inappropriate ioctl for device And doing 'bcachefs fs /dev/sda1': error opening /dev/sda1: Cannot allocate memory

Nice. Good steady incremental progress. Considering how we were at the beginning of 2017 really looking forward to where we'll be at the end of 2018! Keep up the great work!

veritanuda

thanks!

Kent Overstreet

This is awesome news, mate. You're doing a great thing, so don't stop. And Merry Christmas!


More Creators