Bug 1320142

Summary: Cannot specify "/" as the mount point for a btrfs subvolume
Product: [Fedora] Fedora Reporter: Jan Synacek <jsynacek>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: anaconda-maint-list, g.kaviyarasu, jonathan, vanmeeuwen+fedora
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-23 20:36:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jan Synacek 2016-03-22 12:03:06 UTC
Description of problem:
When configuring disks in the anaconda GUI, I cannot specify "/" as the mount point for a btrfs subvolume.

0) Boot F23 Workstation Live


1) Preparation

The important part here is to have a btrfs filesystem with two subvolumes (root and home) pre-prepared.

# lsblk
NAME             MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0               11:0    1  1.4G  0 rom  /run/initramfs/live
vda              252:0    0   10G  0 disk
├─vda1           252:1    0  500M  0 part
├─vda2           252:2    0    2G  0 part
├─vda3           252:3    0  7.5G  0 part

# mkfs.btrfs /dev/vda3

# mkdir /mnt/tmp

# mount /dev/vda3 /mnt/tmp/

# btrfs subv create /mnt/tmp/root
Create subvolume '/mnt/tmp/root'

# btrfs subv create /mnt/tmp/home
Create subvolume '/mnt/tmp/home'

# umount /mnt/tmp


2) Running "Install to hard drive"

When configuring disks:
2a) Choose "I will configure partitioning".
2b) Select "btrfs (root)" from the available partitions.
2c) In the "Mount Point" field, type "/" and click "Update Settings".

At the bottom, an error is displayed saying "You must create a new file system on the root device". That is obviously wrong, as the filesystem had already been created and all I'm attempting to do is to tell the installer to mount it as /. If the "Mount Point" field (step 2c) is specified as "/home", for example, there are no errors.

After the step 2c, the following appears in the system log:

Mar 22 07:48:47 localhost anaconda[3179]: ui: saving changes to device root
Mar 22 07:48:47 localhost anaconda[3179]: reformat: False
Mar 22 07:48:47 localhost blivet[3179]:          BTRFS.supported: supported: True ;
Mar 22 07:48:47 localhost blivet[3179]: getFormat('btrfs') returning BTRFS instance with object id 293
Mar 22 07:48:47 localhost anaconda[3179]: populate_right_side: existing 7.51 GiB btrfs subvolume root (35) with existing btrfs filesystem
Mar 22 07:48:47 localhost anaconda[3179]: updated device_disks to ['vda']
Mar 22 07:48:47 localhost anaconda[3179]: updated device_container_name to btrfs.28
Mar 22 07:48:47 localhost anaconda[3179]: updated device_container_raid_level to single
Mar 22 07:48:47 localhost anaconda[3179]: updated device_container_encrypted to False
Mar 22 07:48:47 localhost anaconda[3179]: updated device_container_size to 7.51 GiB
Mar 22 07:48:47 localhost blivet[3179]:             BTRFS.supported: supported: True ;
Mar 22 07:48:47 localhost blivet[3179]: getFormat('btrfs') returning BTRFS instance with object id 294
Mar 22 07:48:47 localhost anaconda[3179]: populate_raid: 3, None
Mar 22 07:48:47 localhost blivet[3179]: instantiating <class 'blivet.devicefactory.BTRFSFactory'>: <blivet.blivet.Blivet object at 0x7fbb5f501208>, 0, [], {'min_luks_entropy': 256}
Mar 22 07:48:47 localhost blivet[3179]:           DeviceTree.getDevicesByType: incomplete: False ; device_type: btrfs volume ; hidden: False ;
Mar 22 07:48:47 localhost blivet[3179]:           DeviceTree.getDevicesByType returned ['btrfs.28']
Mar 22 07:48:47 localhost anaconda[3179]: new container selection: btrfs.28
Mar 22 07:48:47 localhost anaconda[3179]: default container is btrfs.28


Version-Release number of selected component (if applicable):
anaconda-23.19.10-1.fc23.x86_64


Steps to Reproduce:
1. See description.


Actual results:
Error is displayed and the settings are not updated.


Expected results:
No error is displayed and the settings are updated.

Comment 1 David Lehman 2016-03-22 16:01:08 UTC
Anaconda does not allow the use of a preexisting filesystem for /. This is not specific to btrfs.

Comment 2 Jan Synacek 2016-03-23 06:32:58 UTC
Why not?

Comment 3 David Shea 2016-03-23 20:36:13 UTC
Because whatever is on the existing filesystem has a good chance of breaking the install.

See also https://bugzilla.redhat.com/show_bug.cgi?id=629311