* Linux RAID migration @ 2007-08-07 8:16 saeed bishara 2007-08-07 8:26 ` Tuomas Leikola 0 siblings, 1 reply; 21+ messages in thread From: saeed bishara @ 2007-08-07 8:16 UTC (permalink / raw) To: linux-raid Hi, I'm looking for a method for doing RAID migration while keeping the data available. the migrations I'm interested with are: 1. Single drive ->RAID1/RAID5 2. RAID1 -> RAID5. the mdadm and kernel doesn't seem to provide built-in and crash-proof solution. but I found that RAID5 on 2 drives in degraded mode looks like a RAID1 (mirroring), and since linux supports RAID5 reshape, then I can use it to do the migration from RAID1 to RAID5 with 3 drives or more. - can I really assume that RAID 5 on 2 hdds (degraded mode) will function as raid 5? - how to build raid while keeping the contents of an existing drive available? saeed ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 8:16 Linux RAID migration saeed bishara @ 2007-08-07 8:26 ` Tuomas Leikola 2007-08-07 10:02 ` saeed bishara 0 siblings, 1 reply; 21+ messages in thread From: Tuomas Leikola @ 2007-08-07 8:26 UTC (permalink / raw) To: saeed bishara; +Cc: linux-raid On 8/7/07, saeed bishara <saeed.bishara@gmail.com> wrote: > Hi, > I'm looking for a method for doing RAID migration while keeping the > data available. > the migrations I'm interested with are: > 1. Single drive ->RAID1/RAID5 > 2. RAID1 -> RAID5. > 1. is a bit complicated, as a raid device on a disk is slightly smaller than the original device. you might need to copy data manually. 2. should be simple as (offline) re-creating the raid as raid5. > - can I really assume that RAID 5 on 2 hdds (degraded mode) will > function as raid 5? You should test by using loopback devices and files. But why degraded? raid5 of two disks should look like raid1. > - how to build raid while keeping the contents of an existing drive available? Normally the array is available when building/rebuilding. - tuomas ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 8:26 ` Tuomas Leikola @ 2007-08-07 10:02 ` saeed bishara 2007-08-07 10:22 ` Neil Brown 0 siblings, 1 reply; 21+ messages in thread From: saeed bishara @ 2007-08-07 10:02 UTC (permalink / raw) To: Tuomas Leikola; +Cc: linux-raid On 8/7/07, Tuomas Leikola <tuomas.leikola@gmail.com> wrote: > On 8/7/07, saeed bishara <saeed.bishara@gmail.com> wrote: > > Hi, > > I'm looking for a method for doing RAID migration while keeping the > > data available. > > the migrations I'm interested with are: > > 1. Single drive ->RAID1/RAID5 > > 2. RAID1 -> RAID5. > > > > 1. is a bit complicated, as a raid device on a disk is slightly > smaller than the original device. you might need to copy data > manually. I think I can overcome this problem by creating linear raid on the initial disk. > > 2. should be simple as (offline) re-creating the raid as raid5. this didn't work, I created raid1 array on sda[12], then stopped it, and created new raid5 on sda[123], the data on the raid1 was not preserved. > > > - can I really assume that RAID 5 on 2 hdds (degraded mode) will > > function as raid 5? > > You should test by using loopback devices and files. But why degraded? > raid5 of two disks should look like raid1. I meant to ask whether raid 5 on 2 disks will function as raid1 :( > > > - how to build raid while keeping the contents of an existing drive available? > > Normally the array is available when building/rebuilding. > > - tuomas > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 10:02 ` saeed bishara @ 2007-08-07 10:22 ` Neil Brown 2007-08-07 10:32 ` saeed bishara 2007-08-07 10:37 ` Linux RAID migration Tomasz Chmielewski 0 siblings, 2 replies; 21+ messages in thread From: Neil Brown @ 2007-08-07 10:22 UTC (permalink / raw) To: saeed bishara; +Cc: Tuomas Leikola, linux-raid On Tuesday August 7, saeed.bishara@gmail.com wrote: > > 2. should be simple as (offline) re-creating the raid as raid5. > this didn't work, I created raid1 array on sda[12], then stopped it, > and created new raid5 on sda[123], the data on the raid1 was not > preserved. Create the new raid5 on sda[12] (same 2 devices as the raid1) and it will work. Then grow to make it raid5 on 3 drives if you want. > > > > > - can I really assume that RAID 5 on 2 hdds (degraded mode) will > > > function as raid 5? > > > > You should test by using loopback devices and files. But why degraded? > > raid5 of two disks should look like raid1. > I meant to ask whether raid 5 on 2 disks will function as raid1 :( A 2-disk raid5 and a 2-disk raid1 put the data in exactly the same place - is that what you wanted to know? NeilBrown ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 10:22 ` Neil Brown @ 2007-08-07 10:32 ` saeed bishara 2007-08-07 10:46 ` saeed bishara 2007-08-07 10:37 ` Linux RAID migration Tomasz Chmielewski 1 sibling, 1 reply; 21+ messages in thread From: saeed bishara @ 2007-08-07 10:32 UTC (permalink / raw) To: Neil Brown; +Cc: Tuomas Leikola, linux-raid > > A 2-disk raid5 and a 2-disk raid1 put the data in exactly the same > place - is that what you wanted to know? > yes, exactly. > NeilBrown > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 10:32 ` saeed bishara @ 2007-08-07 10:46 ` saeed bishara 2007-08-07 11:18 ` Neil Brown 0 siblings, 1 reply; 21+ messages in thread From: saeed bishara @ 2007-08-07 10:46 UTC (permalink / raw) To: Neil Brown; +Cc: Tuomas Leikola, linux-raid how can I create raid 5 array that preserves the contents of a given disk (part of the array)? I can do that in two steps, raid 5 on two disks then reshape it to be real raid5, but is there a direct way to do it? saeed ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 10:46 ` saeed bishara @ 2007-08-07 11:18 ` Neil Brown 2007-08-07 11:31 ` saeed bishara 0 siblings, 1 reply; 21+ messages in thread From: Neil Brown @ 2007-08-07 11:18 UTC (permalink / raw) To: saeed bishara; +Cc: Tuomas Leikola, linux-raid On Tuesday August 7, saeed.bishara@gmail.com wrote: > how can I create raid 5 array that preserves the contents of a given > disk (part of the array)? > I can do that in two steps, raid 5 on two disks then reshape it to be > real raid5, but is there a direct way to do it? What do you mean by "real raid 5". Two disks are just as much an array as 10. What do you mean by "direct". If I understand your requirements correctly, there are two obvious steps. 1/ make the data appear in a raid5 2/ change the number of devices in the raid5. Are two steps too many? I guess I don't understand your question. NeilBrown ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 11:18 ` Neil Brown @ 2007-08-07 11:31 ` saeed bishara 2007-08-07 11:40 ` Neil Brown 0 siblings, 1 reply; 21+ messages in thread From: saeed bishara @ 2007-08-07 11:31 UTC (permalink / raw) To: Neil Brown; +Cc: Tuomas Leikola, linux-raid On 8/7/07, Neil Brown <neilb@suse.de> wrote: > On Tuesday August 7, saeed.bishara@gmail.com wrote: > > how can I create raid 5 array that preserves the contents of a given > > disk (part of the array)? > > I can do that in two steps, raid 5 on two disks then reshape it to be > > real raid5, but is there a direct way to do it? > > What do you mean by "real raid 5". Two disks are just as much an > array as 10. I meant by real raid 5 to raid 5 over 3 drives or above. > What do you mean by "direct". If I understand your requirements in one mdadm command > correctly, there are two obvious steps. > 1/ make the data appear in a raid5 > 2/ change the number of devices in the raid5. > > Are two steps too many? in this case I two options: 1. keep the filesystem unmounted tell step 1 in done -> the fs will not be available for long time 2. force umount before step 2. > > I guess I don't understand your question. > > NeilBrown > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 11:31 ` saeed bishara @ 2007-08-07 11:40 ` Neil Brown 2007-08-07 13:27 ` saeed bishara 2007-08-15 9:02 ` SWAP file on a RAID-10 array possible? Tomas France 0 siblings, 2 replies; 21+ messages in thread From: Neil Brown @ 2007-08-07 11:40 UTC (permalink / raw) To: saeed bishara; +Cc: Tuomas Leikola, linux-raid On Tuesday August 7, saeed.bishara@gmail.com wrote: > On 8/7/07, Neil Brown <neilb@suse.de> wrote: > > On Tuesday August 7, saeed.bishara@gmail.com wrote: > > > how can I create raid 5 array that preserves the contents of a given > > > disk (part of the array)? > > > I can do that in two steps, raid 5 on two disks then reshape it to be > > > real raid5, but is there a direct way to do it? > > > > What do you mean by "real raid 5". Two disks are just as much an > > array as 10. > I meant by real raid 5 to raid 5 over 3 drives or above. > > What do you mean by "direct". If I understand your requirements > in one mdadm command > > correctly, there are two obvious steps. > > 1/ make the data appear in a raid5 > > 2/ change the number of devices in the raid5. > > > > Are two steps too many? > in this case I two options: > 1. keep the filesystem unmounted tell step 1 in done -> the fs will > not be available for long time No, it shouldn't take a long time.... What exactly do you have, and what exactly do you want to achieve? If think you started of by saying you wanted to convert a raid1 to a raid5. Yes, that requires the filesystem to be unmounted, but only takes seconds to achieve: mdadm -S /dev/md0 mdadm -C /dev/md0 -l5 -n2 /dev/sda1 /dev/sdb1 mount /dev/md0 If you have a single-disk, you first might need to shrink the filesystem to make sure there is 128K free at the end of the device: umount /filesystem resize2fs /dev/sda1 whatever-number mdadm -C /dev/md0 -l5 -n1 /dev/sda1 missing mount /dev/md0 /filesystem # now add the drives and grow mdadm /dev/md0 --add /dev/sdb1 /dev/sdc1 # wait for recovery to finish mdadm --grow /dev/md0 --raid-disks=3 something like that.. NeilBrown ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 11:40 ` Neil Brown @ 2007-08-07 13:27 ` saeed bishara 2007-08-07 15:15 ` saeed bishara 2007-08-15 9:02 ` SWAP file on a RAID-10 array possible? Tomas France 1 sibling, 1 reply; 21+ messages in thread From: saeed bishara @ 2007-08-07 13:27 UTC (permalink / raw) To: Neil Brown; +Cc: Tuomas Leikola, linux-raid On 8/7/07, Neil Brown <neilb@suse.de> wrote: > On Tuesday August 7, saeed.bishara@gmail.com wrote: > > On 8/7/07, Neil Brown <neilb@suse.de> wrote: > > > On Tuesday August 7, saeed.bishara@gmail.com wrote: > > > > how can I create raid 5 array that preserves the contents of a given > > > > disk (part of the array)? > > > > I can do that in two steps, raid 5 on two disks then reshape it to be > > > > real raid5, but is there a direct way to do it? > > > > > > What do you mean by "real raid 5". Two disks are just as much an > > > array as 10. > > I meant by real raid 5 to raid 5 over 3 drives or above. > > > What do you mean by "direct". If I understand your requirements > > in one mdadm command > > > correctly, there are two obvious steps. > > > 1/ make the data appear in a raid5 > > > 2/ change the number of devices in the raid5. > > > > > > Are two steps too many? > > in this case I two options: > > 1. keep the filesystem unmounted tell step 1 in done -> the fs will > > not be available for long time > > No, it shouldn't take a long time.... > > What exactly do you have, and what exactly do you want to achieve? > > If think you started of by saying you wanted to convert a raid1 to a > raid5. Yes, that requires the filesystem to be unmounted, but only > takes seconds to achieve: > > mdadm -S /dev/md0 > mdadm -C /dev/md0 -l5 -n2 /dev/sda1 /dev/sdb1 > mount /dev/md0 > > If you have a single-disk, you first might need to shrink the > filesystem to make sure there is 128K free at the end of the device: > > umount /filesystem > resize2fs /dev/sda1 whatever-number > mdadm -C /dev/md0 -l5 -n1 /dev/sda1 missing -n1 didn't work, but -n2 succeeded. > mount /dev/md0 /filesystem > # now add the drives and grow > mdadm /dev/md0 --add /dev/sdb1 /dev/sdc1 > # wait for recovery to finish > mdadm --grow /dev/md0 --raid-disks=3 > > something like that.. great, this actually does the migration from single drive to raid5 as I was looking for. thanks. > > NeilBrown > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 13:27 ` saeed bishara @ 2007-08-07 15:15 ` saeed bishara 2007-08-09 3:23 ` Neil Brown 0 siblings, 1 reply; 21+ messages in thread From: saeed bishara @ 2007-08-07 15:15 UTC (permalink / raw) To: Neil Brown; +Cc: Tuomas Leikola, linux-raid > > mdadm --grow /dev/md0 --raid-disks=3 the mdadm --grow supports saving backup file that can be used to re-assemble the array in case of crash during the "critical section". Any idea what is the size of file? or is there any upper limit in the case of array of 5 drives? saeed ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 15:15 ` saeed bishara @ 2007-08-09 3:23 ` Neil Brown 0 siblings, 0 replies; 21+ messages in thread From: Neil Brown @ 2007-08-09 3:23 UTC (permalink / raw) To: saeed bishara; +Cc: Tuomas Leikola, linux-raid On Tuesday August 7, saeed.bishara@gmail.com wrote: > > > mdadm --grow /dev/md0 --raid-disks=3 > the mdadm --grow supports saving backup file that can be used to > re-assemble the array in case of crash during the "critical section". > Any idea what is the size of file? or is there any upper limit in the > case of array of 5 drives? The file size depends on the chunk size and the number of disks. I think for 5 disks it would be less than 30 times the chunk size, so for a 128K chunk, it would be under 3 Meg. NeilBrown ^ permalink raw reply [flat|nested] 21+ messages in thread
* SWAP file on a RAID-10 array possible? 2007-08-07 11:40 ` Neil Brown 2007-08-07 13:27 ` saeed bishara @ 2007-08-15 9:02 ` Tomas France 2007-08-15 10:10 ` David Greaves 2007-08-15 22:02 ` Bill Davidsen 1 sibling, 2 replies; 21+ messages in thread From: Tomas France @ 2007-08-15 9:02 UTC (permalink / raw) To: linux-raid Hi everyone, I apologize for asking such a fundamental question on the Linux-RAID list but the answers I found elsewhere have been contradicting one another. So, is it possible to have a swap file on a RAID-10 array? Thanks! Tomas ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: SWAP file on a RAID-10 array possible? 2007-08-15 9:02 ` SWAP file on a RAID-10 array possible? Tomas France @ 2007-08-15 10:10 ` David Greaves 2007-08-15 10:28 ` Tomas France 2007-08-15 22:02 ` Bill Davidsen 1 sibling, 1 reply; 21+ messages in thread From: David Greaves @ 2007-08-15 10:10 UTC (permalink / raw) To: Tomas France; +Cc: linux-raid Tomas France wrote: > Hi everyone, > > I apologize for asking such a fundamental question on the Linux-RAID > list but the answers I found elsewhere have been contradicting one another. > > So, is it possible to have a swap file on a RAID-10 array? yes. mkswap /dev/md<X> swapon /dev/md<X> Should you use RAID-10 for swap? That's philosophy :) David ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: SWAP file on a RAID-10 array possible? 2007-08-15 10:10 ` David Greaves @ 2007-08-15 10:28 ` Tomas France 2007-08-15 12:59 ` David Greaves ` (2 more replies) 0 siblings, 3 replies; 21+ messages in thread From: Tomas France @ 2007-08-15 10:28 UTC (permalink / raw) To: linux-raid Thanks for the answer, David! I kind of think RAID-10 is a very good choice for a swap file. For now I will need to setup the swap file on a simple RAID-1 array anyway, I just need to be prepared when it's time to add more disks and transform the whole thing into RAID-10... which will be big fun anyway, for sure ;) By the way, does anyone know if there is a comprehensive how-to on software RAID with mdadm available somewhere? I mean a website where I could get answers to questions like "How to convert your system from no RAID to RAID-1, from RAID-1 to RAID-5/10, how to setup LILO/GRUB to boot from a RAID-1 array" etc. Don't take me wrong, I have "done my homework" and found a lot of info on the topic but a lot of it is several years old and many things have changed since then. And it's quite scattered too.. Tomas ----- Original Message ----- From: "David Greaves" <david@dgreaves.com> To: "Tomas France" <tomfra@centrum.cz> Cc: <linux-raid@vger.kernel.org> Sent: Wednesday, August 15, 2007 12:10 PM Subject: Re: SWAP file on a RAID-10 array possible? > Tomas France wrote: >> Hi everyone, >> >> I apologize for asking such a fundamental question on the Linux-RAID list >> but the answers I found elsewhere have been contradicting one another. >> >> So, is it possible to have a swap file on a RAID-10 array? > yes. > > mkswap /dev/md<X> > swapon /dev/md<X> > > Should you use RAID-10 for swap? That's philosophy :) > > David > - > To unsubscribe from this list: send the line "unsubscribe linux-raid" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: SWAP file on a RAID-10 array possible? 2007-08-15 10:28 ` Tomas France @ 2007-08-15 12:59 ` David Greaves 2007-08-15 14:32 ` Daniel Korstad 2007-08-15 21:42 ` Michael Tokarev 2 siblings, 0 replies; 21+ messages in thread From: David Greaves @ 2007-08-15 12:59 UTC (permalink / raw) To: Tomas France; +Cc: linux-raid Tomas France wrote: > Thanks for the answer, David! you're welome > By the way, does anyone know if there is a comprehensive how-to on > software RAID with mdadm available somewhere? I mean a website where I > could get answers to questions like "How to convert your system from no > RAID to RAID-1, from RAID-1 to RAID-5/10, how to setup LILO/GRUB to boot > from a RAID-1 array" etc. Don't take me wrong, I have "done my homework" > and found a lot of info on the topic but a lot of it is several years > old and many things have changed since then. And it's quite scattered too.. Yes, I got to thinking that. About a year ago I got a copy of the old raid FAQ from the authors and have started to modify it when I have time and it bubbles up my list. Try http://linux-raid.osdl.org/ It's a community wiki - welcome to the community :) Please feel free to edit,,, Also feel free to post questions/suggestions here if you're not sure. David ^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: SWAP file on a RAID-10 array possible? 2007-08-15 10:28 ` Tomas France 2007-08-15 12:59 ` David Greaves @ 2007-08-15 14:32 ` Daniel Korstad 2007-08-15 21:42 ` Michael Tokarev 2 siblings, 0 replies; 21+ messages in thread From: Daniel Korstad @ 2007-08-15 14:32 UTC (permalink / raw) To: Tomas France; +Cc: linux-raid I used this site to bring my existing Linux install to a RAID 1. It worked great for me. http://wiki.clug.org.za/wiki/RAID-1_in_a_hurry_with_grub_and_mdadm ----- Original Message ----- From: linux-raid-owner@vger.kernel.org on behalf of Tomas France Sent: Wed, 8/15/2007 5:28am To: linux-raid@vger.kernel.org Subject: Re: SWAP file on a RAID-10 array possible? Thanks for the answer, David! I kind of think RAID-10 is a very good choice for a swap file. For now I will need to setup the swap file on a simple RAID-1 array anyway, I just need to be prepared when it's time to add more disks and transform the whole thing into RAID-10... which will be big fun anyway, for sure ;) By the way, does anyone know if there is a comprehensive how-to on software RAID with mdadm available somewhere? I mean a website where I could get answers to questions like "How to convert your system from no RAID to RAID-1, from RAID-1 to RAID-5/10, how to setup LILO/GRUB to boot from a RAID-1 array" etc. Don't take me wrong, I have "done my homework" and found a lot of info on the topic but a lot of it is several years old and many things have changed since then. And it's quite scattered too.. Tomas ----- Original Message ----- From: "David Greaves" <david@dgreaves.com> To: "Tomas France" <tomfra@centrum.cz> Cc: <linux-raid@vger.kernel.org> Sent: Wednesday, August 15, 2007 12:10 PM Subject: Re: SWAP file on a RAID-10 array possible? > Tomas France wrote: >> Hi everyone, >> >> I apologize for asking such a fundamental question on the Linux-RAID list >> but the answers I found elsewhere have been contradicting one another. >> >> So, is it possible to have a swap file on a RAID-10 array? > yes. > > mkswap /dev/md<X> > swapon /dev/md<X> > > Should you use RAID-10 for swap? That's philosophy :) > > David > - > To unsubscribe from this list: send the line "unsubscribe linux-raid" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: SWAP file on a RAID-10 array possible? 2007-08-15 10:28 ` Tomas France 2007-08-15 12:59 ` David Greaves 2007-08-15 14:32 ` Daniel Korstad @ 2007-08-15 21:42 ` Michael Tokarev 2007-08-18 8:52 ` Tomas France 2 siblings, 1 reply; 21+ messages in thread From: Michael Tokarev @ 2007-08-15 21:42 UTC (permalink / raw) To: Tomas France; +Cc: linux-raid Tomas France wrote: > Thanks for the answer, David! > > I kind of think RAID-10 is a very good choice for a swap file. For now I > will need to setup the swap file on a simple RAID-1 array anyway, I just > need to be prepared when it's time to add more disks and transform the > whole thing into RAID-10... which will be big fun anyway, for sure ;) By the way, you don't really need raid10 for swap. Built-in linux swap code can utilize multiple swap areas just fine - mkswap + swapon on multiple devices/files. This is essentially a raid0. For raid10, one thing needed is the mirroring, with is provided by raid1. So when you've two drives, use single partition on both to form a raid1 array for swap space. If you've 4 drives, create 2 raid1 arrays and specify them both as swap space, giving them appropriate priority (prio=xxx in swap line in fstab). With 6 drives, have 3 raid1 arrays and so on... This way, the whole thing is much simpler and more manageable. /mjt ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: SWAP file on a RAID-10 array possible? 2007-08-15 21:42 ` Michael Tokarev @ 2007-08-18 8:52 ` Tomas France 0 siblings, 0 replies; 21+ messages in thread From: Tomas France @ 2007-08-18 8:52 UTC (permalink / raw) To: linux-raid This wouldn't be probably the best solution in my situation. The computer we are talking about will be quad-core web server with 8GB RAM and initially 2x500GB SATA HDDs setup in a RAID-1 array. When it begins running low on space or more HDDs performance is needed, I plan to convert the RAID-1 to RAID-10 by adding 2-4 more hard disks (I've found some info on how to do this so hopefully it will work). If I should follow the commonly accepted strategy saying that the swap space should be 2X+ the amount of RAM, that means 16GB. If I add 4 more HDDs in RAID-1 pairs later, then I would end up with 3 swap partitions on RAID-1 taking 96GB (6*16GB) of space on the harddrives which would be a considerable waste of space. Sure, when adding the more hard disks I could probably create a smaller swap partition on each of them but that would be yet another complication. Using a swap file initally on the RAID-1 array and then on the RAID-10 array sounds like a much simpler solution to me as it will allow me to change the size of the swap space more flexibly. Tomas ----- Original Message ----- From: "Michael Tokarev" <mjt@tls.msk.ru> To: "Tomas France" <tomfra@centrum.cz> Cc: <linux-raid@vger.kernel.org> Sent: Wednesday, August 15, 2007 11:42 PM Subject: Re: SWAP file on a RAID-10 array possible? > Tomas France wrote: >> Thanks for the answer, David! >> >> I kind of think RAID-10 is a very good choice for a swap file. For now I >> will need to setup the swap file on a simple RAID-1 array anyway, I just >> need to be prepared when it's time to add more disks and transform the >> whole thing into RAID-10... which will be big fun anyway, for sure ;) > > By the way, you don't really need raid10 for swap. Built-in linux > swap code can utilize multiple swap areas just fine - mkswap + swapon > on multiple devices/files. This is essentially a raid0. For raid10, > one thing needed is the mirroring, with is provided by raid1. So > when you've two drives, use single partition on both to form a raid1 > array for swap space. If you've 4 drives, create 2 raid1 arrays and > specify them both as swap space, giving them appropriate priority > (prio=xxx in swap line in fstab). With 6 drives, have 3 raid1 arrays > and so on... This way, the whole thing is much simpler and more > manageable. > > /mjt > ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: SWAP file on a RAID-10 array possible? 2007-08-15 9:02 ` SWAP file on a RAID-10 array possible? Tomas France 2007-08-15 10:10 ` David Greaves @ 2007-08-15 22:02 ` Bill Davidsen 1 sibling, 0 replies; 21+ messages in thread From: Bill Davidsen @ 2007-08-15 22:02 UTC (permalink / raw) To: Tomas France; +Cc: linux-raid Tomas France wrote: > Hi everyone, > > I apologize for asking such a fundamental question on the Linux-RAID > list but the answers I found elsewhere have been contradicting one > another. > > So, is it possible to have a swap file on a RAID-10 array? Yes, and very fast as well. Do note that if you (a) need to boot from a recovery CD and (b) have a low memory machine which really needs swap early, most of the ones I've tried don't use such a swap, you have to start it by hand. Also, I have not tried suspend to disk and restore using RAID-10, it's on my to-do list, but *way* down. But in general you will find it very fast and reliable. -- bill davidsen <davidsen@tmr.com> CTO TMR Associates, Inc Doing interesting things with small computers since 1979 ^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: Linux RAID migration 2007-08-07 10:22 ` Neil Brown 2007-08-07 10:32 ` saeed bishara @ 2007-08-07 10:37 ` Tomasz Chmielewski 1 sibling, 0 replies; 21+ messages in thread From: Tomasz Chmielewski @ 2007-08-07 10:37 UTC (permalink / raw) To: Neil Brown; +Cc: saeed bishara, Tuomas Leikola, linux-raid Neil Brown schrieb: (...) >>>> - can I really assume that RAID 5 on 2 hdds (degraded mode) will >>>> function as raid 5? >>> You should test by using loopback devices and files. But why degraded? >>> raid5 of two disks should look like raid1. >> I meant to ask whether raid 5 on 2 disks will function as raid1 :( > > A 2-disk raid5 and a 2-disk raid1 put the data in exactly the same > place - is that what you wanted to know? Is the same valid for RAID-10? Let's say, you degraded a 4-disk RAID-10 to just 2 (proper) disks. Then, you want to migrate it to 2-disk, 3, 4, and eventually, 5-disk RAID-5 array. Would the RAID-10 -> RAID-5 migration be as easy as in RAID-1 -> RAID-5 case? -- Tomasz Chmielewski http://wpkg.org ^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2007-08-18 8:52 UTC | newest] Thread overview: 21+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2007-08-07 8:16 Linux RAID migration saeed bishara 2007-08-07 8:26 ` Tuomas Leikola 2007-08-07 10:02 ` saeed bishara 2007-08-07 10:22 ` Neil Brown 2007-08-07 10:32 ` saeed bishara 2007-08-07 10:46 ` saeed bishara 2007-08-07 11:18 ` Neil Brown 2007-08-07 11:31 ` saeed bishara 2007-08-07 11:40 ` Neil Brown 2007-08-07 13:27 ` saeed bishara 2007-08-07 15:15 ` saeed bishara 2007-08-09 3:23 ` Neil Brown 2007-08-15 9:02 ` SWAP file on a RAID-10 array possible? Tomas France 2007-08-15 10:10 ` David Greaves 2007-08-15 10:28 ` Tomas France 2007-08-15 12:59 ` David Greaves 2007-08-15 14:32 ` Daniel Korstad 2007-08-15 21:42 ` Michael Tokarev 2007-08-18 8:52 ` Tomas France 2007-08-15 22:02 ` Bill Davidsen 2007-08-07 10:37 ` Linux RAID migration Tomasz Chmielewski
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).