* A bug with multiple devices?
@ 2008-12-30 1:44 Shen Feng
2008-12-30 10:45 ` Chris Samuel
2008-12-31 1:11 ` Shen Feng
0 siblings, 2 replies; 12+ messages in thread
From: Shen Feng @ 2008-12-30 1:44 UTC (permalink / raw)
To: linux-btrfs
Hi,
I create a raid-1 btrfs with the following command.
[root@localhost ~]# fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb44829ea
Device Boot Start End Blocks Id System
/dev/sdb1 1 4863 39062016 83 Linux
/dev/sdb2 4864 9726 39062047+ 83 Linux
/dev/sdb3 9727 38905 234375905+ f W95 Ext'd (LBA)
/dev/sdb5 9727 14590 39063374 83 Linux
/dev/sdb6 14590 19453 39068690+ 7 HPFS/NTFS
/dev/sdb7 19454 29178 78116031 83 Linux
/dev/sdb8 29179 31610 19535008+ 83 Linux
/dev/sdb9 31611 34041 19526976 83 Linux
/dev/sdb10 34042 36473 19535008+ 83 Linux
/dev/sdb11 36474 38904 19526976 83 Linux
[root@localhost ~]# mkfs.btrfs -m raid1 /dev/sdb8 /dev/sdb9 /dev/sdb10 /dev/sdb11
adding device /dev/sdb9 id 2
adding device /dev/sdb10 id 3
adding device /dev/sdb11 id 4
fs created label (null) on /dev/sdb8
nodesize 4096 leafsize 4096 sectorsize 4096 size 74.50GB
Btrfs v0.16-29-g0d53b21
[root@localhost ~]# mount -t btrfs /dev/sdb8 /mnt/btrfs[root@localhost ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
...
/dev/sdb8 78123968 28 78123940 1% /mnt/btrfs
I think the partition size is no correct since this is a raid-1 partition.
The size should be half.
Is this a bug?
-Shen
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-30 1:44 A bug with multiple devices? Shen Feng
@ 2008-12-30 10:45 ` Chris Samuel
2008-12-30 11:14 ` Chris Samuel
2008-12-30 11:35 ` Yan Zheng
2008-12-31 1:11 ` Shen Feng
1 sibling, 2 replies; 12+ messages in thread
From: Chris Samuel @ 2008-12-30 10:45 UTC (permalink / raw)
To: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 903 bytes --]
On Tue, 30 Dec 2008 12:44:38 pm Shen Feng wrote:
> I think the partition size is no correct since this is a raid-1 partition.
> The size should be half.
I've just run into this myself and so can confirm this issue on a btrfs
filesystem with 2 devices, where it is created by doing:
mkfs.btrfs -m raid1 /dev/sda10 /dev/sda11
modprobe btrfs
btrfsctl -a
mount /dev/sda10 /home
The df command shows it has twice the space I was expecting (61GB rather than
30GB). The btrfs-show command shows that it has two devices but doesn't
appear to contain any way to show the RAID level implemented. I get the
same outcome if I mount /dev/sda11 instead of sda10.
Any ideas ?
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
This email may come with a PGP signature as a file. Do not panic.
For more info see: http://en.wikipedia.org/wiki/OpenPGP
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 481 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-30 10:45 ` Chris Samuel
@ 2008-12-30 11:14 ` Chris Samuel
2008-12-30 21:19 ` Chris Mason
2008-12-30 11:35 ` Yan Zheng
1 sibling, 1 reply; 12+ messages in thread
From: Chris Samuel @ 2008-12-30 11:14 UTC (permalink / raw)
To: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 745 bytes --]
On Tue, 30 Dec 2008 9:45:22 pm Chris Samuel wrote:
> mkfs.btrfs -m raid1 /dev/sda10 /dev/sda11
Even doing what appears to be the correct method of:
mkfs.btrfs -d raid1 -m raid1 /dev/sda10 /dev/sda11
doesn't give any love, mkfs.btrfs still tells me the filesystem will be 60GB
(and the kernel agrees when it is mounted).
But mkfs.btrfs does correctly set data_profile to include
BTRFS_BLOCK_GROUP_RAID1 and does indeed call create_one_raid_group() with
BTRFS_BLOCK_GROUP_DATA in create_raid_groups() in mkfs.c.
cheers,
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
This email may come with a PGP signature as a file. Do not panic.
For more info see: http://en.wikipedia.org/wiki/OpenPGP
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 481 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-30 10:45 ` Chris Samuel
2008-12-30 11:14 ` Chris Samuel
@ 2008-12-30 11:35 ` Yan Zheng
2008-12-30 12:03 ` Chris Samuel
2008-12-30 12:19 ` Chris Samuel
1 sibling, 2 replies; 12+ messages in thread
From: Yan Zheng @ 2008-12-30 11:35 UTC (permalink / raw)
To: Chris Samuel; +Cc: linux-btrfs
2008/12/30 Chris Samuel <chris@csamuel.org>:
> On Tue, 30 Dec 2008 12:44:38 pm Shen Feng wrote:
>
>> I think the partition size is no correct since this is a raid-1 partition.
>> The size should be half.
>
> I've just run into this myself and so can confirm this issue on a btrfs
> filesystem with 2 devices, where it is created by doing:
>
> mkfs.btrfs -m raid1 /dev/sda10 /dev/sda11
>
> modprobe btrfs
>
> btrfsctl -a
>
> mount /dev/sda10 /home
>
> The df command shows it has twice the space I was expecting (61GB rather than
> 30GB). The btrfs-show command shows that it has two devices but doesn't
> appear to contain any way to show the RAID level implemented. I get the
> same outcome if I mount /dev/sda11 instead of sda10.
>
> Any ideas ?
>
This is a known bug. In btrfs, chunks are created dynamically and may have
different RAID configurations. So it's difficult to compute the space
in advance.
Regards
Yan Zheng
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-30 11:35 ` Yan Zheng
@ 2008-12-30 12:03 ` Chris Samuel
2008-12-30 12:19 ` Chris Samuel
1 sibling, 0 replies; 12+ messages in thread
From: Chris Samuel @ 2008-12-30 12:03 UTC (permalink / raw)
To: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 509 bytes --]
On Tue, 30 Dec 2008 10:35:17 pm Yan Zheng wrote:
> This is a known bug. In btrfs, chunks are created dynamically and may have
> different RAID configurations. So it's difficult to compute the space
> in advance.
Thanks Yan!
So mkfs.btrfs -d raid1 just sets the default value ?
All the best,
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
This email may come with a PGP signature as a file. Do not panic.
For more info see: http://en.wikipedia.org/wiki/OpenPGP
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 481 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-30 11:35 ` Yan Zheng
2008-12-30 12:03 ` Chris Samuel
@ 2008-12-30 12:19 ` Chris Samuel
1 sibling, 0 replies; 12+ messages in thread
From: Chris Samuel @ 2008-12-30 12:19 UTC (permalink / raw)
To: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
On Tue, 30 Dec 2008 10:35:17 pm Yan Zheng wrote:
> So it's difficult to compute the space in advance.
One thought would be to choose the most conservative RAID configuration for the
number of devices in the system. But then you have the opposite issue of
potentially showing too little space in some situations.
But my guess is that for most (>50%) people once they set a default RAID level
then most will have everything in that state.
cheers,
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
This email may come with a PGP signature as a file. Do not panic.
For more info see: http://en.wikipedia.org/wiki/OpenPGP
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 481 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-30 11:14 ` Chris Samuel
@ 2008-12-30 21:19 ` Chris Mason
0 siblings, 0 replies; 12+ messages in thread
From: Chris Mason @ 2008-12-30 21:19 UTC (permalink / raw)
To: Chris Samuel; +Cc: linux-btrfs
On Tue, 2008-12-30 at 22:14 +1100, Chris Samuel wrote:
> On Tue, 30 Dec 2008 9:45:22 pm Chris Samuel wrote:
>
> > mkfs.btrfs -m raid1 /dev/sda10 /dev/sda11
>
> Even doing what appears to be the correct method of:
>
> mkfs.btrfs -d raid1 -m raid1 /dev/sda10 /dev/sda11
>
> doesn't give any love, mkfs.btrfs still tells me the filesystem will be 60GB
> (and the kernel agrees when it is mounted).
>
> But mkfs.btrfs does correctly set data_profile to include
> BTRFS_BLOCK_GROUP_RAID1 and does indeed call create_one_raid_group() with
> BTRFS_BLOCK_GROUP_DATA in create_raid_groups() in mkfs.c.
This is one of those things I've left for later.
Basically df tells you the total storage in the FS. This storage might
be raid0, raid1 or single spindle duplication, so the usable space may
be different from the total storage.
In the future we'll have the data sent to df give better estimates of
usable space.
Changing btrfs-show to show the chunks too is a good idea.
-chris
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-30 1:44 A bug with multiple devices? Shen Feng
2008-12-30 10:45 ` Chris Samuel
@ 2008-12-31 1:11 ` Shen Feng
2008-12-31 1:17 ` Liu Hui
1 sibling, 1 reply; 12+ messages in thread
From: Shen Feng @ 2008-12-31 1:11 UTC (permalink / raw)
To: linux-btrfs
on 12/30/2008 09:44 AM, Shen Feng wrote:
> Hi,
>
> I create a raid-1 btrfs with the following command.
>
> [root@localhost ~]# fdisk -l /dev/sdb
>
> Disk /dev/sdb: 320.0 GB, 320072933376 bytes
> 255 heads, 63 sectors/track, 38913 cylinders
> Units = cylinders of 16065 * 512 = 8225280 bytes
> Disk identifier: 0xb44829ea
>
> Device Boot Start End Blocks Id System
> /dev/sdb1 1 4863 39062016 83 Linux
> /dev/sdb2 4864 9726 39062047+ 83 Linux
> /dev/sdb3 9727 38905 234375905+ f W95 Ext'd (LBA)
> /dev/sdb5 9727 14590 39063374 83 Linux
> /dev/sdb6 14590 19453 39068690+ 7 HPFS/NTFS
> /dev/sdb7 19454 29178 78116031 83 Linux
> /dev/sdb8 29179 31610 19535008+ 83 Linux
> /dev/sdb9 31611 34041 19526976 83 Linux
> /dev/sdb10 34042 36473 19535008+ 83 Linux
> /dev/sdb11 36474 38904 19526976 83 Linux
>
> [root@localhost ~]# mkfs.btrfs -m raid1 /dev/sdb8 /dev/sdb9 /dev/sdb10 /dev/sdb11
> adding device /dev/sdb9 id 2
> adding device /dev/sdb10 id 3
> adding device /dev/sdb11 id 4
> fs created label (null) on /dev/sdb8
> nodesize 4096 leafsize 4096 sectorsize 4096 size 74.50GB
> Btrfs v0.16-29-g0d53b21
>
> [root@localhost ~]# mount -t btrfs /dev/sdb8 /mnt/btrfs[root@localhost ~]# df
> Filesystem 1K-blocks Used Available Use% Mounted on
> ...
> /dev/sdb8 78123968 28 78123940 1% /mnt/btrfs
>
More test:
[root@localhost btrfs]# df -h /dev/sdb8
Filesystem Size Used Avail Use% Mounted on
/dev/sdb8 75G 28K 75G 1% /mnt/btrfs
[root@localhost btrfs]# dd if=/dev/zero of=/mnt/btrfs/file bs=1024 count=1024
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.0481317 s, 21.8 MB/s
[root@localhost btrfs]# sync
[root@localhost btrfs]# df -h /dev/sdb8
Filesystem Size Used Avail Use% Mounted on
/dev/sdb8 75G 1.1M 75G 1% /mnt/btrfs
With raid-1, the used space may be double (about 2.2M), I think.
> I think the partition size is no correct since this is a raid-1 partition.
> The size should be half.
> Is this a bug?
>
> -Shen
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Best Regards,
--------------------------------------------------
Shen Feng
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
8/F., Civil Defense Building, No.189 Guangzhou Road,
Nanjing, 210029, China
PHONE: +86-25-86630566-950
COINS: 79955-950
FAX: +86-25-83317685
MAIL: shen@cn.fujitsu.com
-------------------------------------------------
This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-31 1:11 ` Shen Feng
@ 2008-12-31 1:17 ` Liu Hui
2008-12-31 1:43 ` Shen Feng
2008-12-31 3:30 ` Shen Feng
0 siblings, 2 replies; 12+ messages in thread
From: Liu Hui @ 2008-12-31 1:17 UTC (permalink / raw)
To: Shen Feng; +Cc: linux-btrfs
mkfs.btrfs -m raid1 just means 'meta data' works as raid1
You should try mkfs.btrfs -d raid1
This maybe help:
mkfs.btrfs [-A <offset>] [-b <size>] [-l <size>] [-n <size>] [-l
<label>] [-s <size>] [-m raid0|raid1|raid10|single] [-d
raid0|raid1|raid10|single] <device>
2008/12/31 Shen Feng <shen@cn.fujitsu.com>:
>
>
> on 12/30/2008 09:44 AM, Shen Feng wrote:
>> Hi,
>>
>> I create a raid-1 btrfs with the following command.
>>
>> [root@localhost ~]# fdisk -l /dev/sdb
>>
>> Disk /dev/sdb: 320.0 GB, 320072933376 bytes
>> 255 heads, 63 sectors/track, 38913 cylinders
>> Units = cylinders of 16065 * 512 = 8225280 bytes
>> Disk identifier: 0xb44829ea
>>
>> Device Boot Start End Blocks Id System
>> /dev/sdb1 1 4863 39062016 83 Linux
>> /dev/sdb2 4864 9726 39062047+ 83 Linux
>> /dev/sdb3 9727 38905 234375905+ f W95 Ext'd (LBA)
>> /dev/sdb5 9727 14590 39063374 83 Linux
>> /dev/sdb6 14590 19453 39068690+ 7 HPFS/NTFS
>> /dev/sdb7 19454 29178 78116031 83 Linux
>> /dev/sdb8 29179 31610 19535008+ 83 Linux
>> /dev/sdb9 31611 34041 19526976 83 Linux
>> /dev/sdb10 34042 36473 19535008+ 83 Linux
>> /dev/sdb11 36474 38904 19526976 83 Linux
>>
>> [root@localhost ~]# mkfs.btrfs -m raid1 /dev/sdb8 /dev/sdb9 /dev/sdb10 /dev/sdb11
>> adding device /dev/sdb9 id 2
>> adding device /dev/sdb10 id 3
>> adding device /dev/sdb11 id 4
>> fs created label (null) on /dev/sdb8
>> nodesize 4096 leafsize 4096 sectorsize 4096 size 74.50GB
>> Btrfs v0.16-29-g0d53b21
>>
>> [root@localhost ~]# mount -t btrfs /dev/sdb8 /mnt/btrfs[root@localhost ~]# df
>> Filesystem 1K-blocks Used Available Use% Mounted on
>> ...
>> /dev/sdb8 78123968 28 78123940 1% /mnt/btrfs
>>
>
> More test:
>
> [root@localhost btrfs]# df -h /dev/sdb8
> Filesystem Size Used Avail Use% Mounted on
> /dev/sdb8 75G 28K 75G 1% /mnt/btrfs
> [root@localhost btrfs]# dd if=/dev/zero of=/mnt/btrfs/file bs=1024 count=1024
> 1024+0 records in
> 1024+0 records out
> 1048576 bytes (1.0 MB) copied, 0.0481317 s, 21.8 MB/s
> [root@localhost btrfs]# sync
> [root@localhost btrfs]# df -h /dev/sdb8
> Filesystem Size Used Avail Use% Mounted on
> /dev/sdb8 75G 1.1M 75G 1% /mnt/btrfs
>
> With raid-1, the used space may be double (about 2.2M), I think.
>
>
>
>> I think the partition size is no correct since this is a raid-1 partition.
>> The size should be half.
>> Is this a bug?
>>
>> -Shen
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>>
>
> --
> Best Regards,
> --------------------------------------------------
> Shen Feng
> Development Dept.I
> Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
> 8/F., Civil Defense Building, No.189 Guangzhou Road,
> Nanjing, 210029, China
> PHONE: +86-25-86630566-950
> COINS: 79955-950
> FAX: +86-25-83317685
> MAIL: shen@cn.fujitsu.com
> -------------------------------------------------
> This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Thanks & Best Regards
Liu Hui
--
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-31 1:17 ` Liu Hui
@ 2008-12-31 1:43 ` Shen Feng
2009-01-01 0:52 ` Chris Samuel
2008-12-31 3:30 ` Shen Feng
1 sibling, 1 reply; 12+ messages in thread
From: Shen Feng @ 2008-12-31 1:43 UTC (permalink / raw)
To: Liu Hui; +Cc: linux-btrfs
on 12/31/2008 09:17 AM, Liu Hui wrote:
> mkfs.btrfs -m raid1 just means 'meta data' works as raid1
>
> You should try mkfs.btrfs -d raid1
>
> This maybe help:
> mkfs.btrfs [-A <offset>] [-b <size>] [-l <size>] [-n <size>] [-l
> <label>] [-s <size>] [-m raid0|raid1|raid10|single] [-d
> raid0|raid1|raid10|single] <device>
Thanks.
The problem still exists with -d option.
[root@localhost ~]# mkfs.btrfs -m raid1 -d raid1 /dev/sdb8 /dev/sdb9 /dev/sdb10 /dev/sdb11
adding device /dev/sdb9 id 2
adding device /dev/sdb10 id 3
adding device /dev/sdb11 id 4
fs created label (null) on /dev/sdb8
nodesize 4096 leafsize 4096 sectorsize 4096 size 74.50GB
Btrfs v0.16-29-g0d53b21
[root@localhost ~]# btrfsctl -a
Scanning for Btrfs filesystems
[root@localhost ~]# mount -t btrfs /dev/sdb8 /mnt/btrfs
[root@localhost ~]# df -h /dev/sdb8
Filesystem Size Used Avail Use% Mounted on
/dev/sdb8 75G 28K 75G 1% /mnt/btrfs
[root@localhost ~]# dd if=/dev/zero of=/mnt/btrfs/file bs=1024 count=1024
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.0199063 s, 52.7 MB/s
[root@localhost ~]# sync
[root@localhost ~]# df -h /dev/sdb8
Filesystem Size Used Avail Use% Mounted on
/dev/sdb8 75G 1.1M 75G 1% /mnt/btrfs
>
> 2008/12/31 Shen Feng <shen@cn.fujitsu.com>:
>>
>> on 12/30/2008 09:44 AM, Shen Feng wrote:
>>> Hi,
>>>
>>> I create a raid-1 btrfs with the following command.
>>>
>>> [root@localhost ~]# fdisk -l /dev/sdb
>>>
>>> Disk /dev/sdb: 320.0 GB, 320072933376 bytes
>>> 255 heads, 63 sectors/track, 38913 cylinders
>>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>> Disk identifier: 0xb44829ea
>>>
>>> Device Boot Start End Blocks Id System
>>> /dev/sdb1 1 4863 39062016 83 Linux
>>> /dev/sdb2 4864 9726 39062047+ 83 Linux
>>> /dev/sdb3 9727 38905 234375905+ f W95 Ext'd (LBA)
>>> /dev/sdb5 9727 14590 39063374 83 Linux
>>> /dev/sdb6 14590 19453 39068690+ 7 HPFS/NTFS
>>> /dev/sdb7 19454 29178 78116031 83 Linux
>>> /dev/sdb8 29179 31610 19535008+ 83 Linux
>>> /dev/sdb9 31611 34041 19526976 83 Linux
>>> /dev/sdb10 34042 36473 19535008+ 83 Linux
>>> /dev/sdb11 36474 38904 19526976 83 Linux
>>>
>>> [root@localhost ~]# mkfs.btrfs -m raid1 /dev/sdb8 /dev/sdb9 /dev/sdb10 /dev/sdb11
>>> adding device /dev/sdb9 id 2
>>> adding device /dev/sdb10 id 3
>>> adding device /dev/sdb11 id 4
>>> fs created label (null) on /dev/sdb8
>>> nodesize 4096 leafsize 4096 sectorsize 4096 size 74.50GB
>>> Btrfs v0.16-29-g0d53b21
>>>
>>> [root@localhost ~]# mount -t btrfs /dev/sdb8 /mnt/btrfs[root@localhost ~]# df
>>> Filesystem 1K-blocks Used Available Use% Mounted on
>>> ...
>>> /dev/sdb8 78123968 28 78123940 1% /mnt/btrfs
>>>
>> More test:
>>
>> [root@localhost btrfs]# df -h /dev/sdb8
>> Filesystem Size Used Avail Use% Mounted on
>> /dev/sdb8 75G 28K 75G 1% /mnt/btrfs
>> [root@localhost btrfs]# dd if=/dev/zero of=/mnt/btrfs/file bs=1024 count=1024
>> 1024+0 records in
>> 1024+0 records out
>> 1048576 bytes (1.0 MB) copied, 0.0481317 s, 21.8 MB/s
>> [root@localhost btrfs]# sync
>> [root@localhost btrfs]# df -h /dev/sdb8
>> Filesystem Size Used Avail Use% Mounted on
>> /dev/sdb8 75G 1.1M 75G 1% /mnt/btrfs
>>
>> With raid-1, the used space may be double (about 2.2M), I think.
>>
>>
>>
>>> I think the partition size is no correct since this is a raid-1 partition.
>>> The size should be half.
>>> Is this a bug?
>>>
>>> -Shen
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>>
>> --
>> Best Regards,
>> --------------------------------------------------
>> Shen Feng
>> Development Dept.I
>> Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
>> 8/F., Civil Defense Building, No.189 Guangzhou Road,
>> Nanjing, 210029, China
>> PHONE: +86-25-86630566-950
>> COINS: 79955-950
>> FAX: +86-25-83317685
>> MAIL: shen@cn.fujitsu.com
>> -------------------------------------------------
>> This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
>
>
--
Best Regards,
--------------------------------------------------
Shen Feng
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
8/F., Civil Defense Building, No.189 Guangzhou Road,
Nanjing, 210029, China
PHONE: +86-25-86630566-950
COINS: 79955-950
FAX: +86-25-83317685
MAIL: shen@cn.fujitsu.com
-------------------------------------------------
This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-31 1:17 ` Liu Hui
2008-12-31 1:43 ` Shen Feng
@ 2008-12-31 3:30 ` Shen Feng
1 sibling, 0 replies; 12+ messages in thread
From: Shen Feng @ 2008-12-31 3:30 UTC (permalink / raw)
To: Liu Hui; +Cc: linux-btrfs
on 12/31/2008 09:17 AM, Liu Hui wrote:
> mkfs.btrfs -m raid1 just means 'meta data' works as raid1
>
> You should try mkfs.btrfs -d raid1
>
> This maybe help:
> mkfs.btrfs [-A <offset>] [-b <size>] [-l <size>] [-n <size>] [-l
> <label>] [-s <size>] [-m raid0|raid1|raid10|single] [-d
> raid0|raid1|raid10|single] <device>
Thanks.
I update the usage message of mkfs.btrfs with the following patch.
From: Shen Feng <shen@cn.fujitsu.com>
Improve the the mkfs.btrfs usage message according to
http://btrfs.wiki.kernel.org/index.php/Mkfs.btrfs
Signed-off-by: Shen Feng <shen@cn.fujitsu.com>
---
mkfs.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/mkfs.c b/mkfs.c
index 89de8ac..be93aaa 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -263,9 +263,13 @@ static void print_usage(void)
{
fprintf(stderr, "usage: mkfs.btrfs [options] dev [ dev ... ]\n");
fprintf(stderr, "options:\n");
+ fprintf(stderr, "\t -A --alloc-start the offset to start the FS\n");
fprintf(stderr, "\t -b --byte-count total number of bytes in the FS\n");
+ fprintf(stderr, "\t -d --data data profile, raid0, raid1, raid10 or single\n");
fprintf(stderr, "\t -l --leafsize size of btree leaves\n");
- fprintf(stderr, "\t -n --nodesize size of btree leaves\n");
+ fprintf(stderr, "\t -L --label set a label\n");
+ fprintf(stderr, "\t -m --metadata metadata profile, values like data profile\n");
+ fprintf(stderr, "\t -n --nodesize size of btree nodes\n");
fprintf(stderr, "\t -s --sectorsize min block allocation\n");
fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
exit(1);
-- 1.6.0.6
>
> 2008/12/31 Shen Feng <shen@cn.fujitsu.com>:
>>
>> on 12/30/2008 09:44 AM, Shen Feng wrote:
>>> Hi,
>>>
>>> I create a raid-1 btrfs with the following command.
>>>
>>> [root@localhost ~]# fdisk -l /dev/sdb
>>>
>>> Disk /dev/sdb: 320.0 GB, 320072933376 bytes
>>> 255 heads, 63 sectors/track, 38913 cylinders
>>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>> Disk identifier: 0xb44829ea
>>>
>>> Device Boot Start End Blocks Id System
>>> /dev/sdb1 1 4863 39062016 83 Linux
>>> /dev/sdb2 4864 9726 39062047+ 83 Linux
>>> /dev/sdb3 9727 38905 234375905+ f W95 Ext'd (LBA)
>>> /dev/sdb5 9727 14590 39063374 83 Linux
>>> /dev/sdb6 14590 19453 39068690+ 7 HPFS/NTFS
>>> /dev/sdb7 19454 29178 78116031 83 Linux
>>> /dev/sdb8 29179 31610 19535008+ 83 Linux
>>> /dev/sdb9 31611 34041 19526976 83 Linux
>>> /dev/sdb10 34042 36473 19535008+ 83 Linux
>>> /dev/sdb11 36474 38904 19526976 83 Linux
>>>
>>> [root@localhost ~]# mkfs.btrfs -m raid1 /dev/sdb8 /dev/sdb9 /dev/sdb10 /dev/sdb11
>>> adding device /dev/sdb9 id 2
>>> adding device /dev/sdb10 id 3
>>> adding device /dev/sdb11 id 4
>>> fs created label (null) on /dev/sdb8
>>> nodesize 4096 leafsize 4096 sectorsize 4096 size 74.50GB
>>> Btrfs v0.16-29-g0d53b21
>>>
>>> [root@localhost ~]# mount -t btrfs /dev/sdb8 /mnt/btrfs[root@localhost ~]# df
>>> Filesystem 1K-blocks Used Available Use% Mounted on
>>> ...
>>> /dev/sdb8 78123968 28 78123940 1% /mnt/btrfs
>>>
>> More test:
>>
>> [root@localhost btrfs]# df -h /dev/sdb8
>> Filesystem Size Used Avail Use% Mounted on
>> /dev/sdb8 75G 28K 75G 1% /mnt/btrfs
>> [root@localhost btrfs]# dd if=/dev/zero of=/mnt/btrfs/file bs=1024 count=1024
>> 1024+0 records in
>> 1024+0 records out
>> 1048576 bytes (1.0 MB) copied, 0.0481317 s, 21.8 MB/s
>> [root@localhost btrfs]# sync
>> [root@localhost btrfs]# df -h /dev/sdb8
>> Filesystem Size Used Avail Use% Mounted on
>> /dev/sdb8 75G 1.1M 75G 1% /mnt/btrfs
>>
>> With raid-1, the used space may be double (about 2.2M), I think.
>>
>>
>>
>>> I think the partition size is no correct since this is a raid-1 partition.
>>> The size should be half.
>>> Is this a bug?
>>>
>>> -Shen
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>>
>> --
>> Best Regards,
>> --------------------------------------------------
>> Shen Feng
>> Development Dept.I
>> Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
>> 8/F., Civil Defense Building, No.189 Guangzhou Road,
>> Nanjing, 210029, China
>> PHONE: +86-25-86630566-950
>> COINS: 79955-950
>> FAX: +86-25-83317685
>> MAIL: shen@cn.fujitsu.com
>> -------------------------------------------------
>> This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed.
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
>
>
--
Best Regards,
--------------------------------------------------
Shen Feng
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
8/F., Civil Defense Building, No.189 Guangzhou Road,
Nanjing, 210029, China
PHONE: +86-25-86630566-950
COINS: 79955-950
FAX: +86-25-83317685
MAIL: shen@cn.fujitsu.com
-------------------------------------------------
This communication is for use by the intended recipient(s) only and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not an intended recipient of this communication, you are hereby notified that any dissemination, distribution or copying hereof is strictly prohibited. If you have received this communication in error, please notify me by reply e-mail, permanently delete this communication from your system, and destroy any hard copies you may have printed.
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: A bug with multiple devices?
2008-12-31 1:43 ` Shen Feng
@ 2009-01-01 0:52 ` Chris Samuel
0 siblings, 0 replies; 12+ messages in thread
From: Chris Samuel @ 2009-01-01 0:52 UTC (permalink / raw)
To: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 905 bytes --]
On Wed, 31 Dec 2008 12:43:13 pm Shen Feng wrote:
> The problem still exists with -d option.
As Chris Mason wrote in response to my query on this it's a known issue that's
a consequence of different chunks potentially having different RAID levels.
The RAID level itself does appear to work - I tested it by copying a kernel
image onto it, unmounted it, used debug-tree to work out the offset for it on
one device of the RAID and blew a section away with dd. I remounted it and
verified that the MD5 checksums still agreed with the original and there were
kernel messages complaining about checksum mismatches showing that the damage
had been detected and worked around.
cheers,
Chris
--
Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
This email may come with a PGP signature as a file. Do not panic.
For more info see: http://en.wikipedia.org/wiki/OpenPGP
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 481 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-01-01 0:52 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-30 1:44 A bug with multiple devices? Shen Feng
2008-12-30 10:45 ` Chris Samuel
2008-12-30 11:14 ` Chris Samuel
2008-12-30 21:19 ` Chris Mason
2008-12-30 11:35 ` Yan Zheng
2008-12-30 12:03 ` Chris Samuel
2008-12-30 12:19 ` Chris Samuel
2008-12-31 1:11 ` Shen Feng
2008-12-31 1:17 ` Liu Hui
2008-12-31 1:43 ` Shen Feng
2009-01-01 0:52 ` Chris Samuel
2008-12-31 3:30 ` Shen Feng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox