{"id":2381,"date":"2016-07-05T21:14:57","date_gmt":"2016-07-05T09:14:57","guid":{"rendered":"http:\/\/www.zoyinc.com\/?p=2381"},"modified":"2016-07-07T21:58:06","modified_gmt":"2016-07-07T09:58:06","slug":"installing-open-media-vault","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=2381","title":{"rendered":"Installing Open Media Vault"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2409\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVHeader01.jpg\" alt=\"OMV Header 1\" width=\"600\" height=\"85\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVHeader01.jpg 600w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVHeader01-150x21.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVHeader01-300x43.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVHeader01-500x71.jpg 500w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>OMV doesn&#8217;t have a backup function which is a problem. Given it is relatively straight forward to setup OMV one option is to simply set it up again. I really don&#8217;t want to do that so the only other comprehensive option is to backup the system disk.<\/p>\n<p>The problem is that there isn&#8217;t any free, easy, way to backup a Linux system. Yes there is Clonezilla, Rsync and &#8220;dd&#8221; but they aren&#8217;t the simple UI solutions you have with Windows. In fact using dd is actually the simplest and easiest but to ensure you catch everything you really need to backup the full disk and with modern disks running at least 120GB that is a lot of backup space.<\/p>\n<p>In addition the OMV setup does not allow you to setup the partitioning of the system disk &#8211; this is done by the install and it uses the full capacity of the disk, apparently regardless of the disk size.<\/p>\n<p>The solution I have arrived at is to basically do an initial install onto a small disk and then clone that to a larger disk.<\/p>\n<p>This is not a tutorial on using VMware so if there is something you don&#8217;t know then Google is your friend. I have done this on an ESXi server but it should work just the same on VMware player.<\/p>\n<h2>The short version<\/h2>\n<p>In summary this is what I do:<\/p>\n<ol>\n<li>Create a virtual machine on VMware, or any other hypervisor, with a 7GB drive<\/li>\n<li>Install OMV onto this with little or no customization<\/li>\n<li>Image this VM disk using Debian Live, &#8220;dd&#8221; and gzip to a network share<\/li>\n<li>From the physical OMV server boot with Debian Live.<\/li>\n<li>Use dd to restore the backed up image from the network share to the physical disk<\/li>\n<\/ol>\n<p>After the above has been done you will finish with a disk that is mostly empty and partitions with OMV occupying 7GB of space.<\/p>\n<p>From this point on you can backup using dd from the physical disk and you will only be backing up 7GB. Whilst not as small as other options I believe it is manageable given you don&#8217;t really need to do this very often and compressed it should drop down quite a bit. If you are really worried about space you can also zero the unused bytes which will make the backup nice and small.<\/p>\n<h2>Before you start<\/h2>\n<p>You need to ensure the VM is on the network as it will need to connect to the internet to download at least one package.<\/p>\n<p>You need to download the ISO for Open Media Vault <a  href=\"http:\/\/www.openmediavault.org\/\">http:\/\/www.openmediavault.org\/<\/a> in my case was &#8220;openmediavault_2.1_amd64.iso&#8221;.<\/p>\n<p>You also need to download the ISO for Debian Live\u00a0<a  href=\"https:\/\/www.debian.org\/CD\/live\/\">https:\/\/www.debian.org\/CD\/live\/<\/a> in my case &#8220;debian-live-8.5.0-i386-cinnamon-desktop.iso&#8221;<\/p>\n<h2>Create the VMware Virtual Machine<\/h2>\n<p>Create a virtual machine, I selected &#8220;Virtual Machine Version 11&#8221;, but any recent version is probably fine. Ensure you set the memory to be approximately the same as the physical machine.<\/p>\n<p>With regards to the hard drive, during the creating of a new VM it doesn&#8217;t allow you to create a drive using IDE. So when creating the initial VM don&#8217;t include a hard disk. After the VM has been created add a hard disk and keep it as small as possible. At the time of writing the minimum disk size was 2GB and my experience was that it created a swap partition of the same size as the RAM.<\/p>\n<p>In my case I was using 4GB of RAM so I created a disk of 7GB so there was a bit of extra wiggle room. We really need the disk to be zeroed so select &#8220;Thick Provision Eager Zeroed&#8221;:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2382 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD01-300x197.gif\" alt=\"Create HDD Provisioning\" width=\"300\" height=\"197\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD01-300x197.gif 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD01-150x99.gif 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Be sure to select &#8220;IDE&#8221; as the disk type. This option may look a little like it is greyed out but it can be selected.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2383 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD02-300x146.gif\" alt=\"Create HDD IDE\" width=\"300\" height=\"146\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD02-300x146.gif 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD02-150x73.gif 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Once the HDD has been added go back and change the CD\/DVD settings and change it so that it is connected at power on and is set to use the Open Media Vault ISO. Also you may need to go to the &#8220;Options | Advanced | Boot Options&#8221; and set &#8220;Force BIOS Setup &#8211; this will mean when you start the VM the next time it will take you to the BIOS where you can set the boot order so it boots the DVD first:<\/p>\n<figure id=\"attachment_2385\" aria-describedby=\"caption-attachment-2385\" style=\"width: 892px\" class=\"wp-caption aligncenter\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD03.gif\" class=\"thickbox no_icon\" title=\"VM Settings\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2385\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVCreateHDD03.gif\" alt=\"VM Settings\" width=\"892\" height=\"300\" \/><\/a><figcaption id=\"caption-attachment-2385\" class=\"wp-caption-text\">+ Click to enlarge<\/figcaption><\/figure>\n<h2>Install Open Media Vault<\/h2>\n<p>Start the VM booting into the ISO image you downloaded and select &#8220;Install&#8221;:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2389 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall01-300x275.jpg\" alt=\"OMV Install Initial Screen\" width=\"300\" height=\"275\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall01-300x275.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall01-150x137.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall01-327x300.jpg 327w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall01.jpg 644w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>I am not going to go through each screen, there are plenty of sites that do that. however I will detail the ones to watch for.<\/p>\n<p style=\"text-align: left;\">On the &#8220;Configure the network&#8221; screen put in the name you wish to give your OMV server:<\/p>\n<figure id=\"attachment_2391\" aria-describedby=\"caption-attachment-2391\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall02.gif\" class=\"thickbox no_icon\" title=\"OMV Network setting\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2391 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall02-300x102.gif\" alt=\"OMV Network setting\" width=\"300\" height=\"102\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall02-300x102.gif 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall02-150x51.gif 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall02-500x170.gif 500w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2391\" class=\"wp-caption-text\">+ Click to enlarge<\/figcaption><\/figure>\n<p style=\"text-align: left;\">On the next screen it asks for the domain, you may not use one and it is not mission critical. If you are in doubt look at the other machines on your network and replicate the domain name.<\/p>\n<p>Both the hostname and domain name can be changed later on quite easily.<\/p>\n<p>Next important screen is &#8220;Setup users and passwords&#8221;. You will be asked for the root password, this is important, so don&#8217;t forget it. But it can obviously be changed later very easily.<\/p>\n<p>Keep accepting defaults and sensible answers as you move through the final screen &#8220;Finish the installation&#8221;.<\/p>\n<p>Before you restart go into the VMware settings and disconnect the DVD drive.<\/p>\n<p>After the reboot login to the VM as the user &#8220;root&#8221; with the root password you gave earlier.<\/p>\n<p>Once in run &#8220;ifconfig&#8221; which will show you the IP of the OMV:<\/p>\n<figure id=\"attachment_2395\" aria-describedby=\"caption-attachment-2395\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall03.gif\" class=\"thickbox no_icon\" title=\"OMV ipconfig\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2395 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall03-300x211.gif\" alt=\"OMV ipconfig\" width=\"300\" height=\"211\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall03-300x211.gif 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall03-150x106.gif 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall03-426x300.gif 426w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2395\" class=\"wp-caption-text\">+ Click to enlarge<\/figcaption><\/figure>\n<p>From your desktop open a browser to the IP listed and login. The username is &#8220;admin&#8221; and the default password is &#8220;openmediavault&#8221;. Just have a little look around to make sure it is basically ok and shut it down:<\/p>\n<figure id=\"attachment_2397\" aria-describedby=\"caption-attachment-2397\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall05.jpg\" class=\"thickbox no_icon\" title=\"OMVInstall05\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-2397 size-medium\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall05-300x131.jpg\" alt=\"OMVInstall05\" width=\"300\" height=\"131\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall05-300x131.jpg 300w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall05-150x65.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall05-768x334.jpg 768w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall05-500x218.jpg 500w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2016\/07\/OMVInstall05.jpg 774w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-2397\" class=\"wp-caption-text\">+ Click to enlarge<\/figcaption><\/figure>\n<p>Once you VM is shutdown change the DVD settings in VMware so it now boots from the Debian Live ISO and restart the VM.<\/p>\n<p>Once you are in the Debian live system start up a terminal and &#8220;sudo su &#8211; root&#8221; so you are doing things as root.<\/p>\n<p>Before you start install &#8220;dcfldd&#8221;. This is an enhanced version of &#8220;dd&#8221; which includes a vital status message so you can see how far your backup is progressing.<\/p>\n<pre class=\"crayon:false;\">apt-get install dcfldd<\/pre>\n<p>Now create a mount point and map it to a shared drive on your network:<\/p>\n<pre class=\"crayon:false;\">mkdir \/nas1\r\nmount -t cifs -o username=joe,password=joesPassword \/\/192.168.202.44\/sata1 \/nas1\r\ncd \/nas1<\/pre>\n<p>Run &#8220;lsblk&#8221; to see what drives you have:<\/p>\n<pre class=\"crayon:false;\">root@debian:\/nas1# lsblk\r\nNAME\u00a0\u00a0 MAJ:MIN RM\u00a0 SIZE RO TYPE MOUNTPOINT\r\nfd0\u00a0\u00a0\u00a0\u00a0\u00a0 2:0\u00a0\u00a0\u00a0 1\u00a0\u00a0\u00a0 4K\u00a0 0 disk\r\nsda\u00a0\u00a0\u00a0\u00a0\u00a0 8:0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0 7G\u00a0 0 disk\r\n\u251c\u2500sda1\u00a0\u00a0 8:1\u00a0\u00a0\u00a0 0\u00a0 6.7G\u00a0 0 part\r\n\u251c\u2500sda2\u00a0\u00a0 8:2\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0 1K\u00a0 0 part\r\n\u2514\u2500sda5\u00a0\u00a0 8:5\u00a0\u00a0\u00a0 0\u00a0 341M\u00a0 0 part\r\nsr0\u00a0\u00a0\u00a0\u00a0 11:0\u00a0\u00a0\u00a0 1\u00a0 1.2G\u00a0 0 rom\u00a0 \/lib\/live\/mount\/medium\r\nloop0\u00a0\u00a0\u00a0 7:0\u00a0\u00a0\u00a0 0\u00a0 1.1G\u00a0 1 loop \/lib\/live\/mount\/rootfs\/filesystem.squashfs<\/pre>\n<p>In the above example you can see sda has 3 partitions, which is your OMV install, while sr0 is the DVD drive.<\/p>\n<p>Now run &#8220;fdisk -l \/dev\/sda&#8221; to get the details:<\/p>\n<pre class=\"crayon:false;\">root@debian:\/nas1# fdisk -l \/dev\/sda\r\n\r\nDisk \/dev\/sda: 7 GiB, 7516192768 bytes, 14680064 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: dos\r\nDisk identifier: 0x00080b9b\r\n\r\nDevice\u00a0\u00a0\u00a0\u00a0 Boot\u00a0\u00a0\u00a0 Start\u00a0\u00a0\u00a0\u00a0\u00a0 End\u00a0 Sectors\u00a0 Size Id Type\r\n\/dev\/sda1\u00a0 *\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2048 13977599 13975552\u00a0 6.7G 83 Linux\r\n\/dev\/sda2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13979646 14678015\u00a0\u00a0 698370\u00a0 341M\u00a0 5 Extended\r\n\/dev\/sda5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13979648 14678015\u00a0\u00a0 698368\u00a0 341M 82 Linux swap \/ Solaris<\/pre>\n<p>So from the above you can see the sectors are 512 bytes and there is 14680064 sectors.<\/p>\n<p>To back it up use &#8220;dcfldd&#8221;:<\/p>\n<pre class=\"crayon:false;\">dcfldd bs=512 if=\/dev\/sda | gzip -c &gt; omv2.1_vanilla_7gb-hdd_2-7-2016_512k-blocks.img.gz<\/pre>\n<p>So in the above example &#8220;bs=512&#8221; is setting the block size to 512. It works out much better if you set the block size the same as the sector size then the numbers will be the same. You should get something like:<\/p>\n<pre class=\"crayon:false;\">root@debian:\/nas1# dcfldd bs=512 if=\/dev\/sda | gzip -c\u00a0 &gt; omv2.1_vanilla_7gb-hdd_2-7-2016_512k-blocks.img.gz\r\n14680064 blocks (7168Mb) written.\r\n14680064+0 records in\r\n14680064+0 records out<\/pre>\n<p>Notice also the total number of records in and out is 14680064 which is exactly what fdisk reported. Obviously you will now find a file called &#8220;omv2.1_vanilla_7gb-hdd_2-7-2016_512k-blocks.img.gz&#8221; on your network share.<\/p>\n<p>I have a personal preference to include the number of records in the file name so when it comes to restore I know everything has gone ok:<\/p>\n<pre class=\"crayon:false; \">mv omv2.1_vanilla_7gb-hdd_2-7-2016_512k-blocks.img.gz omv2.1_vanilla_7gb-hdd_2-7-2016_512k-blocks_14680064-records.img.gz<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>OMV doesn&#8217;t have a backup function which is a problem. Given it is relatively straight forward to setup OMV one option is to simply set it up again. I really don&#8217;t want to do that so the only other comprehensive option is to backup the system disk. The problem is that there isn&#8217;t any free, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2411,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[312,4,313],"tags":[327,328,318,323,324,7,329,330,319,320,94],"class_list":["post-2381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","category-linux","category-open-media-vault","tag-backup","tag-dd","tag-debian","tag-disk","tag-drive","tag-hdd","tag-installation","tag-nas","tag-omv","tag-open-media-vault","tag-setup"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2381","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=2381"}],"version-history":[{"count":24,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2381\/revisions"}],"predecessor-version":[{"id":2472,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/2381\/revisions\/2472"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/2411"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2381"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}