I did a ls -l on one of my folders and came across this:
-????????? ? ? ? ? ? ellington-duke-the-works-of-duke-integrale-vol21.flac
How can I get rid of this file that does not exist? rm doesn't work.
randy@cb11dv6:/media/mainserver/lps/E$ rm ./ellington-duke-the-works-of-duke-integrale-vol21.flac rm: cannot remove `./ellington-duke-the-works-of-duke-integrale-vol21.flac': Input/output error _____________ randy@cb11dv6:/media/mainserver/lps/E$ file ./ellington-duke-the-works-of-duke-integrale-vol21.flac ./ellington-duke-the-works-of-duke-integrale-vol21.flac: ERROR: cannot open `./ellington-duke-the-works-of-duke-integrale-vol21.flac' (Input/output error) ________________ randy@cb11dv6:/media/mainserver/lps/E$ stat ./ellington-duke-the-works-of-duke-integrale-vol21.flac stat: cannot stat `./ellington-duke-the-works-of-duke-integrale-vol21.flac': Input/output error
^doesn't look good. Maybe you've got some file system corruption? You could try forcing a fsck (file system check, which fixes corrupted sections). Run this
sudo touch /forcefsck
Last edited by johnraff (2014-11-14 07:23:01)
I forgot to mention that the file in question is on my external USB drive. So, what is the correct syntax to run fsck on my USB drive? Do I just put the path to the drive? Something like this:
sudo touch /media/usbdrive forcefsck
I just want to make sure I'm doing this right. Thanks!!
^ ooooh. I suppose you use one of the junk file systems FAT16/FAT32, exFAT or NTFS on that one.
In all cases, unmount all partitions on the USB device. Run the 'lsblk' command and identify the block device the USB file system is on. For example, '/dev/sdb1'. Below, let $DEVICE be the device you have identified here.
In the case of NTFS, you should use a Windows computer for checking and repairing the file system. There's the 'ntfsfix' tool from the ntfs-3g package, but it only has very limited capabilities and won't operate reliably. You can also run Windows in a virtual machine and pass the USB block device through to the VM. Here's how to do that with qemu-kvm. virtualbox offers similar functionality.
$ sudo ntfsfix -d $DEVICE
In the case of FAT16/FAT32, you execute
$ sudo fsck.fat -a -V -w $DEVICE
The situation with exFAT is similar to NTFS, only that fsck.exfat won't even attempt to fix any errors. Again, use a Windows or Apple computer, or possibly an Android device (tablet, ...) with an USB port. After installing 'exfat-utils', you can check the $DEVICE for errors like so:
$ sudo fsck.exfat $DEVICE
Last edited by twoion (2014-11-14 14:34:38)
sudo fsck.ext4 -p -f /dev/sdb
use lsblk like said above to double check, but if you only have one hard drive and this usb drive plugged in, it's probably /dev/sdb
Also remember to unmount the usb drive as said above. Just open thunar right click the drive in the left panal and click unmount.
"/media/usbdrive" is where the device "/dev/sdb" is mounted on your system, whereas /dev/sdb is the actual device.
Last edited by woodape (2014-11-14 19:35:31)
Thanks, so can I do something like this:
sudo fsck.ext4 -p -f /media/usbdrive
The device must be un-mounted before running fsck, so you will need to use /dev/sdb
Last edited by Head_on_a_Stick (2014-11-14 19:35:53)