SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-11-13 23:27:05

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

deleting a file that does not exist

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.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

Help fund CrunchBang, donate to the project!

#2 2014-11-13 23:33:02

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: deleting a file that does not exist

Try

for i in ./*;do echo "$i";done

Does it give you any better info about the file?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#3 2014-11-13 23:51:22

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: deleting a file that does not exist

No. This is what I see:

./ellington-duke-the-works-of-duke-integrale-vol21.flac

Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#4 2014-11-14 00:16:07

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: deleting a file that does not exist

^and what happens if you do:

rm ./ellington-duke-the-works-of-duke-integrale-vol21.flac

?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#5 2014-11-14 00:17:36

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: deleting a file that does not exist

Also, try

file ./ellington-duke-the-works-of-duke-integrale-vol21.flac

or

stat ./ellington-duke-the-works-of-duke-integrale-vol21.flac

John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#6 2014-11-14 00:38:15

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: deleting a file that does not exist

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

Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#7 2014-11-14 01:20:28

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: deleting a file that does not exist

^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

then reboot.

Last edited by johnraff (2014-11-14 07:23:01)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#8 2014-11-14 06:39:01

twoion
Moderator
Registered: 2012-05-11
Posts: 1,648

Re: deleting a file that does not exist

unlink $file

?


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#9 2014-11-14 11:01:53

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: deleting a file that does not exist

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!!


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#10 2014-11-14 14:33:52

twoion
Moderator
Registered: 2012-05-11
Posts: 1,648

Re: deleting a file that does not exist

^ 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)


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#11 2014-11-14 16:36:56

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: deleting a file that does not exist

I just checked the drive and it is formatted as ext4.


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#12 2014-11-14 16:39:50

twoion
Moderator
Registered: 2012-05-11
Posts: 1,648

Re: deleting a file that does not exist

That's unexpected! Then just:

sudo fsck.ext4 -p -f $DEVICE

Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#13 2014-11-14 18:50:02

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: deleting a file that does not exist

Thanks, so can I do something like this:

sudo fsck.ext4 -p -f /media/usbdrive

Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#14 2014-11-14 19:33:46

woodape
#! CrunchBanger
From: Cape Town, South Africa
Registered: 2014-03-27
Posts: 113

Re: deleting a file that does not exist

more likely

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)

Offline

#15 2014-11-14 19:35:28

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: deleting a file that does not exist

rmcellig wrote:

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

EDIT: Ninja'd...
sad

Last edited by Head_on_a_Stick (2014-11-14 19:35:53)

Offline

#16 2014-11-14 19:51:30

twoion
Moderator
Registered: 2012-05-11
Posts: 1,648

Re: deleting a file that does not exist

^ The question is whether his usb drive has a partition table (don't know about yours, but mine do. What's the standard?) so it could be /dev/sdX or /dev/sdXY too...


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

#17 2014-11-14 22:32:53

rmcellig
#! Die Hard
From: Ottawa, Canada
Registered: 2012-11-15
Posts: 624
Website

Re: deleting a file that does not exist

Here is the info on the drive :

usbdrive.jpg


Cheers Randy
www.mcran.com - my web site
www.chuo.fm - My radio show Sundays  noon-2pm EST or 89.1 fM

Offline

#18 2014-11-14 22:35:42

twoion
Moderator
Registered: 2012-05-11
Posts: 1,648

Re: deleting a file that does not exist

Then it's /dev/sdb1, obviously.


Tannhäuser ~ {www,pkg,ddl}.bunsenlabs.org/{gitlog,repoidx}

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo