2

I recently received an "Invalid argument while reading flags on" problem while deleting files in a Linux system.

I cannot delete some (very big files) on a Linux filesystem. I don't know what to do!

id
uid=1000(elias) gid=1000(elias) ομάδες=1000(elias),4(adm),24(cdrom),27(sudo),29(audio),30(dip),46(plugdev),116(lpadmin),122(sambashare)

ls -ld . ..
drwxrwxrwx 1 elias elias 4096 Feb 17 17:04 .
drwxrwxrwx 1 elias elias 4096 Jul 14 18:33 ..

sudo rm *

rm: cannot remove '01st - O Basikos.avi': Input/output error
rm: cannot remove '02nd - The Pigs.avi': Input/output error
rm: cannot remove '02nd - The Pigs - short2.AVI': Input/output error
rm: cannot remove '03rd - O Glaros.avi': Input/output error
rm: cannot remove '04rth - Gio-Gio.avi': Input/output error
rm: cannot remove '07th - To Paixnidi tis Sfagis.avi': Input/output error
rm: cannot remove '08th - I Drakaina.avi': Input/output error
rm: cannot remove '09th - O Zitianos.avi': Input/output error
rm: cannot remove '10th - Troades.avi': Input/output error
rm: cannot remove '69082056_498303567665424_7547131835499675648_n.png': Input/output error
rm: cannot remove '69507971_2418284725052'$'\350\243\260''78_7036264017014292480_o.jpg': No such file or directory
rm: cannot remove '69515885_2418284525052598_830424852870463488_o.jpg': Input/output error
rm: cannot remove '69584492_2418284805052570_8494867853135052800_o.jpg': Input/output error
rm: cannot remove '69868065_2418284518385932_7450056396264964096_o.jpg': No such file or directory
rm: cannot remove '69936932_2418284865052564_2431600811281743872_o.jpg': No such file or directory
rm: cannot remove '69'$'\350\243\260''37965_2418284665052584_6232500998267469824_o.jpg': No such file or directory
rm: cannot remove '6th - Ta Frouta tou Pneumatos.avi': Input/output error
rm: cannot remove '70447879_2418284535052597_6811504792116920320_o.jpg': Input/output error
rm: cannot remove '70615044_2418284641719253_3543323980268044288_o.jpg': Input/output error
rm: cannot remove 'Ektos - O Epitheoritis.avi': Input/output error
rm: cannot remove 'Melina Tanagri.avi': Input/output error
rm: cannot remove 'Vraveia.avi': Input/output error

and lsattr...

 elias@eliasc:/media/elias/MyPassport/Events - Personal - Vids/Theatrikoi Diagonismoi 33oi-Zografou-2019a$ lsattr
lsattr: Invalid argument While reading flags on ./01st - O Basikos.avi
lsattr: Invalid argument While reading flags on ./02nd - The Pigs - short2.AVI
lsattr: Invalid argument While reading flags on ./02nd - The Pigs.avi
lsattr: Invalid argument While reading flags on ./03rd - O Glaros.avi
lsattr: Invalid argument While reading flags on ./04rth - Gio-Gio.avi
lsattr: Invalid argument While reading flags on ./07th - To Paixnidi tis Sfagis.avi
lsattr: Invalid argument While reading flags on ./08th - I Drakaina.avi
lsattr: Invalid argument While reading flags on ./09th - O Zitianos.avi
lsattr: Invalid argument While reading flags on ./10th - Troades.avi
lsattr: Invalid argument While reading flags on ./69082056_498303567665424_7547131835499675648_n.png
lsattr: Invalid argument While reading flags on ./69507971_2418284725052裰78_7036264017014292480_o.jpg
lsattr: Invalid argument While reading flags on ./69515885_2418284525052598_830424852870463488_o.jpg
lsattr: Invalid argument While reading flags on ./69584492_2418284805052570_8494867853135052800_o.jpg
lsattr: Invalid argument While reading flags on ./69裰37965_2418284665052584_6232500998267469824_o.jpg
./69868065_2418284518385932_7450056396264964096_o.jpg: No such file or directory
./69936932_2418284865052564_2431600811281743872_o.jpg: No such file or directory
lsattr: Invalid argument While reading flags on ./6th - Ta Frouta tou Pneumatos.avi
lsattr: Invalid argument While reading flags on ./70447879_2418284535052597_6811504792116920320_o.jpg
lsattr: Invalid argument While reading flags on ./70615044_2418284641719253_3543323980268044288_o.jpg
lsattr: Invalid argument While reading flags on ./Ektos - O Epitheoritis.avi
lsattr: Invalid argument While reading flags on ./Melina Tanagri.avi
./Vraveia.avi: Input/output error

and ls -lQ *

    elias@eliasc:/media/elias/MyPassport/Events - Personal - Vids/Theatrikoi Diagonismoi 33oi-Zografou-2019a$ ls -lQ *
ls: cannot access '69868065_2418284518385932_7450056396264964096_o.jpg': No such file or directory
ls: cannot access '69936932_2418284865052564_2431600811281743872_o.jpg': No such file or directory
ls: cannot access 'Vraveia.avi': Input/output error
-rwxrwxrwx 1 elias elias 15053658390 Sep  6  2019 "01st - O Basikos.avi"
-rwxrwxrwx 1 elias elias   458762716 Sep  6  2019 "02nd - The Pigs - short2.AVI"
-rwxrwxrwx 1 elias elias 10775490376 Sep  7  2019 "02nd - The Pigs.avi"
-rwxrwxrwx 1 elias elias 12010358308 Sep  9  2019 "03rd - O Glaros.avi"
-rwxrwxrwx 1 elias elias  7789788922 Sep  9  2019 "04rth - Gio-Gio.avi"
-rwxrwxrwx 1 elias elias  7377647868 Sep 12  2019 "07th - To Paixnidi tis Sfagis.avi"
-rwxrwxrwx 1 elias elias  7289683606 Sep 16  2019 "08th - I Drakaina.avi"
-rwxrwxrwx 1 elias elias  8526826412 Oct 14  2019 "09th - O Zitianos.avi"
-rwxrwxrwx 1 elias elias  9300601002 Oct 14  2019 "10th - Troades.avi"
-rwxrwxrwx 1 elias elias     1343557 Sep  6  2019 "69082056_498303567665424_7547131835499675648_n.png"
-rwxrwxrwx 1 elias elias      143518 Sep 11  2019 "69507971_2418284725052\350\243\26078_7036264017014292480_o.jpg"
-rwxrwxrwx 1 elias elias      151257 Sep 11  2019 "69515885_2418284525052598_830424852870463488_o.jpg"
-rwxrwxrwx 1 elias elias           0 Feb 18 00:43 "69584492_2418284805052570_8494867853135052800_o.jpg"
-rwxrwxrwx 1 elias elias      159896 Sep 11  2019 "69\350\243\26037965_2418284665052584_6232500998267469824_o.jpg"
-rwxrwxrwx 1 elias elias 13958209594 Sep 11  2019 "6th - Ta Frouta tou Pneumatos.avi"
-rwxrwxrwx 1 elias elias      145183 Sep 11  2019 "70447879_2418284535052597_6811504792116920320_o.jpg"
-rwxrwxrwx 1 elias elias           0 Feb 18 00:44 "70615044_2418284641719253_3543323980268044288_o.jpg"
-rwxrwxrwx 1 elias elias 11083624324 Sep 14  2019 "Ektos - O Epitheoritis.avi"
-rwxrwxrwx 1 elias elias  7974938232 Sep 16  2019 "Melina Tanagri.avi"

and dmseg....

    [   84.158595] audit: type=1400 audit(1594676419.746:51): apparmor="ALLOWED" operation="file_mmap" profile="snap.anbox.container-manager//null-/usr/sbin/aa-exec" name="/usr/sbin/aa-exec" pid=1582 comm="aa-exec" requested_mask="rm" denied_mask="rm" fsuid=0 ouid=0
[   84.158602] audit: type=1400 audit(1594676419.746:52): apparmor="ALLOWED" operation="file_mmap" profile="snap.anbox.container-manager//null-/usr/sbin/aa-exec" name="/lib/x86_64-linux-gnu/ld-2.23.so" pid=1582 comm="aa-exec" requested_mask="rm" denied_mask="rm" fsuid=0 ouid=0
[   84.159084] audit: type=1400 audit(1594676419.746:53): apparmor="ALLOWED" operation="open" profile="snap.anbox.container-manager//null-/usr/sbin/aa-exec" name="/etc/ld.so.cache" pid=1582 comm="aa-exec" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   84.159152] audit: type=1400 audit(1594676419.746:54): apparmor="ALLOWED" operation="open" profile="snap.anbox.container-manager//null-/usr/sbin/aa-exec" name="/lib/x86_64-linux-gnu/libpthread-2.23.so" pid=1582 comm="aa-exec" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   84.159157] audit: type=1400 audit(1594676419.746:55): apparmor="ALLOWED" operation="file_mmap" profile="snap.anbox.container-manager//null-/usr/sbin/aa-exec" name="/lib/x86_64-linux-gnu/libpthread-2.23.so" pid=1582 comm="aa-exec" requested_mask="rm" denied_mask="rm" fsuid=0 ouid=0
[   84.159326] audit: type=1400 audit(1594676419.746:56): apparmor="ALLOWED" operation="open" profile="snap.anbox.container-manager//null-/usr/sbin/aa-exec" name="/lib/x86_64-linux-gnu/libc-2.23.so" pid=1582 comm="aa-exec" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
[   84.159330] audit: type=1400 audit(1594676419.746:57): apparmor="ALLOWED" operation="file_mmap" profile="snap.anbox.container-manager//null-/usr/sbin/aa-exec" name="/lib/x86_64-linux-gnu/libc-2.23.so" pid=1582 comm="aa-exec" requested_mask="rm" denied_mask="rm" fsuid=0 ouid=0
[   84.195823] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[   84.203002] IPv6: ADDRCONF(NETDEV_UP): lxcbr0: link is not ready
[   84.243401] nf_conntrack version 0.5.0 (16384 buckets, 65536 max)
[   93.236203] kauditd_printk_skb: 7 callbacks suppressed
[   93.236204] audit: type=1326 audit(1594676428.826:65): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=1582 comm="anbox" exe="/snap/anbox/158/usr/bin/anbox" sig=0 arch=c000003e syscall=165 compat=0 ip=0x7f718849fb9a code=0x7ffc0000
[   93.284036] resource sanity check: requesting [mem 0x000c0000-0x000fffff], which spans more than PCI Bus 0000:00 [mem 0x000d0000-0x000d3fff window]
[   93.284203] caller os_map_kernel_space.part.8+0x10b/0x150 [nvidia] mapping multiple BARs
[   93.497901] audit: type=1326 audit(1594676429.086:66): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=1582 comm="anbox" exe="/snap/anbox/158/usr/bin/anbox" sig=0 arch=c000003e syscall=165 compat=0 ip=0x7f718849fb9a code=0x7ffc0000
[   93.500379] audit: type=1326 audit(1594676429.090:67): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=1582 comm="anbox" exe="/snap/anbox/158/usr/bin/anbox" sig=0 arch=c000003e syscall=165 compat=0 ip=0x7f718849fb9a code=0x7ffc0000
[   93.505450] audit: type=1326 audit(1594676429.094:68): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=1582 comm="anbox" exe="/snap/anbox/158/usr/bin/anbox" sig=0 arch=c000003e syscall=165 compat=0 ip=0x7f718849fb9a code=0x7ffc0000
[12326.801458] perf: interrupt took too long (2538 > 2500), lowering kernel.perf_event_max_sample_rate to 78750
[17231.226813] perf: interrupt took too long (3213 > 3172), lowering kernel.perf_event_max_sample_rate to 62250
[23067.074788] perf: interrupt took too long (4030 > 4016), lowering kernel.perf_event_max_sample_rate to 49500
[24415.334432] audit: type=1400 audit(1594700750.025:69): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/9436/usr/lib/snapd/snap-confine" pid=21658 comm="apparmor_parser"
[24415.334440] audit: type=1400 audit(1594700750.025:70): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="/snap/core/9436/usr/lib/snapd/snap-confine//mount-namespace-capture-helper" pid=21658 comm="apparmor_parser"
[24415.630792] audit: type=1400 audit(1594700750.321:71): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="snap.hugo.hugo" pid=21660 comm="apparmor_parser"
[24415.804123] audit: type=1400 audit(1594700750.493:72): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap-update-ns.hugo" pid=21662 comm="apparmor_parser"
[24415.815070] audit: type=1400 audit(1594700750.505:73): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap-update-ns.core" pid=21663 comm="apparmor_parser"
[24415.833547] audit: type=1400 audit(1594700750.521:74): apparmor="STATUS" operation="profile_replace" info="same as current profile, skipping" profile="unconfined" name="snap.core.hook.configure" pid=21664 comm="apparmor_parser"
[30198.603216] usb 3-9: new high-speed USB device number 6 using xhci_hcd
[30198.752148] usb 3-9: New USB device found, idVendor=058f, idProduct=6366
[30198.752150] usb 3-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[30198.752151] usb 3-9: Product: Mass Storage Device
[30198.752153] usb 3-9: Manufacturer: Generic
[30198.752154] usb 3-9: SerialNumber: 058F63666433
[30198.752667] usb-storage 3-9:1.0: USB Mass Storage device detected
[30198.752757] scsi host8: usb-storage 3-9:1.0
[30199.887649] scsi 8:0:0:0: Direct-Access     Multiple Card  Reader     1.00 PQ: 0 ANSI: 0
[30199.888108] sd 8:0:0:0: Attached scsi generic sg3 type 0
[30201.023835] sd 8:0:0:0: [sdc] 31387648 512-byte logical blocks: (16.1 GB/15.0 GiB)
[30201.024168] sd 8:0:0:0: [sdc] Write Protect is off
[30201.024169] sd 8:0:0:0: [sdc] Mode Sense: 03 00 00 00
[30201.024469] sd 8:0:0:0: [sdc] No Caching mode page found
[30201.024472] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[30201.028920]  sdc: sdc1
[30201.030266] sd 8:0:0:0: [sdc] Attached SCSI removable disk
[30219.804093] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

dmesg | grep EXT4 .....

 dmesg | grep EXT4 
   [    6.161317] EXT4-fs (sdb2): mounted filesystem with ordered data mode. Opts: (null) [   14.696792] EXT4-fs (sdb2): re-mounted. Opts: errors=remount-ro 

As it was suggested, I did:

sudo gedit /etc/default/grub  

added: GRUB_CMDLINE_LINUX="fsck.mode=force fsck.repair=yes" and then, I ran update-grub.

My HDD is not mounted automatically at boot. I didn't see that fsck checked it at all.

DISKS utility find data on that HDD as NTFS. How I can check its filesystem integrity without using Windows?

9
  • Use fsck to repair those file system errors. For more information on how to use it, refer to this post
    – Rayleigh
    Commented Jul 14, 2020 at 16:58
  • @Rayleigh Do not link other web sites when unneeded, please. Look on our site, there already is my question addressing this at boot time, which is what he / she needs. Commented Jul 14, 2020 at 18:33
  • @Rayleigh i faced a problem. fsck says cannot check my (gpt) drive due to bad magic block. I run gdrive and says all ok. What I can do now? Commented Jul 14, 2020 at 18:35
  • @LinuxSecurityFreak You are right I'll keep that in mind. Estatistics, this problem is out of scope for this question. Please post a new question detailing your problem so that the community can help you.
    – Rayleigh
    Commented Jul 14, 2020 at 18:50
  • @LinuxSecurityFreak i posted my question here: stackoverflow.com/questions/62901646/… you can move it at linux sub forum or create a new one? Commented Jul 14, 2020 at 18:54

1 Answer 1

0

As of 15Jul2020, there is no option to check filesystem integrity of a Hard disk formatted as NTFS under Linux.

What I did?

  • I downloaded the free trial of Windows Enterprise as ISO
  • sudo apt-get remove virtualbox virtualbox-dkms virtualbox*
  • Install the latest Virtualbox from here
  • Download the matched version of Virtualbox extpack
  • Add to disk group, me, as user, due to access deny hard disk error
    • sudo usermod -a -G disk $USER
    • sudo usermod -a -G vboxusers $USER
  • Run sudo /sbin/vboxconfig
  • Run VirtualBox, and add Virtualbox extpack at File -> Preferences -> Extentions
  • Restart your Computer
  • Create a link to your physical Hard Disk which is NTFS (either usb or not) using VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/sdX
  • Create Machine -> New -> Windows 10 (64bit) (whatever match) -> Create a Virtual Disk
  • Attach the Downloaded Windows Enterprise Free trial ISO image
  • At your newly created Virtual Windows Image --> preferences -> Storage -> attach the vmdk image of your ntfs hdd
  • It may fail. Dont worry. To me failed too. I refer to it, because I found it. It may work for you.
  • Go to Virtual Windows Image --> preferences -> USB, check USB 3, add your NTFS HDD
  • Run your Virtual "Windows Enterprize Free Trial" machine.
  • Click Continue, Repair your computer (at left down side), Troubleshooting, Run Command Prompt
  • Go to your disk by writing eg. C:
  • Check that it is your disk somehow eg. dir
  • Run chkdsk /f when you are on your disk

This process fixed my NTFS filesystem that it was fault. I hope it helpt you too.

If you find any easier solution, only under Linux, please post it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .