Bug 611563 - btrfsctl -a does not show any valid device
btrfsctl -a does not show any valid device
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: btrfs-progs (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Josef Bacik
BaseOS QE - Apps
Depends On:
  Show dependency treegraph
Reported: 2010-07-05 12:39 EDT by Lubos Kocman
Modified: 2010-07-06 10:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-07-06 10:46:10 EDT
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 12:39 EDT, Lubos Kocman
no flags Details

  None (edit)
Description Lubos Kocman 2010-07-05 12:39:59 EDT
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 10:46:10 EDT
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.