{"id":52,"date":"2023-07-11T21:33:47","date_gmt":"2023-07-11T21:33:47","guid":{"rendered":"http:\/\/thejonas.net\/?page_id=52"},"modified":"2023-07-11T21:34:15","modified_gmt":"2023-07-11T21:34:15","slug":"fstab-linux","status":"publish","type":"page","link":"https:\/\/www.thejonas.net\/?page_id=52","title":{"rendered":"FSTAB Linux"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Mount Network Share using fstab<\/h1>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Mount a network share to a folder on a Linux Server using cli.<\/strong><br><em>I\u2019ve tested this on both Ubuntu or CentOS Operating Systems and the setup is basically the same.<\/em><\/li>\n\n\n\n<li><strong>First, install the required applications.<\/strong> Ubuntu<br>sudo apt-get install samba-client samba-common cifs-utils<br>CentOS<br>sudo yum install samba-client samba-common cifs-utils <strong>It helps if some files are residing on the network share to verify this worked (even if it is just a simple test file).<\/strong><br><strong>On the Linux Server Navigate and make a folder. For example, call it data.<\/strong><br>cd \/usr<br>mkdir data <strong>Next, create another folder and password file as root to protect who sees it:<\/strong><br><strong>Let\u2019s make a folder as root called info, then cd into info:<\/strong><br>cd \/usr<br>mkdir info<br>cd info<br><strong>Let\u2019s make a hidden file called .smb while in the info folder.<\/strong><br>Using . in front of smb file makes the file hidden-if needed use the command **ls -a** to view hidden files.<br><strong>Using text editor nano make the file as seen below, adding username and password in the following format<\/strong>.<br><strong>nano .smb<\/strong><br>username=user<br>password=passwd<br>domain=If Needed<\/li>\n\n\n\n<li><strong>To save and exit in Nano, from your keyboard press control+o to write the file, then control+x to exit.<\/strong><br><strong>Next, edit the fstab file<\/strong><br>nano \/etc\/fstab<br><strong>Place the following at the bottom of this file and adjust accordingly. Then save and exit.<\/strong><br>\/\/server IP\/path\/to\/share \/usr\/data cifs credentials=\/usr\/info\/.smb 0 0 <strong>Test by running the command **mount -a** to verify the share mounted. Then reboot the server.<\/strong><br><strong>If everything worked correctly, navigate to the \/usr\/data folder on Linux Server, and verify your network share is still mounted.<\/strong><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Mount Network Share using fstab<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":40,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-52","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.thejonas.net\/index.php?rest_route=\/wp\/v2\/pages\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thejonas.net\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.thejonas.net\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.thejonas.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thejonas.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=52"}],"version-history":[{"count":1,"href":"https:\/\/www.thejonas.net\/index.php?rest_route=\/wp\/v2\/pages\/52\/revisions"}],"predecessor-version":[{"id":54,"href":"https:\/\/www.thejonas.net\/index.php?rest_route=\/wp\/v2\/pages\/52\/revisions\/54"}],"up":[{"embeddable":true,"href":"https:\/\/www.thejonas.net\/index.php?rest_route=\/wp\/v2\/pages\/40"}],"wp:attachment":[{"href":"https:\/\/www.thejonas.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}