How do I "combine" two hard drives in Ubuntu?

23
2014-04
  • Paul Biggar

    My old hard drive layout was:

    • 200GB holding /
    • 500GB holding /home/

    However, the 200GB drive kicked the bucket this morning, and I have a new 500GB to replace it. I don't need a full 500GB for /, since most of my data is on /home/, but I could do with more space on /home/. Is there any way to transparently combine the disks?

    I'm going to put Ubuntu Karmic on the new drive, and don't care what filesystem I use. I'm using reiserFS (I think reiser3, not certain) on /home/.

  • Answers
  • 8088

    LVM is the best way I think, make sure to create a Volume Group (VG) that contains all your Physical Volumes (PV, i.e. your partitions), and then you can divide the VG into several Logical Volumes (LV) for your need.

    LVM is not easy to grasp at first, and an image might help :

    LVM Schema

    I've also seen mdadm used together with LVM. mdadm provides a software RAID system to gather the various drives. If it's to make a RAID0 system (striped disks), it might not be worth it, but it gets interesting if you want to have a RAID1 (mirror) with your two drives, and still use LVM on top of it.

  • admintech

    You'll either need to do a RAID, which will mean you'll have to backup everything and start again

    Or use a program called Linux Volume Management

    With logical volume management, the whole disk would be allocated to a single volume group and logical volumes created to hold the / /usr and /home file systems. If, for example the /home logical volume later filled up but there was still space available on /usr then it would be possible to shrink /usr by a few megabytes and reallocate that space to /home.

  • vava

    As an alternative, there's a bunch of filesystems that can "merge" two filesystems into one tree. Most notable one is UnionFS, but there's also Aufs and mhddfs, last one supports some extensive features as route writing to the volume with most free space on it.


  • Related Question

    Moving Ubuntu to a new hard drive, partitions reorganization
  • NeDark

    I'm using Ubuntu on my laptop on a 250GB hard drive. I'm going to install a new 500GB hard drive and will create new partitions on it for different purposes.

    Can I simply copy the partition where Ubuntu is installed to the new hard drive or will a reinstallation be needed? The first problem I find is that the fstab file should be rewritten.

    What would you do in this case?


  • Related Answers
  • NeDark

    Finally I tried to copy the partition directly and it looks that modifying the fstab file was the only thing needed.

  • bbatman

    For what I understand. You want to clone the image of your old hard drive and install it to your new drive.

    If you are attempting to do this, I recommend Clonezilla.
    Here is a tutorial of how to clone your hard drive.

    I hope this answered your question.