{"id":210,"date":"2013-12-08T15:06:43","date_gmt":"2013-12-08T19:06:43","guid":{"rendered":"http:\/\/www.mufljuz.com\/?p=210"},"modified":"2015-06-03T13:01:06","modified_gmt":"2015-06-03T17:01:06","slug":"large-hd-reminder","status":"publish","type":"post","link":"https:\/\/www.mufljuz.com\/?p=210","title":{"rendered":"Large HD reminder"},"content":{"rendered":"<p>Prepare hard drive with parted. It is recommended to ask parted to use optimal partition alignment:<\/p>\n<p><code>parted -a optimal \/dev\/sdX<\/code><\/p>\n<pre>\r\n(parted) help\r\n(parted) print\r\n(parted) mklabel gpt\r\n(parted) mkpart primary ext4 0% 100%\r\n(parted) name 1 storage_01\r\n(parted) print\r\n(parted) quit\r\n<\/pre>\n<p>create filesystem<br \/>\n<code>mkfs.ext4 \/dev\/sdX1<\/code><\/p>\n<p>To remove hot-plugged SATA disk, first unmount then suspend disk<br \/>\n<code><br \/>\n umount \/dev\/sdXn<br \/>\n hdparm -y \/dev\/sdX<br \/>\n hdparm -Y \/dev\/sdX<br \/>\n<\/code><\/p>\n<h2>Repair ext4 partition<\/h2>\n<p><code>fsck.ext4 -cDft -C 0 \/dev\/sd**<\/code><\/p>\n<p>-c \u2013 check for bad sectors<br \/>\n-D \u2013 optimize directories if possible<br \/>\n-f \u2013 force check, even if filesystem seems clean<br \/>\n-t \u2013 print timing stats (use -tt for more)<br \/>\n-y \u2013 assume answer \u201cyes\u201d to all questions (such as, \u201cdo you want to continue\u201d)<br \/>\n-C 0 \u2013 print progress info to stdout<\/p>\n<h2>Hard drive tests<\/h2>\n<p><strong>A simple write test that writes zeroes to the entire disk<\/strong><br \/>\n<code>dd if=\/dev\/zero of=\/dev\/sdX<\/code><\/p>\n<p>3 TB drive results<\/p>\n<pre>\r\ndd: writing to \u2018\/dev\/sdc\u2019: No space left on device\r\n5860533169+0 records in\r\n5860533168+0 records out\r\n3000592982016 bytes (3.0 TB) copied, 58234.7 s, 51.5 MB\/s\r\n<\/pre>\n<p><strong>hdparm test<\/strong><br \/>\n<code><br \/>\nhdparm -Tt \/dev\/sdX<\/p>\n<p>\/dev\/sdX:<\/p>\n<pre>\r\n\/dev\/sdc:\r\n Timing cached reads:   25128 MB in  2.00 seconds = 12580.01 MB\/sec                                                                                                                                      \r\n Timing buffered disk reads: 560 MB in  3.00 seconds = 186.56 MB\/sec \r\n<\/pre>\n<p><\/code><\/p>\n<p><strong>A few passes with badblocks should provide a good test of your new hard drive.<\/strong><br \/>\n<code><br \/>\nemerge -uav e2fsprogs<br \/>\nbadblocks -nsv \/dev\/sdX<br \/>\n<\/code><br \/>\nNever  use  the -w option on a device containing an existing file system.  This option erases data!  If you want to do write-mode testing on an existing file system, use the -n option instead.  It is slower, but it will preserve your data.<\/p>\n<p><strong>stress testing new hard drive with stress linux<\/strong><br \/>\n<code><br \/>\nemerge -av stress bonnie++<br \/>\nstress --help<br \/>\nstress --cpu 3 --io 1 --vm 1 --vm-bytes 128M --hdd 1 --hdd-bytes 1024K --timeout 10s<br \/>\nbonnie++<br \/>\n<\/code><\/p>\n<p>specific stress test of a mounted ssd disk<br \/>\n<code><br \/>\nbonnie++ -d \/path\/to\/mounted\/ssd -r your-system-ram-size-in-MB<br \/>\n# for 16GB RAM<br \/>\nbonnie++ -d \/mnt\/mounted-ssd-001 -r 16000<br \/>\n<\/code><\/p>\n<p><strong>testing new hard drive with smartmontools<\/strong><br \/>\n<code><br \/>\nemerge -av smartmontools<\/p>\n<p>(turn on monitoring)<br \/>\nsmartctl -s on \/dev\/sdX<br \/>\n=== START OF ENABLE\/DISABLE COMMANDS SECTION ===<br \/>\nSMART Enabled.<\/p>\n<p>(view all information)<br \/>\n# smartctl --all<\/p>\n<p>(perform long test)<br \/>\n# smartctl --test=long \/dev\/sdX<\/p>\n<p>(check log after the test)<br \/>\n# smartctl --log=error \/dev\/sdX<br \/>\n<\/code><\/p>\n<p>start smartmon daemon and to start it at boot time, add it your runlevel:<br \/>\n<code><br \/>\n\/etc\/init.d\/smartd start<\/p>\n<p>rc-update add smartd default<br \/>\n<\/code><\/p>\n<p>To ensure the changes are synced to the USB disk before removing it:<\/p>\n<pre>\r\nsync\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Prepare hard drive with parted. It is recommended to ask parted to use optimal partition alignment: parted -a optimal \/dev\/sdX (parted) help (parted) print (parted) mklabel gpt (parted) mkpart primary ext4 0% 100% (parted) name 1 storage_01 (parted) print (parted) quit create filesystem mkfs.ext4 \/dev\/sdX1 To remove hot-plugged SATA disk, first unmount then suspend disk [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/210"}],"collection":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=210"}],"version-history":[{"count":16,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions"}],"predecessor-version":[{"id":343,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=\/wp\/v2\/posts\/210\/revisions\/343"}],"wp:attachment":[{"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mufljuz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}