{"id":12612,"date":"2019-03-28T03:48:01","date_gmt":"2019-03-28T03:48:01","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12612"},"modified":"2019-03-28T03:48:01","modified_gmt":"2019-03-28T03:48:01","slug":"mhddfs-combine-several-smaller-partition-into-one-large-virtual-storage","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/mhddfs-combine-several-smaller-partition-into-one-large-virtual-storage\/","title":{"rendered":"Mhddfs \u2013 Combine Several Smaller Partition into One Large Virtual Storage"},"content":{"rendered":"<p>Let\u2019s assume that you have\u00a0<strong>30GB<\/strong>\u00a0of movies and you have 3 drives each\u00a0<strong>20 GB<\/strong>\u00a0in size. So how will you store?<\/p>\n<p>Obviously you can split your videos in two or three different volumes and store them on the drive manually. This certainly is not a good idea, it is an exhaustive work which requires manual intervention and a lots of your time.<\/p>\n<p>Another solution is to create a\u00a0<a href=\"https:\/\/www.tecmint.com\/understanding-raid-setup-in-linux\/\" target=\"_blank\" rel=\"noopener\">RAID array of disk<\/a>. The RAID has always remained notorious for loss of storage reliability and usable disk space. Another solution is\u00a0<strong>mhddfs<\/strong>.<\/p>\n<div id=\"attachment_15410\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Combine-Multiple-Partitions-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15410\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Combine-Multiple-Partitions-in-Linux-620x295.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Combine-Multiple-Partitions-in-Linux-620x295.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Combine-Multiple-Partitions-in-Linux.png 717w\" alt=\"Combine Multiple Partitions in Linux\" width=\"620\" height=\"295\" aria-describedby=\"caption-attachment-15410\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15410\" class=\"wp-caption-text\">Mhddfs \u2013 Combine Multiple Partitions in Linux<\/p>\n<\/div>\n<p><strong>mhddfs<\/strong>\u00a0is a driver for Linux that combines several mount points into one virtual disk. It is a fuse based driver, which provides a easy solution for large data storage. It combines all small file systems to create a single big virtual filesystem which contains every particle of its member filesystem including files and free spaces.<\/p>\n<h4>Why you need Mhddfs?<\/h4>\n<p>All your storage devices creates a single virtual pool and it can be mounted right at the boot. This small utility takes care of, which drive is full and which is empty and to write data to what drive, intelligently. Once you create virtual drives successfully, you can share your virtual filesystem using\u00a0<a href=\"https:\/\/www.tecmint.com\/mount-filesystem-in-linux\/\" target=\"_blank\" rel=\"noopener\">SAMBA<\/a>. Your client will always see a huge drive and lots of free space.<\/p>\n<h4>Features of Mhddfs<\/h4>\n<ol>\n<li>Get attributes of the file system and system information.<\/li>\n<li>Set attributes of the file system.<\/li>\n<li>Create, Read, Remove and write Directories and files.<\/li>\n<li>Support for file locks and Hardlinks on single device.<\/li>\n<\/ol>\n<table border=\"0\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td align=\"center\" height=\"29\"><b>Pros of mhddfs<\/b><\/td>\n<td align=\"center\"><b>Cons of mhddfs<\/b><\/td>\n<\/tr>\n<tr class=\"alt\">\n<td align=\"left\" height=\"25\">\u00a0Perfect for home users.<\/td>\n<td align=\"left\">mhddfs driver is not built in the Linux Kernel<\/td>\n<\/tr>\n<tr>\n<td align=\"left\" height=\"25\">\u00a0Simple to run.<\/td>\n<td align=\"left\">\u00a0Required lots of processing power during runtime<\/td>\n<\/tr>\n<tr class=\"alt\">\n<td align=\"left\" height=\"25\">\u00a0No evidence of Data loss<\/td>\n<td align=\"left\">\u00a0No redundancy solution.<\/td>\n<\/tr>\n<tr>\n<td align=\"left\" height=\"25\">\u00a0Do not split the file.<\/td>\n<td align=\"left\">\u00a0Hardlinks moving not supported<\/td>\n<\/tr>\n<tr class=\"alt\">\n<td align=\"left\" height=\"25\">\u00a0Add new files to the combined virtual filesystem.<\/td>\n<td align=\"left\"><\/td>\n<\/tr>\n<tr>\n<td align=\"left\" height=\"25\">\u00a0Manage the location where these files are saved.<\/td>\n<td align=\"left\"><\/td>\n<\/tr>\n<tr class=\"alt\">\n<td align=\"left\" height=\"25\">\u00a0 Extended file attributes<\/td>\n<td align=\"left\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Installation of Mhddfs in Linux<\/h3>\n<p>On Debian and portable to alike systems, you can install mhddfs package using following command.<\/p>\n<pre># apt-get update &amp;&amp; apt-get install mhddfs\r\n<\/pre>\n<div id=\"attachment_15402\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Ubuntu.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15402\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Ubuntu-620x313.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Ubuntu-620x313.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Ubuntu.png 815w\" alt=\"Install Mhddfs on Debian based Systems\" width=\"620\" height=\"313\" aria-describedby=\"caption-attachment-15402\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15402\" class=\"wp-caption-text\">Install Mhddfs on Debian based Systems<\/p>\n<\/div>\n<p>On RHEL\/CentOS Linux systems, you need to turn on\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-enable-epel-repository-for-rhel-centos-6-5\/\" target=\"_blank\" rel=\"noopener\">epel-repository<\/a>\u00a0and then execute the below command to install\u00a0<strong>mhddfs<\/strong>\u00a0package.<\/p>\n<pre># yum install mhddfs\r\n<\/pre>\n<p>On\u00a0<strong>Fedora 22+<\/strong>\u00a0systems, you may get it by\u00a0<strong>dnf<\/strong>\u00a0package manger as shown below.<\/p>\n<pre># dnf install mhddfs\r\n<\/pre>\n<div id=\"attachment_15403\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Fedora.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15403\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Fedora-620x390.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Fedora-620x390.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Install-Mhddfs-on-Fedora.png 720w\" alt=\"Install Mhddfs on Fedora\" width=\"620\" height=\"390\" aria-describedby=\"caption-attachment-15403\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15403\" class=\"wp-caption-text\">Install Mhddfs on Fedora<\/p>\n<\/div>\n<p>If incase,\u00a0<strong>mhddfs<\/strong>\u00a0package isn\u2019t available from epel repository, then you need to resolve following dependencies to install and compile it from source as shown below.<\/p>\n<ol>\n<li>FUSE header files<\/li>\n<li>GCC<\/li>\n<li>libc6 header files<\/li>\n<li>uthash header files<\/li>\n<li>libattr1 header files (optional)<\/li>\n<\/ol>\n<p>Next, download the latest source package simply as suggested below and compile it.<\/p>\n<pre># wget http:\/\/mhddfs.uvw.ru\/downloads\/mhddfs_0.1.39.tar.gz\r\n# tar -zxvf mhddfs*.tar.gz\r\n# cd mhddfs-0.1.39\/\r\n# make\r\n<\/pre>\n<p>You should be able to see binary\u00a0<strong>mhddfs<\/strong>\u00a0in the current directory. Move it to\u00a0<strong>\/usr\/bin\/<\/strong>\u00a0and\u00a0<strong>\/usr\/local\/bin\/<\/strong>\u00a0as root.<\/p>\n<pre># cp mhddfs \/usr\/bin\/ \r\n# cp mhddfs \/usr\/local\/bin\/\r\n<\/pre>\n<p>All set,\u00a0<strong>mhddfs<\/strong>\u00a0is ready to be used.<\/p>\n<h3>How do I use Mhddfs?<\/h3>\n<p><strong>1.<\/strong>\u00a0Lets see all the\u00a0<strong>HDD<\/strong>\u00a0mounted to my system currently.<\/p>\n<pre>$ df -h\r\n<\/pre>\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Check-Mounted-Devices.gif\"><img decoding=\"async\" class=\"size-medium wp-image-15404\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Check-Mounted-Devices.gif\" alt=\"Check Mounted Devices\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<h5>Sample Output<\/h5>\n<pre>Filesystem      Size  Used Avail Use% Mounted on\r\n\r\n\/dev\/sda1       511M  132K  511M   1% \/boot\/efi\r\n\/dev\/sda2       451G   92G  336G  22% \/\r\n\/dev\/sdb1       1.9T  161G  1.7T   9% \/media\/avi\/BD9B-5FCE\r\n\/dev\/sdc1       555M  555M     0 100% <strong>\/media\/avi\/Debian 8.1.0 M-A 1<\/strong>\r\n<\/pre>\n<p>Notice the \u2018<strong>Mount Point<\/strong>\u2018 name here, which we will be using later.<\/p>\n<p><strong>2.<\/strong>\u00a0Create a directory\u00a0<code>\/mnt\/virtual_hdd<\/code>\u00a0where all these all file system will be grouped together as,<\/p>\n<pre># mkdir \/mnt\/virtual_hdd\r\n<\/pre>\n<p><strong>3.<\/strong>\u00a0And then mount all the file-systems. Either as root or as a user who is a member of\u00a0<strong>FUSE<\/strong>\u00a0group.<\/p>\n<pre># mhddfs \/boot\/efi, \/, \/media\/avi\/BD9B-5FCE\/, \/media\/avi\/Debian\\ 8.1.0\\ M-A\\ 1\/ \/mnt\/virtual_hdd  -o allow_other\r\n<\/pre>\n<div id=\"attachment_15405\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Mount-All-File-System-in-Linux.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15405\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Mount-All-File-System-in-Linux-620x252.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Mount-All-File-System-in-Linux-620x252.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Mount-All-File-System-in-Linux.png 815w\" alt=\"Mount All File System in Linux\" width=\"620\" height=\"252\" aria-describedby=\"caption-attachment-15405\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15405\" class=\"wp-caption-text\">Mount All File System in Linux<\/p>\n<\/div>\n<p><strong>Note<\/strong>: We are used mount Point names here of all the HDDs. Obviously the mount point in your case will be different. Also notice \u201c<strong>-o allow_other<\/strong>\u201d option makes this Virtual file system visible to all others and not only the person who created it.<\/p>\n<p><strong>4.<\/strong>\u00a0Now run \u201c<strong>df -h<\/strong>\u201d see all the filesystems. It should contain the one you created just now.<\/p>\n<pre>$ df -h\r\n<\/pre>\n<div id=\"attachment_15406\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Verify-Virtual-File-System.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-15406\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Verify-Virtual-File-System-620x419.png\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Verify-Virtual-File-System-620x419.png 620w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Verify-Virtual-File-System.png 875w\" alt=\"Verify Virtual File System Mount\" width=\"620\" height=\"419\" aria-describedby=\"caption-attachment-15406\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15406\" class=\"wp-caption-text\">Verify Virtual File System Mount<\/p>\n<\/div>\n<p>You can perform all the option to the\u00a0<strong>Virtual File System<\/strong>\u00a0you created as you would have done to a Mounted Drive.<\/p>\n<p><strong>5.<\/strong>\u00a0To create this Virtual File system on every system\u00a0<strong>boot<\/strong>, you should add the below line of code (in your case it should be different, depending upon your mount point), at the end of\u00a0<strong>\/etc\/fstab<\/strong>\u00a0file as root.<\/p>\n<pre>mhddfs# \/boot\/efi, \/, \/media\/avi\/BD9B-5FCE\/, \/media\/avi\/Debian\\ 8.1.0\\ M-A\\ 1\/ \/mnt\/virtual_hdd fuse defaults,allow_other 0 0\r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0If at any point of time you want to add\/remove a new drive to\u00a0<strong>Virtual_hdd<\/strong>, you may mount a new drive, copy the contents of mount point\u00a0<strong>\/mnt\/virtual_hdd<\/strong>,\u00a0<strong>un-mount<\/strong>\u00a0the volume, Eject the Drive you want to remove and\/or mount the new drive you want to include, Mount the overall filesystem under\u00a0<strong>Virtual_hdd<\/strong>\u00a0using\u00a0<strong>mhddfs<\/strong>command and you should be done.<\/p>\n<h4>How do I Un-Mount Virtual_hdd?<\/h4>\n<p>Unmounting virtual_hdd is as easy as,<\/p>\n<pre># umount \/mnt\/virtual_hdd\r\n<\/pre>\n<div id=\"attachment_15407\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Unmount-Virtual-Filesystem.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-15407\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2015\/08\/Unmount-Virtual-Filesystem.png\" alt=\"Unmount Virtual Filesystem\" width=\"495\" height=\"111\" aria-describedby=\"caption-attachment-15407\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-15407\" class=\"wp-caption-text\">Unmount Virtual Filesystem<\/p>\n<\/div>\n<p>Notice it is\u00a0<strong>umount<\/strong>\u00a0and not\u00a0<strong>unmount<\/strong>. A lot of user type it wrong.<\/p>\n<p>That\u2019s all for now. I am working on another post you people will love to read. Till then stay tuned and connected to Tecmint. Provide us with your valuable feedback in the comments below. Like and share us and help us get spread.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/combine-partitions-into-one-in-linux-using-mhddfs\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let\u2019s assume that you have\u00a030GB\u00a0of movies and you have 3 drives each\u00a020 GB\u00a0in size. So how will you store? Obviously you can split your videos in two or three different volumes and store them on the drive manually. This certainly is not a good idea, it is an exhaustive work which requires manual intervention and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/mhddfs-combine-several-smaller-partition-into-one-large-virtual-storage\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Mhddfs \u2013 Combine Several Smaller Partition into One Large Virtual Storage&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12612","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12612","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12612"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12612\/revisions"}],"predecessor-version":[{"id":12613,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12612\/revisions\/12613"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}