LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how change attributes or remove files with the e attribute set (https://www.linuxquestions.org/questions/linux-general-1/how-change-attributes-or-remove-files-with-the-e-attribute-set-890328/)

porphyry5 07-06-2011 06:23 PM

how change attributes or remove files with the e attribute set
 
I have a bunch of files on a usb stick that have just the e attribute set. So I can't chattr them, rm -f fails and chmod fails, all whether as user or root. How can I get rid of the e attribute? Failing that, how can I get rid of the files?

chrism01 07-07-2011 01:01 AM

Well, according to this, the 'E' attr cannot be set or reset
http://linux.die.net/man/1/chattr

Start by listing the files info

Code:

lsattr *

ls -l *

# if you've got SELinux, add a Z

ls -lZ *

To delete you'd have to be root and chattr (unset) the 'i' flag if it is set before trying to delete.
Obviously ensure the USB is mounted rw.

porphyry5 07-07-2011 05:55 AM

Quote:

Originally Posted by chrism01 (Post 4407489)
Well, according to this, the 'E' attr cannot be set or reset
http://linux.die.net/man/1/chattr

Start by listing the files info

Code:

lsattr *

ls -l *

# if you've got SELinux, add a Z

ls -lZ *

To delete you'd have to be root and chattr (unset) the 'i' flag if it is set before trying to delete.
Obviously ensure the USB is mounted rw.

These are the originals of the files on my hd
Code:

g  cd ~/LinuxUse
g  ls
Advanced Bash-Scripting Guide.html  BashReference          ShortNotes~
AwkCheatSheet                      BashTutorial          Tutorials
AwkCom                              BashTutorial~          bashref.html
AwkCommands                        LinuxCommands.txt      gawkref.html
AwkCom~                            LinuxCommands.txt~    jsGuide
AwkOneLinersExplained              Notes                  jsRef
AwkReference                        Notes~                oAwkTutorial~
AwkReference~                      SedOneLinersExplained  sedref.html
AwkTits                            SedReference          tuts
AwkTutorial                        ShortNotes
g  lsattr
-------------e- ./AwkCom
-------------e- ./ShortNotes~
-------------e- ./oAwkTutorial~
-------------e- ./SedOneLinersExplained
-------------e- ./AwkOneLinersExplained
-------------e- ./gawkref.html
-------------e- ./ShortNotes
-------------e- ./jsRef
-------------e- ./AwkTits
-------------e- ./jsGuide
-------------e- ./LinuxCommands.txt~
-------------e- ./SedReference
-------------e- ./BashTutorial
-------------e- ./Advanced Bash-Scripting Guide.html
-------------e- ./LinuxCommands.txt
-------------e- ./sedref.html
-------------e- ./AwkCom~
-------------e- ./AwkCheatSheet
-------------e- ./BashReference
-------------e- ./tuts
-------------e- ./AwkReference
-------------e- ./Notes
-------------e- ./AwkCommands
-------------e- ./BashTutorial~
-------------e- ./Notes~
-------------e- ./AwkTutorial
-------------e- ./AwkReference~
-------------e- ./bashref.html
-------------e- ./Tutorials
g

I copied them to my usb stick to transfer them to my laptop, but on the usb stick the same commands deliver
Code:

g  cd "/media/NEW VOLUME/LinuxUse"
g  ls
ls: cannot access Tutorials: Input/output error
Advanced Bash-Scripting Guide.html  AwkTits            Notes~                jsGuide
AwkCheatSheet                      AwkTutorial        SedOneLinersExplained  jsRef
AwkCom                              BashReference      SedReference          oAwkTutorial~
AwkCommands                        BashTutorial        ShortNotes            sedref.html
AwkCom~                            BashTutorial~      ShortNotes~            tuts
AwkOneLinersExplained              LinuxCommands.txt  Tutorials
AwkReference                        LinuxCommands.txt~  bashref.html
AwkReference~                      Notes              gawkref.html
g  lsattr
lsattr: Inappropriate ioctl for device While reading flags on ./AwkCom
lsattr: Inappropriate ioctl for device While reading flags on ./ShortNotes~
lsattr: Inappropriate ioctl for device While reading flags on ./oAwkTutorial~
lsattr: Inappropriate ioctl for device While reading flags on ./SedOneLinersExplained
lsattr: Inappropriate ioctl for device While reading flags on ./AwkOneLinersExplained
lsattr: Inappropriate ioctl for device While reading flags on ./gawkref.html
lsattr: Inappropriate ioctl for device While reading flags on ./ShortNotes
lsattr: Inappropriate ioctl for device While reading flags on ./jsRef
lsattr: Inappropriate ioctl for device While reading flags on ./AwkTits
lsattr: Inappropriate ioctl for device While reading flags on ./jsGuide
lsattr: Inappropriate ioctl for device While reading flags on ./LinuxCommands.txt~
lsattr: Inappropriate ioctl for device While reading flags on ./SedReference
lsattr: Inappropriate ioctl for device While reading flags on ./BashTutorial
lsattr: Inappropriate ioctl for device While reading flags on ./Advanced Bash-Scripting Guide.html
lsattr: Inappropriate ioctl for device While reading flags on ./LinuxCommands.txt
lsattr: Inappropriate ioctl for device While reading flags on ./sedref.html
lsattr: Inappropriate ioctl for device While reading flags on ./AwkCom~
lsattr: Inappropriate ioctl for device While reading flags on ./AwkCheatSheet
lsattr: Inappropriate ioctl for device While reading flags on ./BashReference
lsattr: Inappropriate ioctl for device While reading flags on ./tuts
lsattr: Inappropriate ioctl for device While reading flags on ./AwkReference
lsattr: Inappropriate ioctl for device While reading flags on ./Notes
lsattr: Inappropriate ioctl for device While reading flags on ./AwkCommands
lsattr: Inappropriate ioctl for device While reading flags on ./BashTutorial~
lsattr: Inappropriate ioctl for device While reading flags on ./Notes~
lsattr: Inappropriate ioctl for device While reading flags on ./AwkTutorial
lsattr: Inappropriate ioctl for device While reading flags on ./AwkReference~
lsattr: Inappropriate ioctl for device While reading flags on ./bashref.html
./Tutorials: Input/output error
g

I assume the "e" attribute on the originals caused the foul-up of the copy to usb. So I'd like to get rid of that attribute on the originals, and delete whatever is on the usb stick.

porphyry5 07-07-2011 07:16 PM

I got rid of the ones on the usb stick with cfdisk, but that really wasn't the preferred option for those on the hd.

So I ran ls -l on each subdirectory and found 2 items whose permissions were all set to ????????? Thunar deleted each of those taken individually, and once they were gone the other items became deletable too.

However, I've not done that. Even though they have this mysterious e attribute still set, they're fully usable and updateable. The entire problem centered in those 2 items with ??????? permissions, and their presence made the entire set undeleteable.


All times are GMT -5. The time now is 02:59 AM.