linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Device only missing if unmounted
@ 2014-12-09 11:15 Florian Uekermann
  2014-12-10  2:46 ` Anand Jain
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Uekermann @ 2014-12-09 11:15 UTC (permalink / raw)
  To: linux-btrfs

I am using a few disks in Raid1 mode. This is the output of various
commands in unmounted state.

root@oot:/# uname -a
Linux oot 3.18.0-rc5+ #1 SMP Sun Nov 23 18:01:56 CET 2014 x86_64 GNU/Linux
root@oot:/# btrfs --version
Btrfs v3.17
root@oot:/# btrfs fi show
Label: none uuid: be2b3499-7452-4b91-b664-4ec4d7ff62b9
Total devices 3 FS bytes used 149.68GiB
devid 2 size 465.76GiB used 151.03GiB path /dev/sdb
devid 3 size 465.76GiB used 151.03GiB path /dev/sda
devid 4 size 92.26GiB used 0.00B path /dev/sdc4

Btrfs v3.17
root@oot:/# btrfs fi df /srv/storage/
Data, RAID1: total=150.00GiB, used=149.40GiB
System, RAID1: total=32.00MiB, used=48.00KiB
Metadata, RAID1: total=1.00GiB, used=287.42MiB
GlobalReserve, single: total=96.00MiB, used=0.00B

I stripped a few lines from the output of btrfs fi show, which
describe other filesystems.
If I unmount the devices in question, I get the following
output (note that missing devices are reported now):

root@oot:/# btrfs fi show
Label: none uuid: be2b3499-7452-4b91-b664-4ec4d7ff62b9
Total devices 4 FS bytes used 149.68GiB
devid 2 size 465.76GiB used 151.03GiB path /dev/sdb
devid 3 size 465.76GiB used 151.03GiB path /dev/sda
devid 4 size 92.26GiB used 0.00B path /dev/sdc4
*** Some devices missing

Btrfs v3.17

I got into this state by removing a device from the array formatting it
and then adding it again (some time ago, I can't remember the exact
sequence of commands)

The discrepancy in output between mounted and unmounted state is not
a problem in itself for me, but this issue seems to interrupt systemds
boot sequence, which only continues successfully if I mount the array manually.
The array is not degraded, I just removed a drive (via btrfs delete I think).

If I try to remove the "missing devices" with the btrfs tool the following
happens:

btrfs dev del missing /srv/storage
ERROR: error removing the device 'missing' - no missing devices found to remove

btrfs balance start /srv/storage/ does not solve the issue.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Device only missing if unmounted
@ 2015-01-11 15:49 Florian Uekermann
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Uekermann @ 2015-01-11 15:49 UTC (permalink / raw)
  To: linux-btrfs; +Cc: linux-btrfs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1390 bytes --]

I wasn't sure when to drop the caches, so I did it before and after mounting. But no change the output of btrfs-show-super always looks the same and btrfs show fi only says "Total devices 4" if the fs is not mounted. After mounting it says 3 and after unmounting it says 4 again.
About the hardware: I am using a normal amd64 consumer Pc with a set of different normal sata disks. The machine is rebooted daily (in case that matters for caches).

To uneducated me, it looks a bit like the btrfs utility is screwing up here when figuring out how many devices should be there. I don't know how closely this is tied to the kernel and how much of the logic is actually part of the kernel here and how much is userspace code. Do you think it makes sense to use some newer upstream version of the btrfs utility?
The debian package containing the btrfs command has 3.17-1.1 as version string.

Best regards,
Florian

On Dec 24, 2014 4:45 PM, Anand Jain <anand.jain@oracle.com> wrote:
>
>
> Very strange, user space reads num_device as 4 but kernel 
> reads it as 3 (total_device), thus a device missing when 
> mounted. 
> Not sure what kind of hardware at your end, Can cache be 
> issue ? could you drop cache and check for me. 
>   echo 3 > /proc/sys/vm/drop_cache 
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±ý»k~ÏâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&£ûàz¿äz¹Þ—ú+€Ê+zf£¢·hšˆ§~†­†Ûiÿÿïêÿ‘êçz_è®\x0fæj:+v‰¨þ)ߣøm

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-11 15:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09 11:15 Device only missing if unmounted Florian Uekermann
2014-12-10  2:46 ` Anand Jain
2014-12-13 14:24   ` Florian Uekermann
2014-12-18  0:56     ` Anand Jain
     [not found]       ` <1184043001.122994.1419096721838.JavaMail.open-xchange@ptangptang.store>
2014-12-24 15:45         ` Anand Jain
  -- strict thread matches above, loose matches on Subject: below --
2015-01-11 15:49 Florian Uekermann

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).