Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I heard with LVM you can have very big partitions by fusing hard drives together. I heard with RAID you can have backups of your data.

Can i, and how would i do this: With 4 same hard drives, i want to put two in LVM, so i can have 300 GB. And that GB, i put it in RAID1 with the other 2 hard drives?

share|improve this question
This is called RAID 0+1, btw (combine two drives for space, and then mirror that array). LVM I don't really see as required here – Earlz Nov 12 '12 at 19:16
Keep in mind: RAID1 offers you Mirrors thus protecting you from HW failure, but NOT backups! Mirror maintains two identical copies: if someone overwrites data, both copies are damaged the same. – Martian Nov 28 '12 at 17:14

This normally works the other way around.

RAID is an acronym for Redundant Array of Independant Disks, and with it you can create large "md" devices across multiple physical devices (or partitions upon those devices) of the same size. Attempting to RAID mis-sized drives results in the RAID capacity being reduced.

There are many types of RAID, from level 0 (no parity, no loss of storage), 1 ("mirroring" - two devices only, exact duplication, halved capacity) and levels beyond those such as 5 and 6 (parity distributed across all drives, storage reductions as an equation of how many devices there are). It is a complex system and to fully explain it is beyond the scope of this site.

Logical Volume Management is a means of creating logical volumes within the partition space of one or many physical devices. It provides a great degree of flexibility over traditional partitions by being easier to resize the logical volumes "on-the-fly", and it's possible to create LV's on top of a RAID array, which you cannot partition traditionally.

This is the way it is usually done, with LVM on top of RAID.

share|improve this answer

You can do it like this (syntax not checked):

mdadm -C /dev/md1 -n 2 -l 1 /dev/sda /dev/sdb
mdadm -C /dev/md2 -n 2 -l 1 /dev/sdc /dev/sdd
mdadm -A /dev/md1 /dev/sda /dev/sdb
mdadm -A /dev/md2 /dev/sdc /dev/sdd

mdadm -C /dev/md0 -n 2 -l 0 /dev/md1 /dev/md2
mdadm -A /dev/md0 /dev/md1 /dev/md2

# alternatively:
mdadm -C /dev/md10 -n 4 -l 10 /dev/sda /dev/sdb /dev/sdc /dev/sdd
mdadm -A /dev/md10 /dev/sda /dev/sdb /dev/sdc /dev/sdd

vgcreate raid01vg /dev/md0 
lvcreate -n bigP raid01vg
lvchange -a y raid01vg/bigP 

mkfs.ext4 /dev/mapper/raid01vg/bigP 
mkdir /mnt/bank; mount /dev/mapped/raid01vg/bigP /mnt/bank
share|improve this answer

You must log in to answer this question.

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