tdldev at gmail.com
Sun Sep 18 15:43:29 UTC 2011
On Sun, Sep 18, 2011 at 8:02 AM, Verde Denim <tdldev at gmail.com> wrote:
> On Sun, Sep 18, 2011 at 4:19 AM, Tim Frost <timfrost at xtra.co.nz> wrote:
>> On Sat, 2011-09-17 at 22:22 -0400, Verde Denim wrote:
>> > I have two 1 TB drives in my latest Ubuntu 11.04 system.
>> > I have a 500GB drive as the 'main' OS and home drive, and I want to
>> > the two additional drives as follows:
>> > /dev/sdb is mirrored on /dev/sdc
>> A standard RAID-1 mirror set will do the mirroring in software, for
>> partitions, as you describe below
>> > On /dev/sdb,I'd like to have three logical volumes -
>> > /dev/backup
>> > /dev/media
>> > /dev/share
>> > so that if I need to grow one or more of these, I can add additional
>> > I setup the RAID1 type on both discs, so that fdisk -l produces this -
>> > /dev/sda: 500.1 Gb
>> > /dev/sda1 * 1 58746 83 Linux
>> > /dev/sda2 58746 60802 5 Extended
>> > /dev/sda5 58746 60802 82 Linux swap / Solaris
>> > /dev/sdb: 1000.2 GB
>> > /dev/sdb1 1 121601 fd Linux raid autodetect
>> > /dev/sdc: 1000.2 GB
>> > /dev/sdc1 1 121601 fd Linux raid autodetect
>> > If I setup the lvm's on /dev/sdb, won't this wipe the fd that currently
>> > resides there?
>> Yes, you would lose that.
>> > Is there a way to accomplish both RAID1 and LVMs on this drive or am I
>> > doing so to mething in the wrong way?
>> What you have done so far is correct.
>> The next step is to create a RAID-1 mirror using /dev/sdb1
>> and /dev/sdc1. This can be achieved with the following command:
>> mdadm --create /dev/md0 --level=1 \
>> --raid-devices=2 /dev/sdb1 /dev/sdc1
>> The options are:
>> --create /dev/md0 create a new array on device /dev/md0
>> --level=1 of type 1 (mirror)
>> --raid-devices=2 with two LVM VG vg0members
>> If the command succeeds, you should now have /dev/md0 available, and can
>> now create the LVM structure inside /dev/md0.
>> So the structure is:
>> has members:
>> LVM volume group VG0
>> It is possible that one of the graphical tools, such as parted, will
>> present an easier way of building the structure.
>> Growing beyond the 1TB disk size is probably not going to work, as the
>> mdadm tool doesn't appear to support expanding the size/number of
>> stripes (you need the members of the RAID-1 mirror to be RAID-0
>> structures before it is possible to expand beyond a single physical
>> > Thanks, as always for the input.
>> > Regards
>> > Jack
>> J, Tim
> 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.
> 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 -
> 1 (or 1.0) = stores the metadata at the end
> 1.1 = stores metadata at the start
> 1.2 (or default) = stores metadata at a 4k offset from the start
> The two additional types listed (ddf, imsm) deal with the container type I
> mentioned above.
> 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?
> 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
> Again, I greatly appreciate the responses!
> Update - Did I get this right?
Here's what I did and where I'm fuzzy -
1. created /dev/sdb and /dev/sdc as 'fd' (Linux RAID auto-detect)
2. create the RAID 1
mdadm --create /dev/md0 --metadata=1.2 --level=1 --homehost=Theo
--name=TheoMirror1 --raid-devices=2 /dev/sdb1 /dev/sdc1
3. Create logical volume group
vgcreate TheoVG0 /dev/md0
run vgdisplay to verify - OK
4. create logical volumes in the group
lvcreate -L200G -n TheoVG0_Backup TheoVG0
lvcreate -L700G -n TheoVG0_Media TheoVG
lvcreate -L31.5G -n TheoVG0_Share TheoVG
run lvdisplay to verify - OK
5. Create filesystems on logical volumes
[No Partition Table]
create new primary partition as ext4, name = Backup
repeat for the other two logical volumes, name = Media, Share
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:
Backup = /dev/dm-0
Media = /dev/dm-1
Share = /dev/dm-2
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?
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.
>> Tim Frost <timfrost at xtra.co.nz>
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ubuntu-users