{"id":7785,"date":"2026-04-20T09:35:56","date_gmt":"2026-04-20T07:35:56","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=7785"},"modified":"2026-04-20T09:35:57","modified_gmt":"2026-04-20T07:35:57","slug":"arhitecturi-de-legatura-in-linux-legaturi-tari-vs-legaturi-moi","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/link-architectures-in-linux-hard-links-vs-soft-links\/","title":{"rendered":"Arhitectura leg\u0103turilor \u00een Linux: Hard Links vs. Soft Links"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">On a <strong>mybox<\/strong> server environment or any Linux-based system, links are essential tools for organizing data without duplicating files and wasting disk space. While both serve as &#8220;pointers,&#8221; they interact with the file system&#8217;s <strong>inode<\/strong> (the index record of a file) in fundamentally different ways.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Understanding these differences is key to maintaining a clean and functional directory structure.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/link-architectures-in-linux-hard-links-vs-soft-links\/#1_What_is_a_Hard_Link\" >1. What is a Hard Link?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/link-architectures-in-linux-hard-links-vs-soft-links\/#2_What_is_a_Soft_Link_Symbolic_Link\" >2. What is a Soft Link (Symbolic Link)?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/link-architectures-in-linux-hard-links-vs-soft-links\/#Direct_Comparison_Hard_vs_Soft\" >Direct Comparison: Hard vs. Soft<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/link-architectures-in-linux-hard-links-vs-soft-links\/#When_to_Use_Which_on_mybox\" >When to Use Which on mybox?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/link-architectures-in-linux-hard-links-vs-soft-links\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_What_is_a_Hard_Link\"><\/span><strong>1. What is a Hard Link?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-350188223\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">A hard link is a direct reference to the <strong>inode<\/strong> of a file. In Linux, a file&#8217;s name is actually just a label pointing to an inode; a hard link creates a second, identical label for that same data.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Identity:<\/strong> A hard link is indistinguishable from the original file. They share the same permissions, timestamps, and data blocks.<\/li>\n\n\n\n<li><strong>Deletion Logic:<\/strong> If you delete the &#8220;original&#8221; file, the data remains accessible through the hard link. The data is only truly deleted from the disk when the <em>last<\/em> hard link to it is removed.<\/li>\n\n\n\n<li><strong>Limitations:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Same Partition Only:<\/strong> You cannot create a hard link between different file systems or partitions (e.g., from <code>\/dev\/sda1<\/code> to <code>\/dev\/sdb1<\/code>).<\/li>\n\n\n\n<li><strong>No Directories:<\/strong> For security and to prevent infinite loops, you cannot create hard links to directories.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_What_is_a_Soft_Link_Symbolic_Link\"><\/span><strong>2. What is a Soft Link (Symbolic Link)?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A soft link (or symlink) is more like a &#8220;shortcut&#8221; in Windows. It is a special type of file that contains a text string pointing to the path of another file or directory.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Redirection:<\/strong> When you access a soft link, the system sees the path stored inside it and redirects you to the target.<\/li>\n\n\n\n<li><strong>The &#8220;Broken&#8221; Link:<\/strong> If the target file is moved or deleted, the soft link remains but becomes &#8220;dangling&#8221; or &#8220;broken,&#8221; as it points to a path that no longer exists.<\/li>\n\n\n\n<li><strong>Flexibility:<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Cross-Partition:<\/strong> You can create soft links that point to files on entirely different drives or network shares.<\/li>\n\n\n\n<li><strong>Directory Support:<\/strong> You can link to directories just as easily as files, which is why they are frequently used for organizing software libraries.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Direct_Comparison_Hard_vs_Soft\"><\/span><strong>Direct Comparison: Hard vs. Soft<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><td><strong>Feature<\/strong><\/td><td><strong>Hard Link<\/strong><\/td><td><strong>Soft (Symbolic) Link<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong>Inode<\/strong><\/td><td>Shares the same inode as the source.<\/td><td>Has its own unique inode.<\/td><\/tr><tr><td><strong>Cross-Partition<\/strong><\/td><td>No.<\/td><td><strong>Yes.<\/strong><\/td><\/tr><tr><td><strong>Link to Directory<\/strong><\/td><td>No.<\/td><td><strong>Yes.<\/strong><\/td><\/tr><tr><td><strong>If Source is Moved<\/strong><\/td><td>The link still works.<\/td><td>The link breaks.<\/td><\/tr><tr><td><strong>Disk Space<\/strong><\/td><td>Negligible (only a directory entry).<\/td><td>Negligible (stores the path string).<\/td><\/tr><tr><td><strong>Command<\/strong><\/td><td><code>ln [source] [link]<\/code><\/td><td><code>ln -s [source] [link]<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"When_to_Use_Which_on_mybox\"><\/span><strong>When to Use Which on mybox?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Use Hard Links when:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You need multiple access points to a file and want to ensure the data stays safe even if one &#8220;version&#8221; is accidentally deleted.<\/li>\n\n\n\n<li>You are performing incremental backups (hard links allow you to &#8220;copy&#8221; files between backup sets without using extra space).<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Use Soft Links when:<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You are creating shortcuts to deep directory structures.<\/li>\n\n\n\n<li>You need to link files across different disk partitions.<\/li>\n\n\n\n<li>You are managing software versions (e.g., pointing <code>python<\/code> to <code>python3.12<\/code>).<\/li>\n\n\n\n<li>You need to link a directory from one location to another (common in web server configurations).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span><strong>Summary<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Think of a <strong>Hard Link<\/strong> as an additional &#8220;front door&#8221; to the same house\u2014as long as one door exists, you can get inside. Think of a <strong>Soft Link<\/strong> as a &#8220;signpost&#8221; pointing to the house\u2014if the house is moved, the signpost just points to an empty lot.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[28],"manual_kb_tag":[4600,4608,6197,9281,9282,9283,9284,9285,9286,9287],"class_list":["post-7785","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-others","manual_kb_tag-symbolic-link","manual_kb_tag-hard-link","manual_kb_tag-file-system","manual_kb_tag-hard-links","manual_kb_tag-soft-link","manual_kb_tag-soft-links","manual_kb_tag-symbolic-links","manual_kb_tag-linux-file-system","manual_kb_tag-inode","manual_kb_tag-directory-structure"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/7785","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/7785\/revisions"}],"predecessor-version":[{"id":7786,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/7785\/revisions\/7786"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=7785"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=7785"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=7785"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}