{"id":65,"date":"2017-07-02T16:04:04","date_gmt":"2017-07-02T14:04:04","guid":{"rendered":"http:\/\/www.hansbaas.com\/?p=65"},"modified":"2021-08-14T15:38:56","modified_gmt":"2021-08-14T15:38:56","slug":"using-symlinks-to-keep-your-data-separate-in-linux","status":"publish","type":"post","link":"https:\/\/www.hansbaas.com\/?p=65","title":{"rendered":"Using symlinks to keep your data separate in linux"},"content":{"rendered":"\n<p>I&#8217;ve always preferred not to have my data files on the same partition as my system files and often I have used a separate \/home partition for this. This has a huge downside though. As your home folder is also used by the system to hold non global setting files, you risk making a mess of settings when you have different system installations sharing the same \/home partition.<\/p>\n\n\n\n<p>The solution I found best is to have symbolic links in the \/home folder (that resides in the system root; no separate \/home partition).<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I create a partition for my data files, where I create Documents, Downloads, Music, Pictures and Videos (I try and avoid putting files in Desktop, but you could link that in a similar way). You can also use other folders you created in the home folder of course; I also use folders Apps, Audio and Calibre Library, for instance.<\/p>\n\n\n\n<p>Now I need to add this data partition to fstab to make sure the files are always available at startup. Let&#8217;s assume the data partition is on \/dev\/sdc1 and that we created mount point \/media\/DATA. We can find out the UUID in terminal by typing:<\/p>\n\n\n\n<p><code>~ $ blkid \/dev\/sdc1<\/code><\/p>\n\n\n\n<p>Then we&#8217;ll need to add a line to \/etc\/fstab:<\/p>\n\n\n\n<p><code>UUID=whatever-came-out-on-blkid  \/media\/DATA      auto    defaults,errors=remount-ro 0       1<\/code><\/p>\n\n\n\n<p>Now rename the folders you want out of the system \/home folder:<\/p>\n\n\n\n<p><code>~ $ mv Documents Documents.old<\/code><\/p>\n\n\n\n<p>And link Documents to the Documents folder in your data partition:<\/p>\n\n\n\n<p><code>~ $ ln -s \/media\/DATA\/Documents .\/Documents<\/code><\/p>\n\n\n\n<p>Et cetera! Now you&#8217;ll have your data files in a separate partition (easier back-ups and easier to re-install your system without touching your data) and if you follow this symlink setup for all your installed systems, the data will be available in all of them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve always preferred not to have my data files on the same partition as my system files and often I have used a separate \/home partition for this. This has a huge downside though. As your home folder is also used by the system to hold non global setting files, you risk making a mess [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[41,24,31,40],"class_list":["post-65","post","type-post","status-publish","format-standard","hentry","category-nerd","tag-data","tag-linux","tag-system","tag-user"],"_links":{"self":[{"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=\/wp\/v2\/posts\/65","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=65"}],"version-history":[{"count":2,"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=\/wp\/v2\/posts\/65\/revisions\/197"}],"wp:attachment":[{"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hansbaas.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}