Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
md "RAID" With One Disk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
cspos
n00b
n00b


Joined: 11 Jul 2004
Posts: 60

PostPosted: Sat Jul 24, 2004 4:27 pm    Post subject: md "RAID" With One Disk Reply with quote

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
View user's profile Send private message
KH
n00b
n00b


Joined: 28 Jun 2003
Posts: 26
Location: Canada

PostPosted: Sat Jul 24, 2004 5:26 pm    Post subject: Reply with quote

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 :roll: ).
Back to top
View user's profile Send private message
cspos
n00b
n00b


Joined: 11 Jul 2004
Posts: 60

PostPosted: Sat Jul 24, 2004 6:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
stahlsau
Guru
Guru


Joined: 09 Jan 2004
Posts: 584
Location: WildWestwoods

PostPosted: Sat Jul 24, 2004 6:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
cspos
n00b
n00b


Joined: 11 Jul 2004
Posts: 60

PostPosted: Sat Jul 24, 2004 7:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
KH
n00b
n00b


Joined: 28 Jun 2003
Posts: 26
Location: Canada

PostPosted: Sun Jul 25, 2004 1:18 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum