{"id":79,"date":"2012-07-25T18:46:25","date_gmt":"2012-07-25T18:46:25","guid":{"rendered":"http:\/\/www.buildingcubes.com\/?p=79"},"modified":"2023-10-20T18:39:05","modified_gmt":"2023-10-20T18:39:05","slug":"installing-my-3tb-hard-drive-on-debian-linux-step-by-step","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2012\/07\/25\/installing-my-3tb-hard-drive-on-debian-linux-step-by-step\/","title":{"rendered":"Installing my 3TB hard drive on Debian linux step by step"},"content":{"rendered":"\n<p>It is simple, here is what you need to know<\/p>\n\n\n\n<p>You can format it EXT4, but ext2 and ext3 are also OK ! ext2 and ext3 allow up to 16TB disks, and file sizes of up to 2TB, ext4 allows much more.<\/p>\n\n\n\n<p>Any linux kernel newer than 2.6.31 should work just fine with &#8220;Advanced format&#8221; drives using the exact same steps in this article.<\/p>\n\n\n\n<p>MBR only supports 2TB drives, you need GPT, so let us get started<\/p>\n\n\n\n<p>1- apt-get update<br>2- apt get install parted<br>3- parted \/dev\/sdc<br>4- mklabel gpt<br>5- Answer yes to: Warning: The existing disk label on \/dev\/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?<br>Yes\/No? yes<br>6- mkpart primary ext4 0% 100% (to make a partition as big as the disk (will occupy starting from first megabyte (for alignment) to the end of disk))<br>7- quit<\/p>\n\n\n\n<p>FYI, if you want multiple partitions, here are the 2 lines that should replace step 6<br>6- mkpart primary ext4 0% 40%<br>6- mkpart primary ext4 40% 100%<\/p>\n\n\n\n<p>and remember to format both (sdc1 and sdc2) when you are done with parted<\/p>\n\n\n\n<p>Now to formatting the drive<\/p>\n\n\n\n<p>mkfs.ext4 \/dev\/sdc1<\/p>\n\n\n\n<p>Before mounting it, i like ext4, but i don&#8217;t want a journaling OS on this drive that is not the system drive, so i will need do a few things to the drive first<\/p>\n\n\n\n<p>Lazy writeback<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tune2fs -o journal_data_writeback \/dev\/sdc1<br><\/pre>\n\n\n\n<p>No Journaling<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">tune2fs -O ^has_journal \/dev\/sdc1<\/pre>\n\n\n\n<p>Now to check what we have<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dumpe2fs \/dev\/sdc1 |grep 'Filesystem features'<\/pre>\n\n\n\n<p><br>Or maybe if you want the whole thing on the screen<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dumpe2fs \/dev\/sdc1 |more<\/pre>\n\n\n\n<p>if has_journal option exist when executing the first &#8211; you have journal on the file system<\/p>\n\n\n\n<p>And there we are, Now we need to mount it at boot time by adding it to fstab, to do that, we will need the disk&#8217;s unique ID !<\/p>\n\n\n\n<p>8- Now executing the following command will give you the unique ID of this new partition for use with fstab (The disk list we will edit below in step 10)<br>blkid \/dev\/sdc1<br>9- create the directory where you want to mount your hard disk, for example<br>mkdir \/hds<br>mkdir \/hds\/3tb<br>10- Now, we add the following line to fstab, notice that noatime increases performance, but some applications might need or rely on it. postfix does not and i have verified that.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">UUID=b7a491b1-a690-468f-882f-fbb4ac0a3b53       \/hds\/3tb            ext4     defaults,noatime                0       1<\/pre>\n\n\n\n<p>defaults and noatime are but only a couple of options, here are more options that you can add<br>nofail = If the disk is not present, continue booting<br>nobootwait = Limit the amount of time you plan to wait<br>noauto = Don&#8217;t mount it until I issue a &#8220;mount \/dev\/sdb1&#8221;, or mount &#8220;\/hds\/thisdisk&#8221; command<\/p>\n\n\n\n<p>11- Now execute<br>mount -a<\/p>\n\n\n\n<p>You are done,. if you execute<br>df -h<br>You should see your 2+TB hard drive in there !<\/p>\n\n\n\n<p>To make sure the drive is aligned correctly, i like to write a file on it and see how fast that goes&#8230; so let us use a 2GB file<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dd if=\/dev\/zero of=\/hds\/WD2000_3\/deleteme.img bs=1M count=2000<\/pre>\n\n\n\n<p>Outcome came out (for a western digital black 2TB)<br>First run: 2097152000 bytes (2.1 GB) copied, 5.94739 s, 353 MB\/s<br>Consecutive runs: 2097152000 bytes (2.1 GB) copied, 11.1405 s, 188 MB\/s<br>Outcome came out for a western digital green 3TB<br>First run: 2097152000 bytes (2.1 GB) copied, 8.32337 s, 252 MB\/s<br>Consecutive runs: 2097152000 bytes (2.1 GB) copied, 14.376 s, 146 MB\/s<\/p>\n\n\n\n<p>the consecutive runs give close results, what i printed here is the average<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is simple, here is what you need to know You can format it EXT4, but ext2 and ext3 are also OK ! ext2 and ext3 allow up to 16TB disks, and file sizes of up to 2TB, ext4 allows much more. Any linux kernel newer than 2.6.31 should work just fine with &#8220;Advanced format&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,4,9,1],"tags":[47,56,58,66,70,72],"class_list":["post-79","post","type-post","status-publish","format-standard","hentry","category-hard-disks","category-linux","category-pc-hardware","category-uncategorized","tag-disk","tag-format","tag-fstab","tag-mount","tag-partd","tag-partition"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/79","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=79"}],"version-history":[{"count":4,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/79\/revisions"}],"predecessor-version":[{"id":2906,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/79\/revisions\/2906"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=79"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=79"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=79"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}