Is there a way to both mirror and combine drives in RAID?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Is there a way to both mirror and combine drives in RAID?
So I received a 300GB hard drive for Christmas. I have a Fedora Core 4 box running MythTV with a 200GB drive. The 200GB is filling up quickly because of the large MPEG2 files from recording TV shows. So I figured I would add the 300GB drive to the 200GB one. But I want to do it a special way if possible. Is there a way I could mirror 5GB on each drive and the rest be shared. For example, have one folder in called "backup" and have everything put in there be put on both drives for backup purposes. Then have the remaining space act on the two drives as a single drive for the MythTV recordings.
The only way possible I can think of is through RAID, but I haven't dealt with it before and I don't know about all the various types. If this can't be done, what form of RAID would be best for just making both drives act as one? If I'm correct, RAID 0 wouldn't be good because both drives don't match in size.
Finally, I would be using FC4's software RAID controller. Anything I would need to know about using this? Will I need any guides or should it be pretty self-explanatory?
for the mirroring part yes i'd suggest a basic raid 1 implementation, so make a 5gb partition at the start of both drives and make them linux raid type. Then use mdadm to set them up as raid 1. That's the boring part though. for the big space, don't use raid. instead use LVM. make the remaining space on both drives an LVM partition, then use pvcreate to create physical LVM volumes on both. then vgcreate to bind both pv's into a single volume group. then just allocate all the space to a single logical volume which you can mount. this is NOT raid of course, it's much much more flexible than that.. at any time in the future you can get another drive of whatever type you want and just extend the LVM onto it, totally flexibly.
if you require the existing data to be untouched, then it's sinple enough to just create the LVM and raid partition on the larger drive, mount it and copy all data into the LVM. Then nuke the old one and extend the LVM over onto it.
LVM might seem a little daunting to set up from cold, but it's just the fact that it's containers inside other containers.. it's really simple once you "get" it and it's so horribly flexible, you can easily migrate all your data across different devices without any downtime etc... you could also run LVM ontop of a raid partition... but that's just getting silly.
Forgive me for bumping this back up, but I'm having trouble figuring out how to copy the data over from the smaller drive to the larger one. I want to keep all the data from the old drive (which includes the FC4 install), so I created a 200GB logical volume in the volume group. But that's where I've stopped. I think I have to setup a file system, but I'm a bit unsure of how to do that. After that, I don't know how I'd go about transferring all my files over to the new drive. Won't I have to edit some config files to have FC4 boot up from the larger drive and not the smaller one so I'll be able to nuke it out?
First, where did you (or will you) back up your data before all this shuffling?
To set up a new drive, you need partitions and filesystems. As one example, you might use fdisk to create a partition, and then format it using mkfs, or any of its variants. Do a "man mkfs" to see details and a list of the variants.
It sounds like you are not looking for RAID for redundancy---do you need it for speed? If neither, then just use LVM as suggested---or perhaps just keep them separate. You can mount partitions on either drive to any point on your directory tree.
Why do you want to move FC4 to a different drive? If you really need to do this, it may be simpler to just re-install.
My original intent was to, if possible, have a few GB on each of the two drives set up in RAID 1. So I could transfer files from other machines on my network to this space to use as a backup for them. Then I was going to use the remaining space on the drives as a storage area for the MythTV recordings. The LVM method described above would be perfect for my needs, but I'm beginning to think it's going to be a hassle to transfer all my files from the current drive to the new drive so I could set the whole system up. I'm probably just going to end up backing up all my MythTV recordings and settings and then just reinstalling FC4 with LVM set up from the start.
Actually, if you intend to do a whole bunch of recording, maybe you should setup your drives in a RAID 0(striping mode). You'll get better performance. Especially if you intend to record multiple shows at once. Or HDTV. Fewer chances of dropped frames and stuff like that. Plus you'll get more out of your computer if you a intend to use it while its recording.
well as long as the stride is set right for LVM you'll get the same performance from LVM as raid0, but with much greater flexibility.
as for reinstalling or not... i would probably just recommend leaving FC4 where it is, creating LVM on the new drive and moving any videos acrodss to it, and shrink the FC4 install down to make space for a new LVM volume on the smalelr drive. leave FC4 as a largely seperate concern to the mass data storage. It's possibly beneficial to boot the OS from a single drive (save for mirrored raid configurations), irrespective of video data spannign mutliple devices.