<br><br><div class="gmail_quote">On Sun, Sep 18, 2011 at 8:02 AM, Verde Denim <span dir="ltr"><<a href="mailto:tdldev@gmail.com">tdldev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Sun, Sep 18, 2011 at 4:19 AM, Tim Frost <span dir="ltr"><<a href="mailto:timfrost@xtra.co.nz" target="_blank">timfrost@xtra.co.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Jack,<br>
<div><br>
On Sat, 2011-09-17 at 22:22 -0400, Verde Denim wrote:<br>
> I have two 1 TB drives in my latest Ubuntu 11.04 system.<br>
> I have a 500GB drive as the 'main' OS and home drive, and I want to setup<br>
> the two additional drives as follows:<br>
><br>
> /dev/sdb is mirrored on /dev/sdc<br>
<br>
</div>A standard RAID-1 mirror set will do the mirroring in software, for<br>
partitions, as you describe below<br>
<div>><br>
> On /dev/sdb,I'd like to have three logical volumes -<br>
> /dev/backup<br>
> /dev/media<br>
> /dev/share<br>
><br>
> so that if I need to grow one or more of these, I can add additional discs.<br>
><br>
> I setup the RAID1 type on both discs, so that fdisk -l produces this -<br>
><br>
> /dev/sda: 500.1 Gb<br>
> /dev/sda1 *        1  58746 83 Linux<br>
> /dev/sda2    58746 60802   5 Extended<br>
> /dev/sda5    58746 60802  82 Linux swap / Solaris<br>
><br>
> /dev/sdb: 1000.2 GB<br>
> /dev/sdb1         1  121601 fd Linux raid autodetect<br>
><br>
> /dev/sdc: 1000.2 GB<br>
> /dev/sdc1         1  121601 fd Linux raid autodetect<br>
><br>
> If I setup the lvm's on /dev/sdb, won't this wipe the fd that currently<br>
> resides there?<br>
</div>Yes, you would lose that.<br>
<div><br>
><br>
> Is there a way to accomplish both RAID1 and LVMs on this drive or am I just<br>
</div>> doing so to mething in the wrong way?<br>
<br>
What you have done so far is correct.<br>
<br>
The next step is to create a RAID-1 mirror using /dev/sdb1<br>
and /dev/sdc1.  This can be achieved with the following command:<br>
  mdadm --create /dev/md0  --level=1  \<br>
     --raid-devices=2 /dev/sdb1 /dev/sdc1<br>
<br>
The options are:<br>
  --create /dev/md0  create a new array on device /dev/md0<br>
  --level=1          of type 1 (mirror)<br>
  --raid-devices=2   with two  LVM VG vg0members<br>
<br>
If the command succeeds, you should now have /dev/md0 available, and can<br>
now create the LVM structure inside /dev/md0.<br>
<br>
<br>
So the structure is:<br>
/dev/md0:<br>
  has members:<br>
        /dev/sdb1<br>
        /dev/sdc1<br>
  contains:<br>
        LVM volume group VG0<br>
                VG0--backup<br>
                VG0--media<br>
                VG0--share<br>
<br>
<br>
It is possible that one of the graphical tools, such as parted, will<br>
present an easier way of building the structure.<br>
<br>
<br>
Growing beyond the 1TB disk size is probably not going to work, as the<br>
mdadm tool doesn't appear to support expanding the size/number of<br>
stripes (you need the members of the RAID-1 mirror to be RAID-0<br>
structures before it is possible to expand beyond a single physical<br>
partition).<br>
<div><br>
<br>
> Thanks, as always for the input.<br>
><br>
> Regards<br>
><br>
> Jack<br>
<br>
</div>Tim<br>
<font color="#888888"><br></font></blockquote></div></div><div>J, Tim<br>Thank you very much for the missing linkage! I used the parted (actually gparted to see how that tool worked) to do the initial steps, but when I looked at the options on the gui (format the volume, partition the volume OR format the disc, partition the disc) I decided I'd rather know what's going on under the hood than try and decipher someone's idea of what that functionality may mean. I can always go back and read the user land info on the gui to get familiar with the meaning behind the push buttons but it's more important for me to really _know_ how the process works.<br>

<br>In reading through the man pages on mdadm, I find that there is a flag that can be set to declare the style of metadata. In the man pages, the options are that if 0 or 0.9 is used, it limits arrays to 28 component devices and also limits devices of type 1 or greater to 2 TB. However, if the option chosen is either 1, 1.1, or 1.2, no such limitation is documented. It further says that if the value of default is given, it equates to 1.2. Each of these metadata options equates to a different version of superblock format such that - <br>

1 (or 1.0) = stores the metadata at the end<br>1.1 = stores metadata at the start<br>1.2 (or default) = stores metadata at a 4k offset from the start<br><br>The two additional types listed (ddf, imsm) deal with the container type I mentioned above.<br>

<br>In doing a bit of googling, it seems that the 1.2 option is almost the overwhelming favorite. Do you (or anyone in the list) have an idea as to why a 4k offset makes more sense than storing the metadata either at the start or end of the device?<br>

<br>In looking into mdadm a bit more, I find that one of the raid device 
types that is supported is called a container. The man description 
presents an interesting possibility for possibly extending the 2TB 
physical limitation (at least in a logical fashion). I need to read up 
more on this topic,though.<br><br>Again, I greatly appreciate the responses! <br><br>Regards<br><br>Jack<br>
<br>Update - Did I get this right?<br></div></div></blockquote><div>Here's what I did and where I'm fuzzy - <br>1. created /dev/sdb and /dev/sdc as 'fd' (Linux RAID auto-detect)<br>2. create the RAID 1<br>
    mdadm --create /dev/md0 --metadata=1.2 --level=1 --homehost=Theo --name=TheoMirror1 --raid-devices=2 /dev/sdb1 /dev/sdc1<br>3. Create logical volume group<br>    vgcreate TheoVG0 /dev/md0<br><br>    run vgdisplay to verify - OK<br>
<br>4. create logical volumes in the group<br>    lvcreate -L200G -n TheoVG0_Backup TheoVG0<br>    lvcreate -L700G -n TheoVG0_Media TheoVG<br>    lvcreate -L31.5G -n TheoVG0_Share TheoVG<br><br>    run lvdisplay to verify - OK<br>
<br>5. Create filesystems on logical volumes<br>    fdisk /dev/TheoVG/TheoVG_Backup<br>    <br>    [No Partition Table]<br><br>   create new primary partition as ext4, name = Backup<br><br>    repeat for the other two logical volumes, name = Media, Share<br>
<br>After this, I opened the disk utility to see what can be seen. The raid shows up and there is a progress meter moving slowly that is labeled 'syncronizing'; the logical volume group and the volumes within it are also showing up. The three logical volumes say that they are associated as:<br>
Backup = /dev/dm-0<br>Media = /dev/dm-1<br>Share = /dev/dm-2<br><br>So it appears that all is ok, but I'm wondering - do I need to create those same logical volumes on the 2nd disc or when the raid finishes syncronizing will this be done as a function of the raid1?<br>
<br>Thanks again for the help - maybe I'm just confusing myself with this, but since I want this to be a permanent layout for my home server, I'd like to get it right and understand how this is configured properly.<br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<font color="#888888">
--<div class="im"><br>
Tim Frost <<a href="mailto:timfrost@xtra.co.nz" target="_blank">timfrost@xtra.co.nz</a>><br>
</div></font><br>--<div class="im"><br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com" target="_blank">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>