Deleting files on a USB Harddrive?

Hi,
I got an external enclosure to use an old hard drive as a usb external hard drive for backing up files to.
I tried deleting all the files but there are quite a lot that cannot be deleted
Nautilus saying “permission denied”.

The harddrive had/has ubuntu 10.4 on it.

Do i need to delete all the files & folders from terminal?
I’m running OpenSuse 11.3 in gnome.
So i’ve got Gnome Terminal.

Any suggestions anyone?
any thanks , Phil

In your terminal

  • Become root
    su -l
  • find out where your usb drive is mounted
    mount
  • change to the directory on your USB drive from where you want to delelete all the files. The text in red is just an example. It will be different on your system
  • cd /mnt/usbdrive
  • make absolutely sure you are on the directory where you want to delete all the files
    pwd
    It should output: /mnt/usbdrive
  • double and triple check
  • also be sure that you really want to delete those files …
  • finally, issue the following command:
    **rm -r ***
  • one last warning: this command is highly dangerous. So be sure you know what you are doing and that the directory from where you are running this command is the one you want to delete all the files from!
  • notice that it won’t delete hidden files. In order to delete hidden files, you should use : rm -r .* This is even more dangerous.

Hi, thanks for the help,

I’m finding it hard to get to the directory i need.

heres the terminal result after mount:

/dev/sdc1 on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,mode=1777)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
securityfs on /sys/kernel/security type securityfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
gvfs-fuse-daemon on /home/philip/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=philip)
/dev/sdd1 on /media/68e52d2e-b4ab-4b38-91ae-bec7ff05014a type ext4 (rw,nosuid,nodev,uhelper=udisks)

The 68e52---- etc is what the hard drive is called when opened
but whatever i type in to try and change directory, terminal is saying there is no such file:

any ideas as to the exact text i want?

sorry to be really useless.
dont worry i wont wipe anything unless i am totally sure.
and your help is very much appreciated.

the mountpoint of /dev/sdd1 looks like an UUID.
What’s the output of these two commands:
blkid /dev/sdd1
cat /etc/fstab

You could always just format it
In gnome right click > format (assumes you have the gnome-disk-utility)

Or to wipe it:

dd if=/dev/urandom of=/dev/sdd

linux-w19f:~ # blkid /dev/sdd1
/dev/sdd1: UUID=“68e52d2e-b4ab-4b38-91ae-bec7ff05014a” TYPE=“ext4”

linux-w19f:~ # cat /etc/fstab
/dev/disk/by-id/ata-Maxtor_6V080E0_V21QB7NG-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-Maxtor_6V080E0_V21QB7NG-part1 / ext4 acl,user_xattr 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

As suggested by caf4926, you can format it or wipe it out, or mount it somewhere else, like :

mount -t ext4 /dev/sdd1 /mnt

and access your drive under /mnt. But if you don’t want to keep anything, just reformat it.

Sorry missed your post caf4926
The format solution sounds less likely to go wrong in the hands of an rookie like myself.

I haven’t got gnome disk utility. So i’ll get it from YaST

Thanks for your help. caf4926 & pleasetryagain

philamanjaro wrote:
> /dev/sdd1 on /media/68e52d2e-b4ab-4b38-91ae-bec7ff05014a type ext4
> (rw,nosuid,nodev,uhelper=udisks)

are you booted from a live CD or working in a VM?

if you COPY and PASTE this code into a root terminal:


cd /media/68e52d2e-b4ab-4b38-91ae-bec7ff05014a

you should land on the root of that USB drive…are you not?

try again, and if it fails they COPY and paste both the command you
put in, and the complete error message, please…

DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]