Bug 611563 - btrfsctl -a does not show any valid device
Summary: btrfsctl -a does not show any valid device
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: btrfs-progs   
(Show other bugs)
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Josef Bacik
QA Contact: BaseOS QE - Apps
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-05 16:39 UTC by Lubos Kocman
Modified: 2010-07-06 14:46 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-06 14:46:10 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
strace output of btrfsctl -a (52.61 KB, text/x-log)
2010-07-05 16:39 UTC, Lubos Kocman
no flags Details

Description Lubos Kocman 2010-07-05 16:39:59 UTC
Created attachment 429562 [details]
strace output of btrfsctl -a

Description of problem:

btrfsctl -a does not show any device. Except of that it throws an error message:
failed to read /dev/sr0.

Version-Release number of selected component (if applicable):


How reproducible:

Steps to Reproduce:

1. Obtain latest RHEL 6 with btrfs filesystem
2. btrfsctl -a (under user root)
Actual results:

bash-4.1# btrfsctl -a
Scanning for Btrfs filesystems
failed to read /dev/sr0

Expected results:

I'm using btrfs on two LVs (first for root second for home)

bash-4.1# cat /etc/fstab | grep btrfs
/dev/mapper/rootvg-lv_root /                       btrfs   defaults        1 1
/dev/mapper/luks-ce6367a0-54ca-46a6-bfbb-0cd490e0b969 /home                   btrfs   defaults        1 2

so these two LVs should be listed.

Additional info:

Home is luks based volume with btrfs.

bash-4.1# ls -lad /dev/sr0 
brw-rw----+ 1 root cdrom 11, 0 Jul  5 16:04 /dev/sr0

Comment 1 Josef Bacik 2010-07-06 14:46:10 UTC
Thats not what btrfsctl -a is supposed to do.  It just probes all the devices and loads them into btrfs's volume cache so it can put together volumes when you mount something.  For example, if you have a two disk volume, and you just do mount /dev/disk0 /mnt/somwhere it will fail, because btrfs doesn't know about the second device.  So doing a btrfsctl -a will make btrfs aware that /dev/disk0 and /dev/disk1 are both btrfs volumes, so when you do a mount /dev/disk0 /mnt/somwhere it finds the uuid's for all the disks in the volume and mounts.  It's not meant to spit out the disks its found.

Note You need to log in before you can comment on or make changes to this bug.