Re: sym link question...

From: Cameron Simpson (cs_at_zip.com.au)
Date: 03/10/05

  • Next message: Zhang Lei: "Re: Ethernet Driver For Dell 1850"
    Date: Thu, 10 Mar 2005 12:12:39 +1100
    To: bedouglas@earthlink.net, For users of Fedora Core releases <fedora-list@redhat.com>
    
    

    On 09Mar2005 16:39, bruce <bedouglas@earthlink.net> wrote:
    | i have a question regarding symlinks. i have my system partitioned
    |
    | /dev/hda5 100 /
    | /dev/hda1 10000 /home
    | /dev/hda2 30000 /usr
    |
    | is it possible to create a symlink that would allow '/' to point to
    | /usr/root. i'm inclined to think you can't but i'm not knowledgeable about
    | the concept of symlinks within linux....

    You can't.
    You could perhaps go the other way depending what you wanted to achieve
    and why, and how hard you want to work.

    A symlink is a normal filesystem object, like a file or a directory etc,
    in that such an object must _be_ something. So you can't make a symlink
    for / because / must be a directory.

    | would you have to copy the dir structure under '/' to the symlink. and
    | wouldn't this cause a recursive issue/situation??

    A symlink just points somewhere. You'd move the directory contents to that somewhere. Example:

            mkdir foo
            echo 1 >foo/1
            echo 2 >foo/2

    makes a directory "foo" with some stuff in it. Supposing you actually
    wanted it at "bah" and wanted a symlink at foo (eg to support scripts
    that might know the old "foo" name), you'd go:

            mv foo bah
            ln -s bah foo

    That moved foo sideways to bah, and then makes a symlink named "foo" that
    points at "bah".

    / is special - it's got to be a directory, being at the top of the
    filesystem; there's nowhere to put the symlink; consider that the symlink
    above for "foo" is in fact stored in the directory containing "foo" -
    there is no directory "containing" "/".

    Does this clarify things at all?

    -- 
    Cameron Simpson <cs@zip.com.au> DoD#743
    http://www.cskk.ezoshosting.com/cs/
    If I can make a dress out of a chicken feed sack, I can make a man out of
    you.    - another great country music lyric
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Zhang Lei: "Re: Ethernet Driver For Dell 1850"

    Relevant Pages

    • Re: /etc/init.d/ - add/remove services
      ... > Note that the expectation of the System V init system is ... If there is no symlink for a service in a particular ... > runlevel then the behavior of sysv's invoke-rc.d is undefined ... as a foo script even though it links to foo. ...
      (Debian-User)
    • Re: Creating symlinks with GNU build system?
      ... > make bar a symlink to foo. ... preserve symbolic links. ...
      (comp.unix.programmer)
    • Re: RE: Is FreeBSDs tar susceptible to this?
      ... >> What if the tarball installs a symlink to / under the current directory ... I don't have an easy way of creating a malicious tarball to do this all ... > mkdir foo ... > tar cvf foo.tar foo/bar ...
      (FreeBSD-Security)
    • Re: RE: Is FreeBSDs tar susceptible to this?
      ... The symlink doesn't have to exist ahead of time. ... % rm -rf foo baz ... % tar rvf foo.tar foo/bar ...
      (FreeBSD-Security)
    • Re: sym link question...
      ... A symlink is a normal filesystem object, like a file or a directory etc, ... makes a directory "foo" with some stuff in it. ... wanted it at "bah" and wanted a symlink at foo (eg to support scripts ...
      (Fedora)