007revad/Synology_app_mover

mv: cannot remove '/volume1/@img_bkp_cache': Operation not permitted when moving Hyper Backup

Closed this issue · 19 comments

I got the following error when moving Hyper Backup:

You selected Hyper Backup in /volume1

Destination volume is /volume2

Ready to Move Hyper Backup to /volume2? [y/n]
y

Moving /volume1/@appconf/HyperBackup to /volume2
Moving /volume1/@appdata/HyperBackup to /volume2
Moving /volume1/@apphome/HyperBackup to /volume2
Moving /volume1/@appshare/HyperBackup to /volume2
Moving /volume1/@appstore/HyperBackup to /volume2
Moving /volume1/@apptemp/HyperBackup to /volume2
mv: cannot remove '/volume1/@img_bkp_cache': Operation not permitted
Line 437: ERROR Moving /volume1/@img_bkp_cache to /volume2 failed!
progstatus called from move_dir line 1011

Please tell me what should I do now. Thank you.

Additional information in case it's needed:
I'm using Synology_app_mover v3.0.47. DSM version is 7.2.1-69057-5. Running as root with sudo -s prefix:

root@NAS:/volume2/homes/myaccount/Synology_app_mover-3.0.47# sudo -s ./syno_app_mover.sh

Can you check if /volume1/@img_bkp_cache is empty and let me know.

If this command returns nothing then it is empty:

ls /volume1/@img_bkp_cache

Moving /volume1/@img_bkp_cache is the last step before starting Hyper Backup. So if /volume1/@img_bkp_cache is empty then you can start Hyper Backup from Package Center and it should all be okay.

If /volume1/@img_bkp_cache is not empty, then try this:

sudo cp -prf "/volume1/@img_bkp_cache" "/volume2/@img_bkp_cache"

The directory seems to be not empty:

root@NAS:/volume2/homes/myaccount/Synology_app_mover-3.0.47# ls /volume1/@img_bkp_cache
@eaDir

It seems to have no actual files but only a folder structure:

root@NAS:/volume2/homes/myaccount/Synology_app_mover-3.0.47# du -h /volume1/@img_bkp_cache
0	/volume1/@img_bkp_cache/@eaDir/@tmp
0	/volume1/@img_bkp_cache/@eaDir
0	/volume1/@img_bkp_cache

Tried executing the cp command and then start Hyper Backup from the Package Center. HB reports local index is broken and requires relinking. I started the process and I'm hoping it will succeed.

DSM creates @eaDir folders in lots of places. They usually just contain metadata and thumbnails.

You can delete the empty /volume1/@img_bkp_cache/@eaDir/@tmp with:

sudo rm -rf /volume1/@img_bkp_cache

I'll change the script to delete @eaDir folders to prevent other people getting that ERROR Moving /volume1/@img_bkp_cache to /volume2 failed!.

Thank you. I tried the rm command above, and got:

rm: cannot remove '/volume1/@img_bkp_cache': Operation not permitted

btw, it a relinking expected after moving?

rm: cannot remove '/volume1/@img_bkp_cache': Operation not permitted

Interesting. I just tried it on one of my Synology NAS and it worked.

Try this:

sudo -s 
rm -rf /volume1/@img_bkp_cache/@eaDir/@tmp
rm -rf /volume1/@img_bkp_cache/@eaDir
rm -rf /volume1/@img_bkp_cache
root@NAS:/volume2/homes/myaccount/Synology_app_mover-3.0.47# sudo -s
ash-4.4# rm -rf /volume1/@img_bkp_cache/@eaDir/@tmp
ash-4.4# rm -rf /volume1/@img_bkp_cache/@eaDir
ash-4.4# rm -rf /volume1/@img_bkp_cache
rm: cannot remove '/volume1/@img_bkp_cache': Operation not permitted

Still not working

Does the following command show that the @eaDir folder has been deleted?

ls  /volume1/@img_bkp_cache

Yes. Seems @eaDir was deleted. Now only an empty @img_bkp_cache left here.

ash-4.4# ls  /volume1/@img_bkp_cache
ash-4.4#

I would just leave the empty /volume1/@img_bkp_cache. Or delete it from WinSCP if you have a Windows PC.

Leave the empty folder is okey. I'm not a fan of Windows but I wonder how does WinSCP make a difference?

I often wonder how WinSCP can delete a folder that I can't delete via SSH.

One thing we haven't tried, now that the folder is empty, is:

sudo rmdir /volume1/@img_bkp_cache
ash-4.4# sudo rmdir /volume1/@img_bkp_cache
rmdir: failed to remove '/volume1/@img_bkp_cache': Operation not permitted

Guess I'll just leave it there.

What protocol were you using when you can delete a folder that can't be deleted via SSH?

btw, it a relinking expected after moving?

Yes. I haven't found a way to avoid the relinking, but once it's done everything should work.

What protocol were you using when you can delete a folder that can't be deleted via SSH?

SCP

mv: cannot remove '/volume1/@img_bkp_cache': Operation not permitted
Line 437: ERROR Moving /volume1/@img_bkp_cache to /volume2 failed!
progstatus called from move_dir line 1011

Did the script stop at that point or did it continue to the end?

It stopped at that point.