link and unlink , urgently... | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    

UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

link and unlink , urgently...

UNIX for Advanced & Expert Users

Closed Thread    
Thread Tools Search this Thread Display Modes
Old 12-17-2001
umonk umonk is offline
Registered User
Join Date: Dec 2001
Last Activity: 17 December 2001, 2:05 AM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Data link and unlink , urgently...

Hi all

I did something incorrectly about link command.
I try to make a link from a sub-dir to root dir, but I use the following command:
link / zzz

the result is sub-dir "zzz" was linked to "/"

Then I want to remove the "zzz" by using unlink command:
unlink zzz
It say that "Device busy"
I cannot rm nor rmdir. I can only rename it but cannot move it to any directory.

I try to boot to single user mode and try to unlink it again but it still device busy.

What happen to "zzz"
How can I delete the "zzz" without lost any content in my root dir?
Sponsored Links
Old 12-17-2001
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
Join Date: Aug 2001
Last Activity: 23 January 2015, 1:13 PM EST
Location: Ashburn, Virginia
Posts: 9,931
Thanks: 64
Thanked 442 Times in 262 Posts
I doubt that there is any reasonable way to do this. The inode is a mount point, so the unlink system call can't touch it. I would just rename to "..." and leave it alone. It isn't causing much trouble. It's like a bullet too close to a's too risky to attempt removal.

One thing that might work would be to try nfs. Export or share the root volume. And then use nfs to "remotely" mount a second copy of it. Then try the unlink via nfs. This really should fail, but with nfs, you never know.

And the final option would be editing the raw device. You may have a program called fsdb for this purpose.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to Unlink all files in a directory? dahlia84 Shell Programming and Scripting 1 07-13-2010 06:24 AM
Cron could not unlink FIFO patidarv Solaris 5 12-17-2009 11:54 AM
Accidentally did a unlink inet deaconf19 Solaris 1 03-27-2008 02:00 AM
perl unlink question jerardfjay Shell Programming and Scripting 2 09-23-2006 10:35 AM
mv: cannot unlink ???? super_duper_guy UNIX for Dummies Questions & Answers 1 11-24-2005 01:34 PM

All times are GMT -4. The time now is 02:17 PM.