Can we mount multiple disks as one directory?

78,577

Solution 1

mhddfs is exactly what you are looking for: http://romanrm.net/mhddfs

You can mount like this:

mhddfs /mnt/a/,/mnt/b/,/mnt/c/ /storeall/

where /mnt/a/, /mnt/b/, and /mnt/c/ are three different mount points which can be from three different hard drives. You can unmount like this:

fusermount -u /storeall

If one disk fails you only lose the files that was stored on that particular disk. If your data is important for you and you would like your data to survive a disk failure you should consider a RAID setup instead (search for mdadm).

edit: PS! The devices you mount can even have different filesystems!

Solution 2

This isn't a filesystem problem, it is a partitioning problem.

What you want to do is remove the filesystems on these disks (backup any data that is already on them), then create a LVM volume set across all four disks. Then you can create a filesystem in that volume set, and mount that filesystem to a single place and fill it that way.

Be aware that there won't be any redundancy to this, and if you lose any of the four disks, you'll likely lose the data on ALL of them.

Solution 3

Check out UnionFS , it might help you.

Solution 4

MergerFS is a more recently created option. It is a FUSE filesystem which merges multiple directories: https://github.com/trapexit/mergerfs

mergerfs logically merges multiple paths together. Think a union of sets. The file/s or directory/s acted on or presented through mergerfs are based on the policy chosen for that particular action.

mergerfs does not support the copy-on-write (CoW) behavior found in aufs and overlayfs. You can not mount a read-only filesystem and write to it. However, mergerfs will ignore read-only drives when creating new files so you can mix read-write and read-only drives. It also does not split data across drives. It is not RAID0 / striping. It is simply a union.

Share:
78,577

Related videos on Youtube

Arman
Author by

Arman

I am a researcher. We are trying to understand the influence of the gas-dynamics on the galactic bar formation in the numerical N-Body simulations. My Research interests are: Galaxy formation Hydrodynamics N-Body interaction AGN influence on galaxy formation Large scale structure Parallel programming Visualization tools

Updated on September 17, 2022

Comments

  • Arman
    Arman almost 2 years

    Is there a way to mount the different disks as one directory? Assuming I have some disks with ext4 partitions:

    /dev/sda1 1Tb  mounted as /store1
    /dev/sda2 2Tb  mounted as /store2
    /dev/sdb1 2Tb  mounted as /store3
    /dev/sdb2 2Tb  mounted as /store4
    

    I would like to have /storeall with 7Tb space, merging them as one logical directory, so I can fill that with one rsync command.

    Is it possible on Linux? Which filesystem should I use?

  • Arman
    Arman over 13 years
    Thanks for suggestion. unfortunately the lvm does not work some of the disks are RAIDS from remote machines...they can be mounted via NFS. I think I found some solution like GlusterFS. I am still reading the documentation...
  • Arman
    Arman over 13 years
    Thanks for pointing it, are there port for the windows?
  • Opsse
    Opsse about 5 years
    mhddfs author no longer maintains it and suggests to use mergerfs instead. source
  • Arman
    Arman over 3 years
    thank you, looks interesting.