Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, Bill Barry wrote:


If there are no other files on it you could reformat it.


Bill,

I thought of that but am not sure if the installed files:
ls /mnt/hd
Autorun.inf*  Icon1.ico*  System Volume Information/  bkup1/
could be removed without FUBARing the M$ format.

I just learned that I can use gfdisk to make the /dev/sdg1 partition then
run `mkfs -t exfat /dev/sdg1' on it.

Haven't done this before.

Thanks,

Rich




Re: [PLUG] Root cannot delete file

2023-10-30 Thread Bill Barry
On Mon, Oct 30, 2023 at 3:35 PM Rich Shepard 
wrote:

> On Mon, 30 Oct 2023, wes wrote:
>
> > I would also suggest running an fsck on that filesystem.
>
> wes,
>
> # fsck /dev/sdg1
> fsck from util-linux 2.27.1
> fsck.fat 3.0.28 (2015-05-16)
> Currently, only 1 or 2 FATs are supported, not 0.
>
> The FS is exFAT. Interesting result.
>
> Thanks,
>
> Rich
>

If there are no other files on it you could reformat it.

Bill


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, wes wrote:


I would also suggest running an fsck on that filesystem.


wes,

# fsck /dev/sdg1
fsck from util-linux 2.27.1
fsck.fat 3.0.28 (2015-05-16)
Currently, only 1 or 2 FATs are supported, not 0.

The FS is exFAT. Interesting result.

Thanks,

Rich


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, Bill Barry wrote:


Maybe it has nothing to do with the strange character in the filename,
maybe it is set to immutable.

Try
lsattr


Bill,

# lsattr
lsattr: Invalid argument While reading flags on 
./8a203b79706a7fd3dcbeb5c173e4e8-134648.o


Re: [PLUG] Root cannot delete file

2023-10-30 Thread wes
On Mon, Oct 30, 2023 at 12:28 PM Bill Barry  wrote:

> On Mon, Oct 30, 2023 at 1:18 PM Rich Shepard 
> wrote:
>
> > On Mon, 30 Oct 2023, Rich Shepard wrote:
> >
> > > I tried renaming without success. I'll try using mc (Midnight
> Commander).
> >
> > mc also failed to remove that file.
> >
> > Rich
> >
>
> Maybe it has nothing to do with the strange character in the filename,
> maybe it is set to immutable.
>
> Try
> lsattr
> if there is an i for immutable then
> chattr -i  crazyfilename
>
>
> Bill
>


I would also suggest running an fsck on that filesystem.

-wes


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Bill Barry
On Mon, Oct 30, 2023 at 1:18 PM Rich Shepard 
wrote:

> On Mon, 30 Oct 2023, Rich Shepard wrote:
>
> > I tried renaming without success. I'll try using mc (Midnight Commander).
>
> mc also failed to remove that file.
>
> Rich
>

Maybe it has nothing to do with the strange character in the filename,
maybe it is set to immutable.

Try
lsattr
if there is an i for immutable then
chattr -i  crazyfilename


Bill


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, Rich Shepard wrote:


I tried renaming without success. I'll try using mc (Midnight Commander).


mc also failed to remove that file.

Rich


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, Michael Ewan wrote:


ls -l reports the number of blocks allocated to the directory.


Thanks, Michael.

Rich


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Michael Ewan
ls -l reports the number of blocks allocated to the directory.

On Mon, Oct 30, 2023 at 9:54 AM Rich Shepard 
wrote:

> On Mon, 30 Oct 2023, Bill Barry wrote:
>
> > get the inode number from the first field returned by
> > ls -li
> > then delete based on that inode number
> > find . -inum 123488  -delete
>
> Bill,
>
> # ls -li
> total 12
> 4248357 -rwxrwxrwx 1 root root 11640 Oct 29 07:45
> 8a203b79706a7fd3dcbeb5c173e4e8-134?648.o*
>
> Why 12? There's only one non-hidden file there.
>
> # find . -inum 4248357 -delete
> find: cannot delete `./8a203b79706a7fd3dcbeb5c173e4e8-134\021648.o': No
> such file or directory
>
> Notice the `?' has been replaced by the octal \021.
>
> Thanks for the suggestion.
>
> Regards,
>
> Rich
>


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, Bill Barry wrote:


get the inode number from the first field returned by
ls -li
then delete based on that inode number
find . -inum 123488  -delete


Bill,

# ls -li
total 12
4248357 -rwxrwxrwx 1 root root 11640 Oct 29 07:45 
8a203b79706a7fd3dcbeb5c173e4e8-134?648.o*

Why 12? There's only one non-hidden file there.

# find . -inum 4248357 -delete
find: cannot delete `./8a203b79706a7fd3dcbeb5c173e4e8-134\021648.o': No such 
file or directory

Notice the `?' has been replaced by the octal \021.

Thanks for the suggestion.

Regards,

Rich


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Bill Barry
On Mon, Oct 30, 2023 at 11:19 AM Rich Shepard 
wrote:

get the inode number from the first field returned by
 ls -li
then delete based on that inode number
find . -inum 123488  -delete

Bill


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, Tomas Kuchta wrote:


find salmo-root -type f -exec rm -f {} \;


Tomas,

That also failed to remove the file.


If that doesn't help ask linux if someone has the file opened by:
fuser -a fileName


This returned no information, only the shell prompt.

Tried to chmod to remove the execute attribute, but that failed, too.

Of all files that were in salmo-root/ I wonder what changed this one and
made it immutable.

Sigh.

Thanks,

Rich


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Michael Ewan
The other approach is to avoid the shell.  Try this,
perl -e 'unlink $ARGV[0] or warn;'

On Mon, Oct 30, 2023 at 8:39 AM Tomas Kuchta 
wrote:

> If the file name is the actual problem and not filesystem lock or similar:
> I deal with these files asking find to delete it for me this way:
> find salmo-root -type f -exec rm -f {} \;
>
> Yes, pay attention to all characters including spaces \ and ;
>
> If that doesn't help ask linux if someone has the file opened by:
> fuser -a fileName
>
> Best, Tomas
>
>
> On Mon, Oct 30, 2023, 16:30 Denis Heidtmann 
> wrote:
>
> > Can it be renamed? How does a GUI deal with it?
> >
> > On Mon, Oct 30, 2023 at 7:20 AM Rich Shepard 
> > wrote:
> >
> > > On Sun, 29 Oct 2023, Reid wrote:
> > >
> > > > Any luck with this?
> > > >
> > >
> >
> https://askubuntu.com/questions/746048/cant-delete-a-file-with-a-in-the-file-name
> > >
> > > Reid,
> > >
> > > Nope.
> > >
> > > However, using `ls -b' I learned that the `?' is octal \021. The ls man
> > > page
> > > did't suggest another option to view non-printable characters and my
> > > trial-and-error efforts to replace that parenthesis with `*' failed. So
> > did
> > > trying to use a wildcard after initial chars in the filename.
> > >
> > > > Also if it's the only file in the directory (maybe I misunderstood),
> > what
> > > > happens when you try to remove the whole directory (`rm -rf
> > > > `)?
> > >
> > > Initially I used `rm -rf salmo-root' and everything but that one file
> was
> > > removed.
> > >
> > > Thanks,
> > >
> > > Rich
> > >
> > >
> > >
> >
>


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Mon, 30 Oct 2023, Denis Heidtmann wrote:


Can it be renamed? How does a GUI deal with it?


Denis,

I tried renaming without success. I'll try using mc (Midnight Commander).

Thanks,

Rich


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Tomas Kuchta
If the file name is the actual problem and not filesystem lock or similar:
I deal with these files asking find to delete it for me this way:
find salmo-root -type f -exec rm -f {} \;

Yes, pay attention to all characters including spaces \ and ;

If that doesn't help ask linux if someone has the file opened by:
fuser -a fileName

Best, Tomas


On Mon, Oct 30, 2023, 16:30 Denis Heidtmann 
wrote:

> Can it be renamed? How does a GUI deal with it?
>
> On Mon, Oct 30, 2023 at 7:20 AM Rich Shepard 
> wrote:
>
> > On Sun, 29 Oct 2023, Reid wrote:
> >
> > > Any luck with this?
> > >
> >
> https://askubuntu.com/questions/746048/cant-delete-a-file-with-a-in-the-file-name
> >
> > Reid,
> >
> > Nope.
> >
> > However, using `ls -b' I learned that the `?' is octal \021. The ls man
> > page
> > did't suggest another option to view non-printable characters and my
> > trial-and-error efforts to replace that parenthesis with `*' failed. So
> did
> > trying to use a wildcard after initial chars in the filename.
> >
> > > Also if it's the only file in the directory (maybe I misunderstood),
> what
> > > happens when you try to remove the whole directory (`rm -rf
> > > `)?
> >
> > Initially I used `rm -rf salmo-root' and everything but that one file was
> > removed.
> >
> > Thanks,
> >
> > Rich
> >
> >
> >
>


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Denis Heidtmann
Can it be renamed? How does a GUI deal with it?

On Mon, Oct 30, 2023 at 7:20 AM Rich Shepard 
wrote:

> On Sun, 29 Oct 2023, Reid wrote:
>
> > Any luck with this?
> >
> https://askubuntu.com/questions/746048/cant-delete-a-file-with-a-in-the-file-name
>
> Reid,
>
> Nope.
>
> However, using `ls -b' I learned that the `?' is octal \021. The ls man
> page
> did't suggest another option to view non-printable characters and my
> trial-and-error efforts to replace that parenthesis with `*' failed. So did
> trying to use a wildcard after initial chars in the filename.
>
> > Also if it's the only file in the directory (maybe I misunderstood), what
> > happens when you try to remove the whole directory (`rm -rf
> > `)?
>
> Initially I used `rm -rf salmo-root' and everything but that one file was
> removed.
>
> Thanks,
>
> Rich
>
>
>


Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Sun, 29 Oct 2023, Michael Ewan wrote:


An eight bit character has been inserted into the file name indicated by
?, you should be able to see it with 'ls -b'. You can remove the file with
a wildcard such as *.


Michael,

I had tried the `*' wildcard in multiple places without removing the file.
And, as I responded to Reid's post, this one file was left after trying to
remove the whole salmo-root/ directory.

Thanks,

Rich




Re: [PLUG] Root cannot delete file

2023-10-30 Thread Rich Shepard

On Sun, 29 Oct 2023, Reid wrote:


Any luck with this?
https://askubuntu.com/questions/746048/cant-delete-a-file-with-a-in-the-file-name


Reid,

Nope.

However, using `ls -b' I learned that the `?' is octal \021. The ls man page
did't suggest another option to view non-printable characters and my
trial-and-error efforts to replace that parenthesis with `*' failed. So did
trying to use a wildcard after initial chars in the filename.


Also if it's the only file in the directory (maybe I misunderstood), what
happens when you try to remove the whole directory (`rm -rf
`)?


Initially I used `rm -rf salmo-root' and everything but that one file was
removed.

Thanks,

Rich