1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Linux ln symbolic links

Discussion in 'Linux & Open Source' started by MTA99, 16 Sep 2009.

  1. MTA99

    Mobster

    Joined: 18 Oct 2002

    Posts: 4,102

    Location: London

    I'm trying to link two directories on a Raidsonic IB-NAS4220. I've got two 1tb drives installed as hda and hdb mounted at mnt/ide1 and mnt/ide2. hda is almost full so i'm trying to move data from one to the other but retain the directory structure.

    I've googled and read lots of guides on symbolic links (they're not that complicated) but can't seem to get it to work properly. I've got a feeling it might be a bug with the nas. I can create a link from a directory on hda to hdb that works fine, the problem is as i cp data from hda to hdb the storage limit on hda is exceeded. I'm trying to move 500gb from hda to hdb, hda has ~30gb free space, hdb is empty but it seems the link is passing back the size of the folder on hdb to hda and cp exits with an insufficient space message.

    Have I missed something here or is this default behaviour? :confused:
     
  2. aln

    Wise Guy

    Joined: 7 Sep 2009

    Posts: 2,076

    Location: West Lothian, Scotland.

    ls -l your link please.
     
  3. FirebarUK

    Soldato

    Joined: 9 Dec 2004

    Posts: 5,629

    Location: Dorset

    ^ what he said.

    You HAVE used symbolic links yes? not a hardlink?
     
  4. MTA99

    Mobster

    Joined: 18 Oct 2002

    Posts: 4,102

    Location: London

    I'm trying to link directories so I can't hardlink (or so i believe)

    Code:
    28013-AB> ls -l tv-shows
    total 4
    drwxrwxrwx 3 adz users 4096 Sep 16 14:22 8 out of 10 Cats
    28013-AB>
    
    That what you're looking for?
     
  5. aln

    Wise Guy

    Joined: 7 Sep 2009

    Posts: 2,076

    Location: West Lothian, Scotland.

    You're right, you can't hard link between hard drives. However your link doesn't seem to bet setup. Heres an example from a working link on my system.

    Code:
    lrwxrwxrwx   1 adegnan xcal-staff    1 2009-09-17 09:11 c -> b
    
    What you need to do is:

    Code:
    ln -s "place you're linking too" "place you want to put link"
    The first parameter should be the file which already exists, the second is the one you wish to create. I put the quotation marks as your directory has spaces in its name. I'm guessing you want this:

    Code:
    ln -s "8 out of 10 Cats" "~/Video/8 out of 10 cats"
    Or something similar, from the path you're linking from. Hope this helps.
     
  6. MTA99

    Mobster

    Joined: 18 Oct 2002

    Posts: 4,102

    Location: London

    I've got it working now

    Code:
    lrwxrwxrwx   1 adz         users          18 Sep 17 11:41 tv-shows -> /mnt/ide2/tvshows/
    
    I was trying to use create the link in a folder using paths rather than cd'ing in to the directory.

    Thanks for the help gents :)