View previous topic :: View next topic |
Author |
Message |
cspos n00b
Joined: 11 Jul 2004 Posts: 60
|
Posted: Sat Jul 24, 2004 4:27 pm Post subject: md "RAID" With One Disk |
|
|
I have a single 160GB in a computer right now. In just a few minutes, I'm going to order another one. Ultimately I will set up a RAID 1 array using the md function of 2.6. In the meantime, I could really use those 160GBs of space. Would I be able to set up the array with just the one disk for now, and then hot add the other one when it arrives? What would my /etc/raidtab look like? |
|
Back to top |
|
|
KH n00b
Joined: 28 Jun 2003 Posts: 26 Location: Canada
|
Posted: Sat Jul 24, 2004 5:26 pm Post subject: |
|
|
Have you tried to set it up as you would normally with 2 disks? I thought the whole point of RAID 1 is that it could run even after a disk failure (or in your case - a non-existant disk ). |
|
Back to top |
|
|
cspos n00b
Joined: 11 Jul 2004 Posts: 60
|
Posted: Sat Jul 24, 2004 6:07 pm Post subject: |
|
|
I only have the one disk, so I can't, although I have done it in the recent past on other hardware so I'm familiar with the process.
I would only use the one drive alone temporarily -- I'd be adding the second drive with a week or so. |
|
Back to top |
|
|
stahlsau Guru
Joined: 09 Jan 2004 Posts: 584 Location: WildWestwoods
|
Posted: Sat Jul 24, 2004 6:12 pm Post subject: |
|
|
i think it´s not possible, but if it was, the whole thing would be VERY slow (every disk-write had to be performed 2 times on one disk).
Skip it and do same periodically backups on a spare drive/partition. Imho this is better than raid1, since when you hose your configs and aren´t able to boot/login, you can boot from your backup-partition. |
|
Back to top |
|
|
cspos n00b
Joined: 11 Jul 2004 Posts: 60
|
Posted: Sat Jul 24, 2004 7:09 pm Post subject: |
|
|
You don't seem to understand what I'm getting at.
For now, the first 160GB would act as a single drive. When I get the second 160GB, I would hot add it and build a RAID 1 array between the two. But I'm not sure how to do that, or if it's even possible. |
|
Back to top |
|
|
KH n00b
Joined: 28 Jun 2003 Posts: 26 Location: Canada
|
Posted: Sun Jul 25, 2004 1:18 am Post subject: |
|
|
Ok, let me clarify my first post a bit ...
a quick google led to this : http://linas.org/linux/Software-RAID/Software-RAID-3.html
It's dated from 1998 so you aren't the first person to consider this....
Quote: |
Q: Can I set up one-half of a RAID-1 mirror with the one disk I have now, and then later get the other disk and just drop it in?
A: With the current tools, no, not in any easy way. In particular, you cannot just copy the contents of one disk onto another, and then pair them up. This is because the RAID drivers use glob of space at the end of the partition to store the superblock. This decreases the amount of space available to the file system slightly; if you just naively try to force a RAID-1 arrangement onto a partition with an existing filesystem, the raid superblock will overwrite a portion of the file system and mangle data. Since the ext2fs filesystem scatters files randomly throughput the partition (in order to avoid fragmentation), there is a very good chance that some file will land at the very end of a partition long before the disk is full.
If you are clever, I suppose you can calculate how much room the RAID superblock will need, and make your filesystem slightly smaller, leaving room for it when you add it later. But then, if you are this clever, you should also be able to modify the tools to do this automatically for you. (The tools are not terribly complex).
Note:A careful reader has pointed out that the following trick may work; I have not tried or verified this: Do the mkraid with /dev/null as one of the devices. Then mdadd -r with only the single, true disk (do not mdadd /dev/null). The mkraid should have successfully built the raid array, while the mdadd step just forces the system to run in "degraded" mode, as if one of the disks had failed. |
|
|
Back to top |
|
|
|