Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hai,

  • How can i create hard link for my directories ?
  • When i use to make link from /var to /home it shows error on "Invalid cross-device link", How can i over come it ?
share|improve this question
1  
Links aren't backups; they're just pointers to the original file. –  Dennis Williamson Jan 20 '10 at 5:57
    
See my edited answer. –  Dennis Williamson Jan 20 '10 at 6:03
add comment

2 Answers

up vote 3 down vote accepted

You can only make symbolic links to directories.

From man 7 symlink:

       Hard links may not refer to directories (to pre‐
       vent the possibility of loops within the file system tree, which  would
       confuse  many  programs)  and  may not refer to files on different file
       systems (because i-node numbers are not unique across file systems).

To make backups, use rsync, dd or cpio (sometimes together with tar, bzip2, gzip or zip).

share|improve this answer
add comment

By using the

ln

command.

Read this for more info.

share|improve this answer
    
whoops. see above... –  LukeR Jan 20 '10 at 5:46
    
"Operation not permitted" i got this error when using "ln -d ". Is there any other way to overcome this ? –  Kumar Jan 20 '10 at 5:58
    
@Kumar: From man ln: "(note: will probably fail due to system restrictions, even for the superuser)" –  Dennis Williamson Jan 20 '10 at 6:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.