{"id":2322,"date":"2016-07-06T06:50:45","date_gmt":"2016-07-05T18:50:45","guid":{"rendered":"http:\/\/www.zoyinc.com\/?p=2322"},"modified":"2016-07-23T07:17:08","modified_gmt":"2016-07-22T19:17:08","slug":"access-contents-on-a-single-disk-from-a-debian-mirror-array","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=2322","title":{"rendered":"Access contents on a single disk from a Debian mirror array"},"content":{"rendered":"<p>I am setting up an Open Media Vault, OMV, NAS box for my home storage requirements, detailed in the post <a  href=\"http:\/\/www.zoyinc.com\/?p=2381\">Installing Open Media Vault<\/a>. I don&#8217;t have the resources to setup a full RAID 5 array, this would require a box with space for 3 drives plus which I would actually need to purchase 3 drives.<\/p>\n<p>So I am going with an older box with two 3GB drives in RAID 1 (mirrored). The idea is that if the box fails or I lose a drive the remaining drive can still be read. Not perfect for performance but I am going to use 7200 Barracuda Seagate drives, so hopefully that will help.<\/p>\n<p>This article is about taking a drive from one from this RAID 1 and reading it on another box &#8211; worst case scenario.<\/p>\n<p>Given that Open Media Vault run Debian the approach taken is to run a live USB version of Debian and mount the drive.<\/p>\n<table class=\"zsteps\" style=\"height: 0px;\">\n<tbody>\n<tr style=\"height: 60px;\">\n<td style=\"height: 60px; width: 21px;\">1.<\/td>\n<td style=\"height: 60px; width: 592px;\">Create a Debian Live USB flash drive as described in article <a  href=\"http:\/\/www.zoyinc.com\/?p=2353\">Create a Debian Live USB flash drive<\/a><\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">2.<\/td>\n<td style=\"height: 18px; width: 592px;\">If you want to connect to this Debian Live instance using SSH follow the instructions int he post <a  href=\"http:\/\/www.zoyinc.com\/?p=2510\">Enabling SSH access to Debian live USB<\/a><\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">3.<\/td>\n<td style=\"height: 18px; width: 592px;\">Should you get timed out the password for the user \u201cuser\u201d is \u201clive\u201d.<\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">4.<\/td>\n<td style=\"height: 18px; width: 592px;\">At this point ensure the terminal window is not too small because the first screen you get will only:<\/p>\n<figure id=\"attachment_2424\" aria-describedby=\"caption-attachment-2424\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup01.gif\" class=\"thickbox no_icon\" title=\"mdadm configure screen\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2424 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup01-300x190.gif\" alt=\"mdadm configure screen\" width=\"300\" height=\"190\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup01-300x190.gif 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup01-150x95.gif 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup01-474x300.gif 474w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2424\" class=\"wp-caption-text\">+ Click to enlarge<\/figcaption><\/figure>\n<p>If this happens to you just kill your terminal session, make the window bigger and try again. This time you should see:<\/p>\n<p><figure id=\"attachment_2425\" aria-describedby=\"caption-attachment-2425\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup02.gif\" class=\"thickbox no_icon\" title=\"mdadm configure screen 2\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2425 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup02-300x164.gif\" alt=\"mdadm configure screen 2\" width=\"300\" height=\"164\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup02-300x164.gif 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup02-150x82.gif 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup02-768x421.gif 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVBackup02-500x274.gif 500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2425\" class=\"wp-caption-text\">+ Click to enlarge<\/figcaption><\/figure><\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">5.<\/td>\n<td style=\"height: 18px; width: 592px;\">Now install mdadm:<\/p>\n<pre class=\"crayon:false;\">apt-get install mdadm rsync initramfs-tools<\/pre>\n<p>You will be asked If &#8220;the system&#8217;s root file system is located on an MD array (RAID\u2026&#8221;<\/p>\n<p>Ensure you enter \u201c<strong>none<\/strong>\u201d as your answer.<\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">6.<\/td>\n<td style=\"height: 18px; width: 592px;\">Now we want to see the drives that are available so run:<\/p>\n<pre class=\"crayon:false; \">lsblk<\/pre>\n<p>This should produce something like:<\/p>\n<pre class=\"crayon:false; \">NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT\r\nsda 8:0 0 74.5G 0 disk\r\n\u2514\u2500md127 9:127 0 74.5G 0 raid1\r\nsdb 8:16 1 7.5G 0 disk\r\n\u2514\u2500sdb1 8:17 1 1.2G 0 part \/lib\/live\/mount\/medium\r\nloop0 7:0 0 1.1G 1 loop \/lib\/live\/mount\/rootfs\/filesystem.squashfs<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">7<\/td>\n<td style=\"height: 18px; width: 592px;\">You can see from above that our remaining Mirror array disk is \u201csda\u201d.<\/p>\n<p>Create a temp directory to mount it in:<\/p>\n<pre class=\"crayon:false;\">mkdir \/mirror<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">8.<\/td>\n<td style=\"height: 18px; width: 592px;\">Now mount it using something like:<\/p>\n<pre class=\"crayon:false;\">mount \/dev\/md127 \/mirror<\/pre>\n<\/td>\n<\/tr>\n<tr style=\"height: 18px;\">\n<td style=\"height: 18px; width: 21px;\">9.<\/td>\n<td style=\"height: 18px; width: 592px;\">Because we enabled ssh login using root you can now sftp using WinSCP as root to move your files back to your laptop or PC.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>A useful command is:<\/p>\n<pre class=\"crayon:false;\">mdadm --examine \/dev\/sd*<\/pre>\n<p>Which will give something like:<\/p>\n<pre class=\"crayon:false;\">\/dev\/sda:\r\nMagic : a92b4efc\r\nVersion : 1.2\r\nFeature Map : 0x0\r\nArray UUID : 99576b9e:6ffe87e8:fc43bf24:9c6b84ab\r\nName : nas2:Mirror1\r\nCreation Time : Sat Jun 4 05:42:20 2016\r\nRaid Level : raid1\r\nRaid Devices : 2\r\n\r\nAvail Dev Size : 156181504 (74.47 GiB 79.96 GB)\r\nArray Size : 78085120 (74.47 GiB 79.96 GB)\r\nUsed Dev Size : 156170240 (74.47 GiB 79.96 GB)\r\nData Offset : 131072 sectors\r\nSuper Offset : 8 sectors\r\nUnused Space : before=130992 sectors, after=11264 sectors\r\nState : clean\r\nDevice UUID : 55c45427:8ba028de:ef53f68a:2cd44a10\r\n\r\nUpdate Time : Wed Jun 22 21:26:19 2016\r\nChecksum : 38926569 - correct\r\nEvents : 122029\r\nDevice Role : Active device 1\r\nArray State : .A ('A' == active, '.' == missing, 'R' == replacing)\r\n\/dev\/sdb:\r\nMBR Magic : aa55\r\nPartition[0] : 2573440 sectors at 64 (type 17)\r\nmdadm: No md superblock detected on \/dev\/sdb1.<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am setting up an Open Media Vault, OMV, NAS box for my home storage requirements, detailed in the post Installing Open Media Vault. I don&#8217;t have the resources to setup a full RAID 5 array, this would require a box with space for 3 drives plus which I would actually need to purchase 3 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2532,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[312,4,313],"tags":[331,319,320,326,332],"class_list":["post-2322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","category-linux","category-open-media-vault","tag-mirror","tag-omv","tag-open-media-vault","tag-raid","tag-raid1"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2322"}],"version-history":[{"count":21,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2322\/revisions"}],"predecessor-version":[{"id":2427,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2322\/revisions\/2427"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/2532"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2322"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}