how to find out total capacity and raid level of btrfs file system

2010-07-31 Thread Michael Kofler
I know df does not report the correct size for btrfs raid systems. Is 
there any other way to find out the total capacity of a btrfs file 
system? Or at least the raid level for data / metadata?


My test system is Ubuntu 10.10 alpha with btrfs 0.19 and a 2.6.35 kernel 
(don't know which rc).


# uname -a
Linux ubuntu 2.6.35-12-generic #17-Ubuntu SMP Mon Jul 26 18:48:06 UTC 
2010 x86_64 GNU/Linux



I created a raid1 system consisting of two 8GB devices (so total 
capacity would be 8 GB for system + metadata + data)


# mkfs.btrfs -d raid1 -m raid1 /dev/sdb1 /dev/sdc1
# mount /dev/sdb1 /media/btrfs

Now I gather all information I can with btrfs:

# btrfs filesystem show /dev/sdb1
Label: none  uuid: dc691a5d-187e-4cb4-a94a-d12dabdffde4
Total devices 2 FS bytes used 28.00KB
devid1 size 8.00GB used 2.03GB path /dev/sdb1
devid2 size 8.00GB used 2.01GB path /dev/sdc1
# btrfs filesystem df /media/btrfs/
Data: total=1.01GB, used=0.00
Metadata: total=1.01GB, used=24.00KB
System:   total=12.00MB, used=4.00KB

Is there a way to find out how devid 1 and devid 2 are used (i.e. which 
raid level)?


Is there a btrfs command to get the total capacity of my filesystem? (In 
my case, it should report total 8 GB, of which 2.03 GB have already been 
claimed for data + metadata, another 5.97 GB are free. It might also say 
6,97 GB for data are still available.)


Thank you,


Michael Kofler
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: wanted X found X-1 but you got X-2

2010-07-31 Thread Adi
ok, i have tried the 2.6.35-rc6 kernel, as TiCPU on #btrfs suggested, but i 
also got an error. i don't think it has something to do with kcrypt, as i can 
mount another partition without any problems.

hm, and btw, that dump was made on another pc.

here is a dmesg-dump:

***
device fsid 184f65b363e9d585-fc67ce9a295b44a3 devid 1 transid 103380 
/dev/mapper/vg2-root
parent transid verify failed on 5403553792 wanted 103380 found 103378
[ cut here ]
kernel BUG at fs/btrfs/async-thread.c:603!
invalid opcode:  [#1] PREEMPT 
last sysfs file: /sys/devices/virtual/block/dm-1/dm/name
Modules linked in: btrfs

Pid: 12496, comm: kcryptd Not tainted 2.6.35-rc6 #1 MS-6382/8366-8233
EIP: 0060:[f0de865b] EFLAGS: 00010046 CPU: 0
EIP is at btrfs_queue_worker+0x30b/0x320 [btrfs]
EAX:  EBX: e2257b0c ECX: e2257b28 EDX: 0003
ESI: 0246 EDI: e2257b30 EBP: ee64bd00 ESP: e231bf54
 DS: 007b ES: 007b FS:  GS:  SS: 0068
Process kcryptd (pid: 12496, ti=e231a000 task=e21a77f0 task.ti=e231a000)
Stack:
 e2257b28 e2257b30 ee64bd00 dc72d61c ef239560 ef239560 c13fc670 c10d99e1
0 c10d99e1 c10d99e1 c1041032 e21a796c c1040f40  c156d3ab e21a77f0
0 ef239568 e21a77f0 e21a77f0 e21a79c8  e21a77f0 c10448d0 e231bfb0
Call Trace:
 [c13fc670] ? kcryptd_crypt+0x0/0x360
 [c10d99e1] ? bio_endio+0x11/0x30
 [c10d99e1] ? bio_endio+0x11/0x30
 [c10d99e1] ? bio_endio+0x11/0x30
 [c1041032] ? worker_thread+0xf2/0x230
 [c1040f40] ? worker_thread+0x0/0x230
 [c156d3ab] ? schedule+0x1ab/0x4c0
 [c10448d0] ? autoremove_wake_function+0x0/0x40
 [c1040f40] ? worker_thread+0x0/0x230
 [c10444f4] ? kthread+0x74/0x80
 [c1044480] ? kthread+0x0/0x80
 [c1002fb6] ? kernel_thread_helper+0x6/0x10
Code: 30 83 c3 2c 89 5d 1c 89 45 20 89 10 e9 47 ff ff ff 8d b4 26 00 00 00 00 
8b 6c 24 08 e9 f0 fe ff ff e8 ca 51 78 d0 e9 74 fd ff ff 0f 0b 8d 76 00 eb fb 
e8 b9 51 78 d0 e9 06 fe ff ff 8d 74 26 00 
EIP: [f0de865b] btrfs_queue_worker+0x30b/0x320 [btrfs] SS:ESP 0068:e231bf54
---[ end trace 8e44f3e11659c3d0 ]---
note: kcryptd[12496] exited with preempt_count 1



 Original-Nachricht 
 hi,
 
 i used a current stable gentoo with a 2.6.34-r2 gentoo-kernel. the btrfs
 filesystem is on a lvm, which is on a luks-partition.
 i think i corrupted the filesystem with a 2.6.34 tuxonice kernel, witch
 ran fine without suspend-to-disk, but after suspending i couldn't reboot
 anymore.
 this debug is made on a sysrescuecd 1.5.8, after i try to btrfsck it. if i
 try to mount it, the terminal hangs, but i can switch to another.
 would it help if i copy some data off the filesystem?
 
 ciao, adi
 
  On 07/29/2010 09:11 PM, Adi wrote:
   hi,
   i have a problem with mounting a btrfspartition. i think it corrupted
  somehow. btrfsck also didn't work.
   here is the demesg output, if i try to btrfsck it:
  
 
  
  Hi, Adi
  
  can you give us some steps with which the bug can be reproduced?
  
  Thanks,
  liubo
  
  
   ***
  
   device-mapper: ioctl: unable to remove open device
  temporary-cryptsetup-2466
   device fsid 184f65b363e9d585-fc67ce9a295b44a3 devid 1 transid 103380
  /dev/dm-1
   end_request: I/O error, dev fd0, sector 0
   device fsid 184f65b363e9d585-fc67ce9a295b44a3 devid 1 transid 103380
  /dev/mapper/vg2-root
   parent transid verify failed on 5403553792 wanted 103380 found 103378
   [ cut here ]
   kernel BUG at fs/btrfs/async-thread.c:602!
   invalid opcode:  [#1] SMP 
   last sysfs file: /sys/devices/virtual/bdi/btrfs-1/uevent
   Modules linked in: sha256_generic serpent dm_crypt ipv6 arc4 ecb ath5k
  cm4000_cs ppdev mac80211 iTCO_wdt iTCO_vendor_support parport_pc ath
 video
  thinkpad_acpi yenta_socket parport i2c_i801 output rsrc_nonstatic
 cfg80211
  joydev i2c_core pcspkr rfkill raid10 raid456 async_raid6_recov async_pq
  raid6_pq async_xor xor async_memcpy async_tx raid1 raid0 multipath
 linear e100
  mii floppy
  
   Pid: 2501, comm: kcryptd Not tainted 2.6.34.01-alt158-i386 #2
  2373189/2373189
   EIP: 0060:[c06cee9a] EFLAGS: 00010046 CPU: 0
   EIP is at btrfs_queue_worker+0xe7/0x1f8
   EAX:  EBX: f53ea04c ECX:  EDX: 
   ESI:  EDI: f63bc5c0 EBP: f51e7e34 ESP: f51e7e14
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
   Process kcryptd (pid: 2501, ti=f51e6000 task=f51e9520
 task.ti=f51e6000)
   Stack:
0206 f53ea070 0246 f53ea068 f53ea088 f53e8000 f516cd60
 
   0 f51e7e40 c06abcc1 f520b850 f51e7e48 c04e804e f51e7e64 c0851a40
  
   0 f526df80 f526dc80  f5365790 f51e7e84 c0851bb5 f520b850
  f5214000
   Call Trace:
[c06abcc1] ? end_workqueue_bio+0x56/0x59
[c04e804e] ? bio_endio+0x22/0x24
[c0851a40] ? dec_pending+0x124/0x12b
[c0851bb5] ? clone_endio+0x96/0x9e
[c04e804e] ? bio_endio+0x22/0x24
[c0851a40] ? dec_pending+0x124/0x12b
[c0851bb5] ? clone_endio+0x96/0x9e
[c04e804e] ? 

unable to replace defect raid1 device

2010-07-31 Thread Michael Kofler

on Ubuntu 10.10 alpha with btrfs 0.19 and a 2.6.35
(2.6.35-12-generic #17-Ubuntu SMP Mon Jul 26 18:48:06)

I created a btrfs raid 1 system:

# mkfs.btrfs -d raid1 -m raid1 /dev/sdb1 /dev/sdc1

Then I rebooted without disk 3 (/dev/sdc). I was able to mount the btrfs 
with mount -o degraded.


However, I was not able to remove the defect device.

# btrfs device delete /dev/sdc1
ERROR: error removing the device '/dev/sdc1'
# dmesg | tail
...
[  110.524145] btrfs: allowing degraded mounts
[  439.104487] btrfs: unable to go below two devices on raid1

I was able to add a new device (again /dev/sdc1, but on another disk), 
but apparently it was not used as a raid1 device:


# btrfs de add /dev/sdc1 /media/btrfs/
# btrfs fi sh
Label: none  uuid: dc691a5d-187e-4cb4-a94a-d12dabdffde4
Total devices 3 FS bytes used 3.76GB
devid1 size 8.00GB used 5.35GB path /dev/sdb1
devid3 size 8.00GB used 0.00 path /dev/sdc1
*** Some devices missing

Is there a way to replace a defect raid1 device as with mdadm?
Or is this not yet implemented in btrfs?

Best wishes,

Michael Kofler
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: unable to replace defect raid1 device

2010-07-31 Thread C Anthony Risinger
Try to add replacement, rebalance, then remove missing

C Anthony [mobile]

On Jul 31, 2010, at 2:04 PM, Michael Kofler mich...@kofler.info wrote:

 on Ubuntu 10.10 alpha with btrfs 0.19 and a 2.6.35
 (2.6.35-12-generic #17-Ubuntu SMP Mon Jul 26 18:48:06)

 I created a btrfs raid 1 system:

 # mkfs.btrfs -d raid1 -m raid1 /dev/sdb1 /dev/sdc1

 Then I rebooted without disk 3 (/dev/sdc). I was able to mount the
 btrfs with mount -o degraded.

 However, I was not able to remove the defect device.

 # btrfs device delete /dev/sdc1
 ERROR: error removing the device '/dev/sdc1'
 # dmesg | tail
 ...
 [  110.524145] btrfs: allowing degraded mounts
 [  439.104487] btrfs: unable to go below two devices on raid1

 I was able to add a new device (again /dev/sdc1, but on another
 disk), but apparently it was not used as a raid1 device:

 # btrfs de add /dev/sdc1 /media/btrfs/
 # btrfs fi sh
 Label: none  uuid: dc691a5d-187e-4cb4-a94a-d12dabdffde4
Total devices 3 FS bytes used 3.76GB
devid1 size 8.00GB used 5.35GB path /dev/sdb1
devid3 size 8.00GB used 0.00 path /dev/sdc1
*** Some devices missing

 Is there a way to replace a defect raid1 device as with mdadm?
 Or is this not yet implemented in btrfs?

 Best wishes,

Michael Kofler
 --
 To unsubscribe from this list: send the line unsubscribe linux-
 btrfs in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-btrfs in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html