* [raidX vs single/dup] @ 2013-09-26 12:22 miaou sami 2013-09-26 12:32 ` Hugo Mills 0 siblings, 1 reply; 6+ messages in thread From: miaou sami @ 2013-09-26 12:22 UTC (permalink / raw) To: linux-btrfs@vger.kernel.org Hi btrfs guys, could someone explain to me the differences in mkfs.btrfs: - between -d raid0 and -d single - between -m raid1 and -m dup - between -m raid0 and -m single My understanding is that raidX should be used in case of multi devices and single/dup should be used in case of single device to allow duplication, but it is not 100% clear to me... As btrfs raid concepts are quite different from traditionnal raid, shouldn't we use the words "stripped" and "mirrored" instead of raid0/raid1? or even "single" and "duplicated"? Then there would be no difference between single/raid0 and duplicated/raid1... Regards, Sam ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [raidX vs single/dup] 2013-09-26 12:22 [raidX vs single/dup] miaou sami @ 2013-09-26 12:32 ` Hugo Mills 2013-09-26 13:40 ` miaou sami 0 siblings, 1 reply; 6+ messages in thread From: Hugo Mills @ 2013-09-26 12:32 UTC (permalink / raw) To: miaou sami; +Cc: linux-btrfs@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 1849 bytes --] On Thu, Sep 26, 2013 at 12:22:49PM +0000, miaou sami wrote: > Hi btrfs guys, > > could someone explain to me the differences in mkfs.btrfs: > > - between -d raid0 and -d single In RAID0, data is striped across all the devices, so the first 64k of a file will go on device 1, the next 64k will go on device 2, and so on. With single, files are allocated linearly on one device. (This is assuming smallish files, a filesystem with lots of space. Even with single, files can still end up being scattered around over multiple devices -- but with RAID0, even non-fragmented files are striped) > - between -m raid1 and -m dup In both cases, there are two copies of each metadata block. With RAID1, it *requires* the two copies to live on different devices. With DUP, it allows the two copies to live on the same device (e.g. if there's only one device). > - between -m raid0 and -m single As for -draid0 and -dsingle, but for metadata instead of data. > My understanding is that raidX should be used in case of multi > devices and single/dup should be used in case of single device to > allow duplication, but it is not 100% clear to me... > As btrfs raid concepts are quite different from traditionnal raid, > shouldn't we use the words "stripped" and "mirrored" instead of > raid0/raid1? or even "single" and "duplicated"? > Then there would be no difference between single/raid0 and > duplicated/raid1... But there _are_ differences between them, as explained above. :) I posted a patch a while ago to change the names to something more logical and expressive, but it didn't get merged. Hugo. -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- Stick them with the pointy end. --- [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [raidX vs single/dup] 2013-09-26 12:32 ` Hugo Mills @ 2013-09-26 13:40 ` miaou sami 2013-09-26 13:46 ` Hugo Mills 0 siblings, 1 reply; 6+ messages in thread From: miaou sami @ 2013-09-26 13:40 UTC (permalink / raw) To: Hugo Mills; +Cc: linux-btrfs@vger.kernel.org Thank you, it is quite clear now. I guess that on multi device, raid0 vs single would be a matter of performance vs ease of low level hardware data recovery. The wiki https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices says: "When you have drives with differing sizes and want to use the full capacity of each drive, you have to use the single profile for the data blocks." Let's assume the following configuration: 1x10GB disk and 2x5GB disks --> Does it mean I cannot use the full capacity AND have a duplication of my data in the configuration above? (full capacity would be 10GB here) --> If I try to setup either -d raid1 or -d dup on that configuration, what will I get? --> Is there any behavior difference between raid1 / dup in that case? --> Can raid1 ensure that data are always duplicated on different devices AND take advantage of all available space? Regards, Sam ---------------------------------------- > Date: Thu, 26 Sep 2013 13:32:33 +0100 > From: hugo@carfax.org.uk > To: miaousami@hotmail.com > CC: linux-btrfs@vger.kernel.org > Subject: Re: [raidX vs single/dup] > > On Thu, Sep 26, 2013 at 12:22:49PM +0000, miaou sami wrote: >> Hi btrfs guys, >> >> could someone explain to me the differences in mkfs.btrfs: >> >> - between -d raid0 and -d single > > In RAID0, data is striped across all the devices, so the first 64k > of a file will go on device 1, the next 64k will go on device 2, and > so on. With single, files are allocated linearly on one device. > > (This is assuming smallish files, a filesystem with lots of space. > Even with single, files can still end up being scattered around over > multiple devices -- but with RAID0, even non-fragmented files are > striped) > >> - between -m raid1 and -m dup > > In both cases, there are two copies of each metadata block. With > RAID1, it *requires* the two copies to live on different devices. With > DUP, it allows the two copies to live on the same device (e.g. if > there's only one device). > >> - between -m raid0 and -m single > > As for -draid0 and -dsingle, but for metadata instead of data. > >> My understanding is that raidX should be used in case of multi >> devices and single/dup should be used in case of single device to >> allow duplication, but it is not 100% clear to me... > >> As btrfs raid concepts are quite different from traditionnal raid, >> shouldn't we use the words "stripped" and "mirrored" instead of >> raid0/raid1? or even "single" and "duplicated"? >> Then there would be no difference between single/raid0 and >> duplicated/raid1... > > But there _are_ differences between them, as explained above. :) > > I posted a patch a while ago to change the names to something more > logical and expressive, but it didn't get merged. > > Hugo. > > -- > === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === > PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk > --- Stick them with the pointy end. --- ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [raidX vs single/dup] 2013-09-26 13:40 ` miaou sami @ 2013-09-26 13:46 ` Hugo Mills 2013-09-26 14:55 ` miaou sami 0 siblings, 1 reply; 6+ messages in thread From: Hugo Mills @ 2013-09-26 13:46 UTC (permalink / raw) To: miaou sami; +Cc: linux-btrfs@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 3785 bytes --] On Thu, Sep 26, 2013 at 01:40:57PM +0000, miaou sami wrote: > Thank you, it is quite clear now. > > > I guess that on multi device, raid0 vs single would be a matter of performance vs ease of low level hardware data recovery. > > > The wiki https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices says: > "When you have drives with differing sizes and want to use the full capacity of each drive, you have to use the single profile for the data blocks." > Let's assume the following configuration: 1x10GB disk and 2x5GB disks > --> Does it mean I cannot use the full capacity AND have a duplication of my data in the configuration above? (full capacity would be 10GB here) No, that will give you the full usable space. A 20 GB drive and two 5 GB drives would not, though. > --> If I try to setup either -d raid1 or -d dup on that > configuration, what will I get? Try it for yourself in the space simulator: http://carfax.org.uk/btrfs-usage/ > --> Is there any behavior difference between raid1 / dup in that case? If you have multiple disks, I think DUP gets automatically upgraded to RAID-1 (i.e. the "different copies on different devices" requirement is enforced). So, no. > --> Can raid1 ensure that data are always duplicated on different devices AND take advantage of all available space? Depends on the relative sizes of the devices. If your largest device is bigger than the rest put together, then you'll lose some space. Hugo. > Regards, > Sam > > > ---------------------------------------- > > Date: Thu, 26 Sep 2013 13:32:33 +0100 > > From: hugo@carfax.org.uk > > To: miaousami@hotmail.com > > CC: linux-btrfs@vger.kernel.org > > Subject: Re: [raidX vs single/dup] > > > > On Thu, Sep 26, 2013 at 12:22:49PM +0000, miaou sami wrote: > >> Hi btrfs guys, > >> > >> could someone explain to me the differences in mkfs.btrfs: > >> > >> - between -d raid0 and -d single > > > > In RAID0, data is striped across all the devices, so the first 64k > > of a file will go on device 1, the next 64k will go on device 2, and > > so on. With single, files are allocated linearly on one device. > > > > (This is assuming smallish files, a filesystem with lots of space. > > Even with single, files can still end up being scattered around over > > multiple devices -- but with RAID0, even non-fragmented files are > > striped) > > > >> - between -m raid1 and -m dup > > > > In both cases, there are two copies of each metadata block. With > > RAID1, it *requires* the two copies to live on different devices. With > > DUP, it allows the two copies to live on the same device (e.g. if > > there's only one device). > > > >> - between -m raid0 and -m single > > > > As for -draid0 and -dsingle, but for metadata instead of data. > > > >> My understanding is that raidX should be used in case of multi > >> devices and single/dup should be used in case of single device to > >> allow duplication, but it is not 100% clear to me... > > > >> As btrfs raid concepts are quite different from traditionnal raid, > >> shouldn't we use the words "stripped" and "mirrored" instead of > >> raid0/raid1? or even "single" and "duplicated"? > >> Then there would be no difference between single/raid0 and > >> duplicated/raid1... > > > > But there _are_ differences between them, as explained above. :) > > > > I posted a patch a while ago to change the names to something more > > logical and expressive, but it didn't get merged. > > > > Hugo. > > -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- Nothing right in my left brain. Nothing left in --- my right brain. [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [raidX vs single/dup] 2013-09-26 13:46 ` Hugo Mills @ 2013-09-26 14:55 ` miaou sami 2013-09-26 14:58 ` Hugo Mills 0 siblings, 1 reply; 6+ messages in thread From: miaou sami @ 2013-09-26 14:55 UTC (permalink / raw) To: Hugo Mills; +Cc: linux-btrfs@vger.kernel.org OK, that's clear. Nice space simulator btw :-) you should add a link somewhere in btrfs wiki... Thanks ---------------------------------------- > Date: Thu, 26 Sep 2013 14:46:05 +0100 > From: hugo@carfax.org.uk > To: miaousami@hotmail.com > CC: linux-btrfs@vger.kernel.org > Subject: Re: [raidX vs single/dup] > > On Thu, Sep 26, 2013 at 01:40:57PM +0000, miaou sami wrote: >> Thank you, it is quite clear now. >> >> >> I guess that on multi device, raid0 vs single would be a matter of performance vs ease of low level hardware data recovery. >> >> >> The wiki https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices says: >> "When you have drives with differing sizes and want to use the full capacity of each drive, you have to use the single profile for the data blocks." >> Let's assume the following configuration: 1x10GB disk and 2x5GB disks >> --> Does it mean I cannot use the full capacity AND have a duplication of my data in the configuration above? (full capacity would be 10GB here) > > No, that will give you the full usable space. A 20 GB drive and two > 5 GB drives would not, though. > >> --> If I try to setup either -d raid1 or -d dup on that >> configuration, what will I get? > > Try it for yourself in the space simulator: > > http://carfax.org.uk/btrfs-usage/ > >> --> Is there any behavior difference between raid1 / dup in that case? > > If you have multiple disks, I think DUP gets automatically upgraded > to RAID-1 (i.e. the "different copies on different devices" > requirement is enforced). So, no. > >> --> Can raid1 ensure that data are always duplicated on different devices AND take advantage of all available space? > > Depends on the relative sizes of the devices. If your largest > device is bigger than the rest put together, then you'll lose some > space. > > Hugo. > >> Regards, >> Sam >> >> >> ---------------------------------------- >>> Date: Thu, 26 Sep 2013 13:32:33 +0100 >>> From: hugo@carfax.org.uk >>> To: miaousami@hotmail.com >>> CC: linux-btrfs@vger.kernel.org >>> Subject: Re: [raidX vs single/dup] >>> >>> On Thu, Sep 26, 2013 at 12:22:49PM +0000, miaou sami wrote: >>>> Hi btrfs guys, >>>> >>>> could someone explain to me the differences in mkfs.btrfs: >>>> >>>> - between -d raid0 and -d single >>> >>> In RAID0, data is striped across all the devices, so the first 64k >>> of a file will go on device 1, the next 64k will go on device 2, and >>> so on. With single, files are allocated linearly on one device. >>> >>> (This is assuming smallish files, a filesystem with lots of space. >>> Even with single, files can still end up being scattered around over >>> multiple devices -- but with RAID0, even non-fragmented files are >>> striped) >>> >>>> - between -m raid1 and -m dup >>> >>> In both cases, there are two copies of each metadata block. With >>> RAID1, it *requires* the two copies to live on different devices. With >>> DUP, it allows the two copies to live on the same device (e.g. if >>> there's only one device). >>> >>>> - between -m raid0 and -m single >>> >>> As for -draid0 and -dsingle, but for metadata instead of data. >>> >>>> My understanding is that raidX should be used in case of multi >>>> devices and single/dup should be used in case of single device to >>>> allow duplication, but it is not 100% clear to me... >>> >>>> As btrfs raid concepts are quite different from traditionnal raid, >>>> shouldn't we use the words "stripped" and "mirrored" instead of >>>> raid0/raid1? or even "single" and "duplicated"? >>>> Then there would be no difference between single/raid0 and >>>> duplicated/raid1... >>> >>> But there _are_ differences between them, as explained above. :) >>> >>> I posted a patch a while ago to change the names to something more >>> logical and expressive, but it didn't get merged. >>> >>> Hugo. >>> > > -- > === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === > PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk > --- Nothing right in my left brain. Nothing left in --- > my right brain. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [raidX vs single/dup] 2013-09-26 14:55 ` miaou sami @ 2013-09-26 14:58 ` Hugo Mills 0 siblings, 0 replies; 6+ messages in thread From: Hugo Mills @ 2013-09-26 14:58 UTC (permalink / raw) To: miaou sami; +Cc: linux-btrfs@vger.kernel.org [-- Attachment #1: Type: text/plain, Size: 4483 bytes --] On Thu, Sep 26, 2013 at 02:55:38PM +0000, miaou sami wrote: > OK, that's clear. > Nice space simulator btw :-) you should add a link somewhere in btrfs wiki... There is one, linked from the first line of the relevant section in the FAQ. Hugo. > Thanks > ---------------------------------------- > > Date: Thu, 26 Sep 2013 14:46:05 +0100 > > From: hugo@carfax.org.uk > > To: miaousami@hotmail.com > > CC: linux-btrfs@vger.kernel.org > > Subject: Re: [raidX vs single/dup] > > > > On Thu, Sep 26, 2013 at 01:40:57PM +0000, miaou sami wrote: > >> Thank you, it is quite clear now. > >> > >> > >> I guess that on multi device, raid0 vs single would be a matter of performance vs ease of low level hardware data recovery. > >> > >> > >> The wiki https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices says: > >> "When you have drives with differing sizes and want to use the full capacity of each drive, you have to use the single profile for the data blocks." > >> Let's assume the following configuration: 1x10GB disk and 2x5GB disks > >> --> Does it mean I cannot use the full capacity AND have a duplication of my data in the configuration above? (full capacity would be 10GB here) > > > > No, that will give you the full usable space. A 20 GB drive and two > > 5 GB drives would not, though. > > > >> --> If I try to setup either -d raid1 or -d dup on that > >> configuration, what will I get? > > > > Try it for yourself in the space simulator: > > > > http://carfax.org.uk/btrfs-usage/ > > > >> --> Is there any behavior difference between raid1 / dup in that case? > > > > If you have multiple disks, I think DUP gets automatically upgraded > > to RAID-1 (i.e. the "different copies on different devices" > > requirement is enforced). So, no. > > > >> --> Can raid1 ensure that data are always duplicated on different devices AND take advantage of all available space? > > > > Depends on the relative sizes of the devices. If your largest > > device is bigger than the rest put together, then you'll lose some > > space. > > > > Hugo. > > > >> Regards, > >> Sam > >> > >> > >> ---------------------------------------- > >>> Date: Thu, 26 Sep 2013 13:32:33 +0100 > >>> From: hugo@carfax.org.uk > >>> To: miaousami@hotmail.com > >>> CC: linux-btrfs@vger.kernel.org > >>> Subject: Re: [raidX vs single/dup] > >>> > >>> On Thu, Sep 26, 2013 at 12:22:49PM +0000, miaou sami wrote: > >>>> Hi btrfs guys, > >>>> > >>>> could someone explain to me the differences in mkfs.btrfs: > >>>> > >>>> - between -d raid0 and -d single > >>> > >>> In RAID0, data is striped across all the devices, so the first 64k > >>> of a file will go on device 1, the next 64k will go on device 2, and > >>> so on. With single, files are allocated linearly on one device. > >>> > >>> (This is assuming smallish files, a filesystem with lots of space. > >>> Even with single, files can still end up being scattered around over > >>> multiple devices -- but with RAID0, even non-fragmented files are > >>> striped) > >>> > >>>> - between -m raid1 and -m dup > >>> > >>> In both cases, there are two copies of each metadata block. With > >>> RAID1, it *requires* the two copies to live on different devices. With > >>> DUP, it allows the two copies to live on the same device (e.g. if > >>> there's only one device). > >>> > >>>> - between -m raid0 and -m single > >>> > >>> As for -draid0 and -dsingle, but for metadata instead of data. > >>> > >>>> My understanding is that raidX should be used in case of multi > >>>> devices and single/dup should be used in case of single device to > >>>> allow duplication, but it is not 100% clear to me... > >>> > >>>> As btrfs raid concepts are quite different from traditionnal raid, > >>>> shouldn't we use the words "stripped" and "mirrored" instead of > >>>> raid0/raid1? or even "single" and "duplicated"? > >>>> Then there would be no difference between single/raid0 and > >>>> duplicated/raid1... > >>> > >>> But there _are_ differences between them, as explained above. :) > >>> > >>> I posted a patch a while ago to change the names to something more > >>> logical and expressive, but it didn't get merged. > >>> > >>> Hugo. > >>> > > -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- The trouble with you, Ibid, is you think you know everything. --- [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 828 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-26 14:58 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-09-26 12:22 [raidX vs single/dup] miaou sami 2013-09-26 12:32 ` Hugo Mills 2013-09-26 13:40 ` miaou sami 2013-09-26 13:46 ` Hugo Mills 2013-09-26 14:55 ` miaou sami 2013-09-26 14:58 ` Hugo Mills
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).