Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fr0der1c opened this issue May 6, 2024 · 19 comments

Comments

@fr0der1c
Copy link

fr0der1c commented May 6, 2024

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.

@fr0der1c
Copy link
Author

fr0der1c commented May 6, 2024

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

@007revad
Copy link
Owner

007revad commented May 6, 2024

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"

@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

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.

@007revad
Copy link
Owner

007revad commented May 7, 2024

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!.

@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

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

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

@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

btw, it a relinking expected after moving?

@007revad
Copy link
Owner

007revad commented May 7, 2024

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

@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

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

@007revad
Copy link
Owner

007revad commented May 7, 2024

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

ls  /volume1/@img_bkp_cache

@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

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#

@007revad
Copy link
Owner

007revad commented May 7, 2024

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

@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

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

@007revad
Copy link
Owner

007revad commented May 7, 2024

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

@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

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?

@007revad
Copy link
Owner

007revad commented May 7, 2024

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.

@007revad
Copy link
Owner

007revad commented May 7, 2024

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

SCP

@007revad
Copy link
Owner

007revad commented May 7, 2024

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?

007revad added a commit that referenced this issue May 7, 2024
v3.0.48
- Bug fix for Synology Drive stil using `@synologydrive` on the original volume. Issue #55
- Now deletes `@eaDir` folders to try to prevent `mv: cannot remove '/volume#/@<folder>': Operation not permitted`. Issue #54
@007revad 007revad mentioned this issue May 7, 2024
@fr0der1c
Copy link
Author

fr0der1c commented May 7, 2024

It stopped at that point.

@007revad 007revad mentioned this issue Jun 13, 2024
@007revad
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants