LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-21-2013, 08:43 PM   #1
actinide
Member
 
Registered: Jan 2012
Posts: 155

Rep: Reputation: Disabled
Delete folder on external storage


I've been trying to delete a folder on a seagate external harddrive by formatting
it but every time I go back in it's still there. I've tried sending it to the
trash bin but file permissions are blanked out. Can anybody help.
 
Old 06-21-2013, 09:09 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
for difficult situations like this I generally use
Code:
rm -rf
And when that does not work I delete the partition and begin again, format and the drive should be ready.

Be sure you are not trying to remove the Drive's rescue-disk-tools (if any).
 
Old 06-21-2013, 09:20 PM   #3
actinide
Member
 
Registered: Jan 2012
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi GlennsPref, My experience with the terminal is limited is there another way. The folder is locked the question how do I get access o delete the folder. It says I'm not the owner of the folder, if I can ownership than I can delete the folder.
 
Old 06-21-2013, 11:21 PM   #4
J.A.X
Member
 
Registered: Jan 2010
Distribution: Fedora 19
Posts: 83

Rep: Reputation: 3
Hello actinide

Try login as root and run:

PHP Code:
chown -R root.root /path/to-folder/folder_name 
this will change the owner ship to the root user or you could try
PHP Code:
chmod -R 777 /path/to-folder/folder_name 
this will add read, write and execute permissions to all users

then try to remove it using

PHP Code:
rm -fR /path/to-folder/folder_name 
Hope this helps
 
Old 06-22-2013, 01:37 AM   #5
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 506

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by J.A.X View Post
chown -R root.root /path/to-folder/folder_name
You don’t have to chown any folder as root to delete a folder. root (superuser) can delete any folder irrespective of whoever is owner for that particular folder.

Quote:
Originally Posted by actinide View Post
My experience with the terminal is limited is there another way. The folder is locked the question how do I get access o delete the folder. It says I'm not the owner of the folder, if I can ownership than I can delete the folder.
You can delete folder in terminal as GlennsPref has already mentioned.

Code:
# rm -rf <folder>
If you are not comfortable with terminal, you can open nautilus (file browser) as root to perform delete operation.

In Redhat variants, press Alt-F2 on your keyboard, then type the command in Run: beesu nautilus
In Ubuntu, press Alt-F2 on your keyboard, then type the command in Run: gksu nautilus

Note: beesu is not installed by default. you have to install it from EPEL repo. Or you can download RPM and install yourself from here.

Last edited by mddnix; 06-22-2013 at 01:42 AM.
 
Old 06-22-2013, 08:17 PM   #6
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Posts: 3,366
Blog Entries: 33

Rep: Reputation: 216Reputation: 216Reputation: 216
Midnightcommander is a file manager GUI that allows root actions,

but so do many others now.

you will be asked for the root password when invoking root actions as a USER.

I was going to mention using gksu <program> or gksudo <program>, but it's different
Quote:
Note: beesu is not installed by default.
with Mageia.

Cheers
 
Old 06-23-2013, 12:15 PM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
I think this query needs more information and clarification. If you're formatting the drive, then what's currently on it should be irrelevant, as everything will be wiped.

So give us more details. What is the exact configuration of the drive (what filesystems, partitions etc)? What does this offending directory name look like? What commands are you using to try to delete it, or reformat it, or what? What is the exact output you are getting when you try to do this? What error messages, etc?
 
Old 06-23-2013, 02:31 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Quote:
Originally Posted by actinide View Post
I've been trying to delete a folder on a seagate external harddrive by formatting
it but every time I go back in it's still there. I've tried sending it to the
trash bin but file permissions are blanked out. Can anybody help.
how exactly are you trying to format the drive? is the drive mounted, are you using fdisk, etc...

typically you would want to perform the following tasks:

1. verify if this device has any software that puts it to sleep like 90%+ of WD and SanDisk external drives do. If so plug the device into a MS Windows computer, run their software and tell it to never go to sleep.

2. plug the device into your system while running as root:
Code:
# tail -f /var/log/messages
you are watching for /dev/sdX# were X is a lower case letter typically b or c or d, etc... and the # is a number typically 1.

3. verify that the device is NOT automagically mounted via your GUI:
Code:
# df -Th
***note*** this can be performed as user or root, but as the rest of the steps require root, just stay root for this too.

4. if mounted umount the device. this is a MUST. if you fail this step you will never be able to change the partition scheme nor format the drive.

5. fdisk the device and set it to ext type file system:
Code:
# fdisk /dev/sdX#
d  <hit enter>
***note*** if prompted for more then one partition you will have to delete them all
<hit enter for default answer>
n   <hit enter>
p  for primary
***note*** if you want more then one partition then this will also need to be repeated and you will need to tell fdisk how large each partition will need to be otherwise just hit enter until back to prompt
1  for one partition then hit enter until back to prompt
w   to write and quit fdisk

# mkfs.ext4 /dev/sdX1
to test and verify, create a mount point and mount the device:
Code:
# mkdir /mnt/FOO
# mount /dev/sdX1 /mnt/FOO
# df -Th
if you see it there you have mounted the drive and can now ls -laF to view the details on that drive.
 
Old 06-24-2013, 12:42 AM   #9
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 304

Rep: Reputation: 121Reputation: 121
If you have successfully formatted the drive and the directory is still there, I suspect the directory is being created there automatically by the system. Is this directory, by any chance, called lost+found?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to delete tmp view storage in clearcase dayalan_cse Linux - General 1 10-26-2012 05:38 AM
A Command to Delete the Oldest Sub-folder in a Specific Folder imayneed Linux - Newbie 13 08-05-2012 08:53 PM
Shell script to delete old files whenever storage limit is crossed phani.junk1 Linux - General 6 10-19-2009 12:14 PM
A script within a folder to delete the folder, script, and the folder's contents Cyberman Programming 15 10-17-2007 08:32 AM


All times are GMT -5. The time now is 06:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration