Amanda backup install fails: chown: operation not permitted

  • Platform information:
    • Hardware: Raspberry Pi 2 Model B Rev 1.1/1GB/16GB SD card
    • OS: Raspbian GNU/Linux 10 (buster)
    • Java Runtime Environment: openjdk 11.0.10 2021-01-19 LTS
    • openHAB version: OpenHABian 3.0.1
  • Issue of the topic: Amanda install fails for either USB or NFS.

Install works OK until Amanda filesystem is to be created. It then stops with error:

2021-02-28_13:24:46_AEDT [openHABian] Creating Amanda filesystem... FAILED (chown)

running in debug mode and isolating the problem I saw that there is an issue with chown, and it also doesn’t work when I manually execute the failing command:

openhabian@openhabian:~ $ sudo chown --recursive backup:backup /storage/usbstick-msdos
chown: changing ownership of '/storage/usbstick-msdos': Operation not permitted

Note at this time there is no file yet in the folder, only should rename directory itself, see below for current owner and group:

openhabian@openhabian:/storage/usbstick-msdos $ ls -la
total 20
drwxr-xr-x 2 backup root 16384 Jan  1  1970 .
drwxr-xr-x 4 root   root  4096 Feb 27 13:45 ..

One additional piece to the puzzle, the problem seems to be changing the group, since backup is owner already:

openhabian@openhabian:/storage/usbstick-msdos $ sudo chgrp --recursive backup /storage/usbstick-msdos
chgrp: changing group of '/storage/usbstick-msdos/misti': Operation not permitted
chgrp: changing group of '/storage/usbstick-msdos': Operation not permitted

group backup does exist…

After seeing a similar topic, I switched OpenHAB to main, still issue remains.
Any help is appreciated!
Thanks much

What filesystem is on the mounted partition usbstick-msdos ?
How is it mounted ?

I followed the instructions here:
it is mounted as FAT filesystem, exactly as described. I executed these commands

mkfs.vfat -v /dev/sda1
mkdir -p  /storage/usbstick-msdos
echo "/dev/sda1     /storage/usbstick-msdos    vfat     noatime,noauto,user,uid=backup  0       1" >> /etc/fstab
mount /storage/usbstick-msdos
df -k /storage/usbstick-msdos

Here is the output of the last command:

df -k /storage/usbstick-msdos
Filesystem     1K-blocks  Used Available Use% Mounted on
/dev/sda1       30700944    16  30700928   1% /storage/usbstick-msdos

Thanks much

Hi,

I run into the same issue with vfat.
I think it’s not possible to change the ownership because it’s vfat and it’s define in the fstab file.
adding gid=backup dit the trick for me. (and remount)

[16:48:45] root@openhabian:~# openhabian-config
2021-06-06_16:49:02_CEST [openHABian] Checking for root privileges... OK
2021-06-06_16:49:02_CEST [openHABian] Loading configuration file '/etc/openhabian.conf'... OK
2021-06-06_16:49:02_CEST [openHABian] openHABian configuration tool version: [openHAB3]{2021-05-05T15:53:37-06:00}(3e35b6d)
2021-06-06_16:49:02_CEST [openHABian] Checking for changes in origin branch openHAB3... OK
2021-06-06_16:49:04_CEST [openHABian] Switching to branch openHAB3... OK
2021-06-06_16:49:08_CEST [openHABian] Updating Linux package information... OK
2021-06-06_16:49:09_CEST [openHABian] Beginning setup of the Amanda backup system... OK
2021-06-06_16:49:11_CEST [openHABian] Configuring Amanda backup system prerequisites... 2021-06-06_16:49:22_CEST [openHABian] Configuring Amanda backup system prerequisites... OK
2021-06-06_16:49:45_CEST [openHABian] Creating Amanda filesystem... FAILED (chown)
2021-06-06_16:49:57_CEST [openHABian] Checking for default openHABian username:password combination... OK
2021-06-06_16:49:57_CEST [openHABian] We hope you got what you came for! See you again soon ;)
[16:49:57] root@openhabian:~# chown --recursive backup:backup /storage/usbstick
chown: changing ownership of '/storage/usbstick': Operation not permitted
[18:48:12] root@openhabian:~# vim /etc/fstab
[18:48:40] root@openhabian:~# chown --recursive backup:backup /storage/usbstick
chown: changing ownership of '/storage/usbstick': Operation not permitted
[18:48:42] root@openhabian:~# ls -ahl /storage/usbstick/
total 12K
drwxr-xr-x 2 backup root 8.0K Jan  1  1970 .
drwxr-xr-x 3 root   root 4.0K Jun  6 16:28 ..
[18:49:09] root@openhabian:~# umount /storage/usbstick
[18:49:18] root@openhabian:~# mount /storage/usbstick/
[18:49:23] root@openhabian:~# ls -ahl /storage/usbstick/
total 12K
drwxr-xr-x 2 backup backup 8.0K Jan  1  1970 .
drwxr-xr-x 3 root   root   4.0K Jun  6 16:28 ..
[18:49:25] root@openhabian:~# chown --recursive backup:backup /storage/usbstick
[18:49:33] root@openhabian:~# cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=2801841c-01  /boot           vfat    defaults          0       2
PARTUUID=2801841c-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
/dev/sda1     /storage/usbstick       vfat     noatime,noauto,user,uid=backup,gid=backup        0       1
[18:49:48] root@openhabian:~#

After running into the next ‘link drive0’ error. (not possible to create a symbolic link on vfat) I switched to ext4 instead of msdos/fat…