cannot erase file

Asked by KKevin901

I am using Ubuntu 8.04 with all the update installed whenever received notification.

I was trying to copy a file folder from HD to USB driveb(file backup), system hanged for several times. But it works normal after reboot. I found the broken file (0 bytes size) in that USB drive target folder. However, when I try to delete the unfinished folder, there was a error window pop up saying "....I/O errors". It does not allow me to delete those broken files and the folder.

Would like to ask anyway that I can remove those broken file. If there anything sort of or similar instruction as checkdisk and defragmenttion function in windows for cleaning up the disk?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Joker Wild
Solved:
Last query:
Last reply:
Revision history for this message
Best Joker Wild (lajjr-deactivatedaccount) said :
#1

in a terminal type "sudo rm filename"
if it is a directory "sudo rm -rf directory/"

this way you are using root to delete also be very careful with the recursive delete..
sudo rm -rf
it is very dangerous.

Revision history for this message
Joker Wild (lajjr-deactivatedaccount) said :
#2

to copy a folder i gui right mouse button copy folder to to directory you want and paste...

if in terminal type "cp -R folder/ /location/

eg file in your home

cp -R ~/directory/specialbackup/ /media/disk/

uppercase or lowercase -R -r in this case is recursive

to find more info type
man cp
or
cp --help

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

To answer your question:

"Would like to ask anyway that I can remove those broken file. If there anything sort of or similar instruction as checkdisk and defragmenttion function in windows for cleaning up the disk?"

Please install and use gparted to check wipe and reformat your usb device...

Open a Terminal from the menu Applications → Accessories → Terminal and type:
(if the system ask you a password give your user password, you will not see nothing when you type it, then press enter)

sudo apt-get install gparted

You will find "partitons editor" (gparted) item under the menu: System→Administration→Partition Editor

Hope this helps

Revision history for this message
KKevin901 (kkevin901) said :
#4

Thanks Leo Albert Jackson Jr, that solved my question.

Revision history for this message
KKevin901 (kkevin901) said :
#5

Thank Leo, this helps. Appreciate!

Revision history for this message
KKevin901 (kkevin901) said :
#6

Thank Leo, this helps. Appreciate!

Revision history for this message
Joker Wild (lajjr-deactivatedaccount) said :
#7

KKevin901
Defrag in windows it is necessary because of the way it files data...for cleaning disks etc and checkdisk is not in Gnu/Linux distro for say but yes there are ways to clean disks just delete files or directories, but for those commands it is not necessary in Gnu/linux also windows drives fail more often then UNIX or Gnu/Linux ones.