LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 08-01-2007, 02:27 PM   #1
douart
LQ Newbie
 
Registered: Oct 2006
Distribution: SuSE11.1 86_64
Posts: 16

Rep: Reputation: 0
cannot delete folder


I copied root folder onto an external fat32 drive to back it up before changing partitions.
I can't get rid of the /dev folder.
I whittled /dev down to /dev/fd/6.
/fd is a link and all the files in it are links.
I have found out that checking Properties of /media/disk starts some sort of loop that continues beyond what the actual system file gives. Deleting /media/disk/dev starts some sort of loop.
rm -rfd /media/disk/dev as root, even though I am the owner, starts a loop until I "ctrl z" to stop the process.

I also tried a live cd. I also tried with the drive connected to XP.

ls -l gives the following.
/media/disk # ls -l /media/disk/dev
total 16
drwxr-xr-x 3 don root 16384 Jul 29 08:50 fd

The 3 is different than the other files. What does that mean?
 
Old 08-01-2007, 02:42 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Why do you need to delete the /dev directory? If it's a reasonably recent Linux distro this directory will be generated at boot by udev.

Also, *all* the file ownerships and permissions will be gone if you've backed up onto fat32, so doing a restore of the root partition will be a major headache.

Dave
 
Old 08-02-2007, 07:23 AM   #3
douart
LQ Newbie
 
Registered: Oct 2006
Distribution: SuSE11.1 86_64
Posts: 16

Original Poster
Rep: Reputation: 0
Right Dave

I did not need any of the files after copying them.
Now I am trying to remove them from my backup drive.
All have been deleted except media/dev/fd/6/fd/6/fd/6/fd/6/fd/6/fd/6........and on it goes!

(I am using suse 10.2_64)

Last edited by douart; 08-02-2007 at 07:28 AM.
 
Old 08-02-2007, 08:01 AM   #4
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
Try
Code:
 rm media/dev/fd/6/
, then delete everything else. There's a recursive loop there.
 
Old 08-03-2007, 12:48 PM   #5
douart
LQ Newbie
 
Registered: Oct 2006
Distribution: SuSE11.1 86_64
Posts: 16

Original Poster
Rep: Reputation: 0
Tried

rm media/disk/dev/fd/6/
rm media/disk/dev/fd/6
rm media/disk/dev/fd/
rm media/disk/dev/
pilgrim2x:/media/disk/dev # rm *

and other variations. They did not work.

(error message) rm: cannot remove `(whatever)': Is a directory

The loop is to directories.
 
Old 08-03-2007, 05:47 PM   #6
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
Yes, of course, it's a directory, you need to type
Code:
rm media/disk/dev/fd/6
omitting the slash in the end (it's a symbolic link, right?).
 
Old 08-04-2007, 08:19 AM   #7
douart
LQ Newbie
 
Registered: Oct 2006
Distribution: SuSE11.1 86_64
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by auxsvr
Yes, of course, it's a directory,
you need to type
Code:
rm media/disk/dev/fd/6
omitting the slash in the end (it's a symbolic link, right?).
I don't know what 6 is except that it is a directory.
My system folder /dev/fd, like the folder that was originally copied, is a link to /proc/self/fd and
has no folders in it and no 6 now of any kind.
There are files 1 through 5 in it that are links to different things or files.

The following is what I received:

pilgrim2x:~ # rm /media/disk/dev/fd/6
rm: cannot remove `/media/disk/dev/fd/6': Is a directory
pilgrim2x:~ #
 
Old 08-04-2007, 08:26 AM   #8
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
Quote:
Originally Posted by douart
pilgrim2x:~ # rm /media/disk/dev/fd/6
rm: cannot remove `/media/disk/dev/fd/6': Is a directory
Have you tried:
Code:
pilgrim2x:~ # rm -rf /media/disk/dev/fd/6
or
use mc ?
 
Old 08-04-2007, 10:46 AM   #9
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
What about
Code:
 rmdir /media/disk/dev/fd/6
?
 
Old 08-05-2007, 09:04 AM   #10
douart
LQ Newbie
 
Registered: Oct 2006
Distribution: SuSE11.1 86_64
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dxqcanada
Have you tried:
Code:
pilgrim2x:~ # rm -rf /media/disk/dev/fd/6
Yes

Code:
pilgrim2x:~ # rm -rfd /media/disk/dev/
is the first command I tried. That or against any of the subfolders starts a seemingly unending loop, with or without a slash at the end.

[QUOTE=dxqcanada]
Quote:
Originally Posted by dxqcanada
or use mc ?
I don't know what mc is. I will look into it after church or tomorrow morning.

Quote:
Originally Posted by auxsvr
What about
Code:
 rmdir /media/disk/dev/fd/6
?
rmdir complains about the directory not being empty.

I noticed what may be a clue this morning. I tried again to delete /media/disk/dev with konqueror file manager. In the delete dialog box, as the number of deleted folders was skyrocketing into the thousands, there were also hundreds of files building up.

No files are ever displayed when clicking on /media/disk/dev, just folders: /media/disk/dev/fd/6/fd/6/fd/6/fd/6/fd/6/fd/6........and on it goes!

Reminder: 500GB external drive, fat32 file system, have not been able to delete /media/disk/dev/ that I copied from /dev/.

I appreciate the help.
 
Old 08-05-2007, 10:14 AM   #11
auxsvr
Member
 
Registered: Dec 2006
Distribution: openSUSE 10.3
Posts: 260

Rep: Reputation: 30
Since /media/disk/dev/fd/6 is not a symbolic link, you either have thousands of directories with the names you show above (maybe you created them by mistake) or the filesystem is corrupted (do a fsck or scandisk on it). I cannot think of another possibility at the moment. Did any error message appear when you were copying the files?
 
Old 08-08-2007, 12:58 PM   #12
douart
LQ Newbie
 
Registered: Oct 2006
Distribution: SuSE11.1 86_64
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by auxsvr
Since /media/disk/dev/fd/6 is not a symbolic link, you either have thousands of directories with the names you show above (maybe you created them by mistake) or the filesystem is corrupted (do a fsck or scandisk on it). I cannot think of another possibility at the moment.
Good thinking auxsvr.
If I had not jumped to conclusions I would have deleted /media/disk/dev/ long ago.

Quote:
Originally Posted by auxsvr
or the filesystem is corrupted (do a fsck or scandisk on it)
filesystem checked OK

I was checking the drive again in XP. I notice that the folder was read only. On a lark I set to change the attributes to archive.
Off it went on a seeming endless process. I was watching the path fly by in the dialogue box when in the blur at the end there seemed to be a 9!
I stopped the process and opened /media/disk/dev/ in a fiemanager.
Again, /media/disk/dev/fd/6/fd/6/fd/6.....
23 folders down, was /6 with folders named 9, 10, 11, 12, 13, 14, and 15 within. Within these folders were folders of folders with different numbers of folders with numerical names up to the low thirty's.
On and on the branches (or roots) of the tree went.
Every once in a while there would be two files together, sometimes named stderr and stdout or named 1 and 2 all with the same message. Something about icon paths if I remember correctly. Also, occasionally there were about 5 or 6 empty folders with the same names as some of the folders in the system folder /dev.

Since, as you point out, these did not show to be linked, there must be an end to it and
"rm -rfd /media/disk/dev/" should work.

Out of curiosity I checked the properties of /media/disk/dev/ again using konqueror. This time I let it run.
2 3/4 hours later when konqueror locked up it showed 17290 files and 392261 sub-folders using 6+GB of space.

Tiring of /media/disk/dev/ I then ran
"rm -rfd /media/disk/dev/" and about 29 minutes later it was gone.

I could have copied everything except /media/disk/dev/ and reformatted quicker, but it has been fun.

Thanks again for the help.
don
 
  


Reply



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
cannot delete folder ungua SUSE / openSUSE 3 05-09-2007 07:42 AM
How do I delete a folder? Ordinary12 Fedora 17 05-03-2007 07:03 PM
seems like I delete my /etc folder. bladehaze Debian 9 09-12-2005 11:47 AM
How do I delete a folder and everything in it? wuya Linux - Newbie 3 04-22-2005 02:03 PM
How to delete the whole folder without being prompted anything conkhikho Linux - Newbie 1 10-27-2003 01:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 06:43 PM.

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
Open Source Consulting | Domain Registration