{"id":813,"date":"2024-01-25T17:14:31","date_gmt":"2024-01-25T16:14:31","guid":{"rendered":"https:\/\/www.homeserver.lu\/?p=813"},"modified":"2024-01-25T17:14:31","modified_gmt":"2024-01-25T16:14:31","slug":"make-new-disk-usable-in-linux","status":"publish","type":"post","link":"https:\/\/www.homeserver.lu\/?p=813","title":{"rendered":"Make new disk usable in Linux"},"content":{"rendered":"\n<p>After installing a new hard drive, you have to follow a few steps to make it usable on your Linux system. Be sure not to erase an existing file system.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>(1) Identify the disk &#8220;<em>fdisk -l<\/em>&#8220;<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>fdisk -l<\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>(2) Partition the disk with <em>fdisk<\/em> or <em>cfdisk<\/em><\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>cfdisk \/dev\/sdX<\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>(3) Create the filesystem (format the disk) on each created partition. To create an ext4 filesystem on partition \/dev\/sdXY run:<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>mkfs.ext \/dev\/sdXY<\/code><\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>(4) Define the mount point for the newly created filesystem editing fstab:<\/li>\n<\/ul>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>nano \/etc\/fstab<\/code><\/pre><\/div>\n\n\n\n<p>Add the line for the newly created filesystem. I prefer to refer to it by UUID and not by device ID (these might change). Get the ID using this command &#8220;cd \/dev\/disk\/by-uuid&#8221; and &#8220;ls -l&#8221;.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>\/dev\/disk\/by-uuid\/3a9128c0-c9c2-47e7-b9f0-edc049ff4d3f \/data ext4 defaults 0 1<\/code><\/pre><\/div>\n\n\n\n<p>source: <a href=\"https:\/\/superuser.com\/questions\/872257\/how-to-make-a-new-disk-usable-on-ubuntu-linux\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/superuser.com\/questions\/872257\/how-to-make-a-new-disk-usable-on-ubuntu-linux<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>After installing a new hard drive, you have to follow a few steps to make it usable on your Linux system. Be sure not to erase an existing file system. Add the line for the newly created filesystem. I prefer to refer to it by UUID and not by device ID (these might change). Get [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-813","post","type-post","status-publish","format-standard","hentry","category-cli"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=813"}],"version-history":[{"count":7,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/813\/revisions"}],"predecessor-version":[{"id":820,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=\/wp\/v2\/posts\/813\/revisions\/820"}],"wp:attachment":[{"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.homeserver.lu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}