I have installed Debian 7.4 on a server, and through the installer I setup both RAID and LVM for the drive that the OS is installed on.  However, now I want to add two 4TB drives in a RAID-1 array to the system, and then add in LVM onto those drives.The question I have is: do I need to partition the drives before I put them in an array?Most of the guides that I have seen will do something like this:mkfs.ext4 /dev/sdb  #create /dev/sdb1mkfs.ext4 /dev/sdc  #create /dev/sdc1mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1mkfs.ext4 /dev/md0  #create a filesystem table on the RAID array#LVM creation on the RAID arrayvgcreate vg_name /dev/md0lvcreate -n lv_name -l100%FREE vg_namemkfs.ext4 /dev/mapper/vg_name-lv_namemount /dev/mapper/vg_name-lv_name /mount_pointHowever, I have just tried the following in a VM, which appears to work properly:mdadm --create --verbose /dev/md0 --level=mirror --raid-devices=2 /dev/sdb /dev/sdc#LVM creation on the RAID arrayvgcreate vg_name /dev/md0lvcreate -n lv_name -l100%FREE vg_namemkfs.ext4 /dev/mapper/vg_name-lv_namemount /dev/mapper/vg_name-lv_name /mount_pointIs there any difference between these two methods of creating a RAID/LVM array?  It seems as though creating a filesystem three times is unnecessary.
Proper way to setup RAID in linux
debian;raid;mdadm
Your question boils down to the following two questions:What difference is there between using raw disk devices and partitions in a mdadm software RAID array?I'm not aware of any consensus on using a whole disk vs using a partitioned disk.  There shouldn't be any real performance considerations and mdadm supports doing it both ways.  I tend to use partitions myself for the sole reason that if I add to the RAID set or replace a failed disk, I don't need to match sizes of the disk and instead can size a partition to the RAID and use the remaining space for something else (if the disk is bigger).  Do I need to write a filesystems to the disk partitions or the /dev/mdX device prior to making it an LVM PV?No, you do not.  Neither the RAID or LVM need a filesystem on the member devices, and if you put one there it will get overwritten by either the filesystem you write to md0 or the LVM metadata if making md0 a PV. The script is incorrect in suggesting the mfks.ext4 calls create the partitions, but rather they are created when you partition the disk.  You never need to write the filesystems to the first two devices in your script (that get added to RAID).  You only need to create the filesystem on md0 if you are stopping there and using md0 directly mounted (i.e. not using LVM).If you are using md0 as an LVM PV, there is no reason to write a filesystem to it first, as that information will be destroyed by the LVM metadata. 