0

I have a Linux server with four 2 TB drives in a RAID arrangement. This array is then added to a Volume Group and a Logical Volume is created from it. This Logical Volume is shared out to a Windows box via Samba.

I am going to get four 3 TB drives and would like to add them into the mix so that the Windows only sees a single share/drive to mount.

Example four 2 TB drives RAID 5 (as an example) gives me a single 6 TB drive volume mounted in Windows via SAMBA. Let’s call the share/LV 2tbshare. Data is then put on the 2tbshare and fills up the entire share.

Four new 3 TB drives are purchased. I was thinking of just adding them in via RAID. 2 TB + 2 TB + 2 TB + 2 TB + 3 TB + 3 TB + 3 TB + 3 TB (RAID5 as an example) but this would waste 1 TB on each of the 3 TB drives resulting in a 14 TB array.

I could create two RAID arrays. 1 RAID array of 2 TB drives and 1 RAID array of 3 TB drives. But how do I combine these? Do I add both RAID arrays into a single Volume Group and then create the Logical Volume 2tbshare from the Volume Group? What happens if one of the drives fails?

Or do I just keep the 2 TB and 3 TB drives as JBOD and add all of them into a single Volume Group. Then create the logical volume off of this Volume Group? What would be the total size of this Volume Group?

What would be the best approach?

1
  • I'm not an expert on this matter, so a comment rather than an answer. I would mount all drives into one big volume, so the share remains the same. Have no idea how that works exactly on linux, and you should probably backup your data just in case.
    – LPChip
    Jan 28, 2015 at 21:40

1 Answer 1

0

I assume you are using mdadm or similar for RAID management. It doesn't really matter as long as the raided drives show up as a block device per array. Assume: Your existing raided 2TB drives are /dev/md0 and your newly raided 3TB drives are /dev/md1.

My suggestion is you do not re-raid your drives. Keep them separate as md0 of RAID5 (2TB 2TB ...), and md1 of RAID5 (3TB 3TB ...). This way you don't waste disk space, do not need to rebuild any arrays, and do not lose any data. (accidents can still happen, and you should back up your data first!).

Then just:

1) Unmount the share first using umount
2) Create physical volume on your new array: pvcreate /dev/md1
3) Extend your existing volume group with the new raid drives: vgextend -v vg0 /dev/md1
4) Resize the existing logical volume: lvresize -L NewSize /dev/mapper/vg0-lv0
5) Resize the filesystem underneath the LV: resize2fs /dev/mapper/vg0-lv0
6) Remount the share with mount
(vg0 = the name of your volume group. lv0 = the name of your logical volume.)

You should have 6 TB + 9 TB = 15 TB total capacity.

Sources: I just tested all of these commands in a virtual machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .