Comprehensive data protection for all workloads
Post Reply
pesos
Expert
Posts: 227
Liked: 28 times
Joined: Nov 12, 2014 9:40 am
Full Name: John Johnson
Contact:

can't change immutable flag to delete files from hard rep

Post by pesos »

hi all, we have a hardened rep on ubuntu.

I wanted to delete a couple of stale folders within the repo.

I went in and did "chattr -i" to remove the flag and then was able to delete the folder - no problem.

However with one of the folders this isn't working. I am in as root with a su shell.

When I run chattr -i it just gives me:
Usage: chattr [-pRVf] [-+=aAcC...

as if I'm typing it wrong or something.
I also try chown user * but that fails as well (I assume due to immutability?)

anyone have any tips for this linux noob?
thanks!
mjr.epicfail
Veeam Legend
Posts: 518
Liked: 145 times
Joined: Apr 22, 2022 12:14 pm
Full Name: Danny de Heer
Contact:

Re: can't change immutable flag to delete files from hard rep

Post by mjr.epicfail »

Did you check if there is an open file handle ?
If so, the quickest way to unlock this is to reboot the server.
VMCE / Veeam Legend 2*
pesos
Expert
Posts: 227
Liked: 28 times
Joined: Nov 12, 2014 9:40 am
Full Name: John Johnson
Contact:

Re: can't change immutable flag to delete files from hard rep

Post by pesos »

Thanks! unfortunately this persists even immediately after a reboot.
mjr.epicfail
Veeam Legend
Posts: 518
Liked: 145 times
Joined: Apr 22, 2022 12:14 pm
Full Name: Danny de Heer
Contact:

Re: can't change immutable flag to delete files from hard rep

Post by mjr.epicfail »

Maybe you have a syntax issue somewhere, cant help you with that unfortunately.
Maybe try a different forum (something Linux) as this is not a Veeam issue per se.
VMCE / Veeam Legend 2*
Johnny L
Service Provider
Posts: 50
Liked: 16 times
Joined: Mar 22, 2021 11:37 am
Full Name: Johnny Løberg
Contact:

Re: can't change immutable flag to delete files from hard rep

Post by Johnny L »

Hi,

There's probably a "hidden" lock-file which is stopping you (.veeam.<number>.lock). This file needs to be specified to be affected.

To see all the existing files in current folder:

Code: Select all

ls -lah
To remove immutable flags from *.vbk/*.vib/*.vbm:

Code: Select all

chattr -i *.*
To remove immutable flags from hidden files:

Code: Select all

chattr -i <filename>
To remove *.vbk/*.vib/*.vbm:

Code: Select all

rm *.*
To remove the hidden file(s):

Code: Select all

rm <filename>
So here's what I usually do (use tab to autocomplete filenames):

Code: Select all

chattr -i *.*
chattr -i .veeam.<number>.lock
rm *.*
rm .veeam.<number>.lock
pesos
Expert
Posts: 227
Liked: 28 times
Joined: Nov 12, 2014 9:40 am
Full Name: John Johnson
Contact:

Re: can't change immutable flag to delete files from hard rep

Post by pesos »

Thanks all, but no - not the case.

It's not like there is some crazy complex syntax going on here lol... can only type chattr -i so many times incorrectly and I've done it a thousand or so times, including with a couple colleagues to make sure I wasn't going crazy or doing something stupid.

Veeam support also took a look with me while we were working on a separate 12.3 issue, and he threw his hands up in confusion.

And it is a "veeam issue" in that it only happens on the veeam folders. If I go to /etc or other locations and use the exact same syntax (up-arrowing to repeat, not even re-typing) it works happily.

Ultimately I sorted it by doing it recursively at the folder level, which oddly worked even though doing the file level wouldn't.
chattr -i -R foldername

The above cleared the flag from the files within the folder.
mjr.epicfail
Veeam Legend
Posts: 518
Liked: 145 times
Joined: Apr 22, 2022 12:14 pm
Full Name: Danny de Heer
Contact:

Re: can't change immutable flag to delete files from hard rep

Post by mjr.epicfail » 1 person likes this post

Still sounds like a lock or a hidden file.

The reason why I wrote it’s not a veeam issue because it’s not. It’s a Linux and or filesystem issue.

Glad you fixed it though!
VMCE / Veeam Legend 2*
pesos
Expert
Posts: 227
Liked: 28 times
Joined: Nov 12, 2014 9:40 am
Full Name: John Johnson
Contact:

Re: can't change immutable flag to delete files from hard rep

Post by pesos »

Don't see how it could be a lock or hidden file causing this absurd behavior. The syntax is fine but the POS is saying it's not. Pretty simple. A lock would not have been magically cleared by the recursive chattr at the folder level, yet everything was easily deleted after that. Clearly Veeam has done something unique to those folders as they behave completely differently than all other system folders. Ubuntu giving MS a run for their money wrt ridiculous inconsistency.
Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 70 guests