Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My primary partition is sdb. I add new disk (sda) and formatted it as shown below:

fdisk -l

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00050ccb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      499711      248832   83  Linux
/dev/sdb2          501758   488396799   243947521    5  Extended
/dev/sdb5          501760   488396799   243947520   8e  Linux LVM

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00050ccb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   fd  Linux raid autodetect
/dev/sda2          501758   488396799   243947521    5  Extended
/dev/sda5          501760   488396799   243947520   fd  Linux raid autodetect

Disk /dev/mapper/ubuntu--server-root: 247.7 GB, 247652679680 bytes
255 heads, 63 sectors/track, 30108 cylinders, total 483696640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--server-root doesn't contain a valid partition table

Disk /dev/mapper/ubuntu--server-swap_1: 2143 MB, 2143289344 bytes
255 heads, 63 sectors/track, 260 cylinders, total 4186112 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--server-swap_1 doesn't contain a valid partition table

I already have the following:

/dev/mapper/ubuntu--server-root

/dev/mapper/ubuntu--server-swap_1

Now I want to install mdadm. Do I need to create md0 and md1? I checked this tutorial, but I don't know if it's smart to create md0 and md1 because then I don't know what to do with /dev/mapper/*.

share|improve this question
    
You are too ahead in time, wait until we come there. –  Santosh Kumar May 8 '12 at 9:03
1  
@Enigma When editing posts, please take the time to fix all the problems and mistakes, not just one or a select few. I noticed that many of your recent edits have "minor fixes" as the edit summary. That should be a sign that you're perhaps being a bit too hasty about your editing. Try to make sure the post is as good as it can be before hitting the Save button. If you're not sure how to best fix the post, leave it be, or alternatively flag it for moderator attention or ask someone on chat or meta for help. Thanks! –  Indrek Feb 15 '13 at 17:50
    
Sure thing. I just noticed the obvious title error from afar and didn't read the post itself (not usually the case) but I will be more thorough. I would hope that a customized repose for each post not be necessary however. I generally specify removal(unnecessary stuff), fixes(grammar/readability), syntax changes(a change not falling into the fix/removal category) under which most things fit. The repeated use of minor fixes when I am well, fixing things, is a time saver since I can simply type 'm' and click. If that is considered lazy here but not in browsers, I would question the reason. –  Enigma Feb 15 '13 at 17:59
    
@Enigma There's nothing necessarily wrong with repeatedly using the same edit summary, although as a sub-2K user you may want to be a bit more specific, for the benefit of the editors reviewing your suggestions. My point, however, was that a number of your edits have seemed pretty minor, and I wanted to point that out as something to work on. The reason I mentioned your edit summaries was that, if you end up labelling your edits as "minor fixes", that's a good time to stop, take a step back and see if there's anything else you can do to make the edit more substantial. Cheers! –  Indrek Feb 15 '13 at 19:24
    
A lot of the time though, the amount that can be done is not necessarily that substantial where there still may be a few things that should be done. One could argue that if it's only a little bit, it shouldn't necessarily be bothered with but I would reference this: en.wikipedia.org/wiki/Kaizen –  Enigma Feb 15 '13 at 21:05

2 Answers 2

If you can, I'd suggest grabbing a copy of the alternate installer from here, it's not as pretty as the normal one but you can create RAIDs from within it.

share|improve this answer

MD RAIDs can be created in different ways. Let's stick with your RAID1 question for this answer. You can mirror the underlying physical devices (create /dev/mdX from two /dev/sdZ) or you can use a partition-less setup where you pre-create the partitions on each of the physical disks and then create arrays out of the volumes ("partitions") - each of which will show as "linux-raid-member" or similar in fdisk. So in this case you'd end up using two /dev/sdZ1 (or /dev/sdZ2 etc ...) to create one /dev/mdX.

Then to further complicate things you can layer the MD RAID on top of an LVM2 volume or below. You seem to be interested in layering it below. As long as you are aware of the implications all of these variants are fine.

In the past, however, I have made the experience that in disaster cases it makes sense to stick to a single "layer" (independent of whether it's partition-less or not). If you have enough redundancy counted in this won't be a problem (e.g. in RAID10), but in case of RAID1 only a single physical device needs to fail to lose redundancy. Similarly for RAID5, which is the reason why people tend to prefer RAID6 these days.


The above said I would recommend you create a degraded RAID1 from the new disk and migrate over to that. After you're done you could then resynchronize the array with the "old" disk as second member of the array. However, this creates a brief time window in which your data isn't available redundantly. So keep a backup handy.


One more thing, of course you need not layer your swap on top of the RAID (or LVM2 for that matter). Which is the reason I prefer the partition-less setup in general. It allows me to designate - for example - /dev/sda6 and /dev/sdb6 as swap, while the partitions /dev/sda1//dev/sdb1 and /dev/sda2//dev/sdb2 get bundled into one /dev/mdX respectively.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.