How to correct wrong access rights on btrfs-filesystems

I have a problem, which is a bit strange: I run urbackup on ubuntu-server 16.04 with btrfs-filesystem for the backup directory.
Unfortunately, the disk which stored the ubuntu-server crashed and I didn’t had a backup. My fault…
Now I set up a new ubuntu-server, installed the current version of Urbackup, copied the backup-database to it’s correct directory and mounted the backup-disk.
OK, Urbackup identified all as expected, but: If i make a partition-backup, it stops after a second.
What went wrong?
A little look in the btrfs-filesystem shows me, that some files and directories have the wrong ownership avahi:urbackup, it should be urbackup:urbackup.
So I corrected them by chown -R urbackup:urbackup *, but some directories refused to change the ownership.

root@cheffe:/mnt/urbackup/Leonie-PC/170228-1317_Image_SYSVOL# sudo -u avahi chown urbackup:urbackup *
chown: der Eigentümer von ‘Image_SYSVOL_170228-1317.raw’ wird geändert: Das Dateisystem ist nur lesbar
chown: der Eigentümer von ‘Image_SYSVOL_170228-1317.raw.bitmap’ wird geändert: Das Dateisystem ist nur lesbar
chown: der Eigentümer von ‘Image_SYSVOL_170228-1317.raw.cbitmap’ wird geändert: Das Dateisystem ist nur lesbar
chown: der Eigentümer von ‘Image_SYSVOL_170228-1317.raw.hash’ wird geändert: Das Dateisystem ist nur lesbar
chown: der Eigentümer von ‘Image_SYSVOL_170228-1317.raw.mbr’ wird geändert: Das Dateisystem ist nur lesbar
chown: der Eigentümer von ‘Image_SYSVOL_170228-1317.raw.sync’ wird geändert: Das Dateisystem ist nur lesbar
root@cheffe:/mnt/urbackup/Leonie-PC/170228-1317_Image_SYSVOL#

I have no idea, how to change the ownerships of the files. Maybe, its a problem which only btrfs has?
Someone any idea?
Greeting
Klaus

The btrfs subvolumes are set to read-only after a backup is finished. You’ll have to set them to ro false if you want to change them.

But really you should move the prophet to the mountain and set the urbackup group id to the one before (groupmod) ;). You’ll see the group id e.g. in the output of stat.

I tried the groupmod-trick, but I didn’t succeed. Maybe, my unix knowledge isn’t good enough.
But the mountain moved to the prophet: I made a script which turned all subvolumes to writeable, then changed the ownership and turned back the subvolumes to readonly.
It takes a time, but it worked for me.
Thanks for your help.
Klaus

1 Like

Can you help the community with script?

I had this same problem in the past, but I chose to delete the partition and create a new one.

With script I would be able to reinstall urbackup on a new operating system and fix the permissions of the snapshots.