Bug 921757 - anaconda crashes when attempting to install onto existing btrfs filesystem
Summary: anaconda crashes when attempting to install onto existing btrfs filesystem
Alias: None
Product: Fedora
Classification: Fedora
Component: python-blivet
Version: 19
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: David Lehman
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2013-03-14 20:36 UTC by James Ralston
Modified: 2013-05-22 03:13 UTC (History)
8 users (show)

Fixed In Version: anaconda-19.24-1.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-05-22 03:13:08 UTC
Type: Bug

Attachments (Terms of Use)
anaconda.log (63.47 KB, text/plain)
2013-04-12 00:12 UTC, James Ralston
no flags Details
ifcfg.log (485 bytes, text/plain)
2013-04-12 00:13 UTC, James Ralston
no flags Details
packaging.log (163.11 KB, text/plain)
2013-04-12 00:13 UTC, James Ralston
no flags Details
program.log (55.16 KB, text/plain)
2013-04-12 00:14 UTC, James Ralston
no flags Details
storage.log (298.61 KB, text/plain)
2013-04-12 00:14 UTC, James Ralston
no flags Details
X.log (29.32 KB, text/plain)
2013-04-12 00:15 UTC, James Ralston
no flags Details

Description James Ralston 2013-03-14 20:36:14 UTC
I have a disk partitioned as so:

/dev/sda1 - /boot (1GiB)
/dev/sda2 - /boot/efi (1GiB)
/dev/sda3 - unused (2GiB)
/dev/sda4 - LUKS-encrypted device containing btrfs filesystem (400 GiB)
/dev/sda5 - LUKS-encrypted device containing LVM block device (48 GiB)

I have Fedora 16 installed onto a top-level subvolume named "F16" of the btrfs filesystem. The btrfs filesystem only has ~28% of its capacity used.

My goal was to install Fedora 18 onto the btrfs filesystem, also in a top-level subvolume. My understanding is that although the UI gives no indication that it is mucking around with subvolumes, this is what it will do.

I performed the following actions:

Click "Installation Destination" in the "Installation Summary" screen.
Click "Continue". The "Installation Options" pop-up appears.

Expand "Partition scheme configuration" and select BTRFS as the partition type.
Select "I don't need help".
Click "Reclaim space." This goes to the "Manual Partitioning" screen.

Expand "Unknown".
Format sda1 as /boot (ext4).
Format sda2 as /boot/efi (EFI System Partition).
Select sda3 and type the password to unlock it.

Click "+" to add a new mount point.
Enter "/" for the mount point; leave the desired capacity blank.
Click "Add mount point".

Select the "Root" entry in the "New Fedora 18 Installation" pane.
Enter "root" in the "Label" field.
Leave "Device Type" set to "BTRFS".
(All other options will be grayed out.)

Click "Finish partitioning".
Click "Begin Installation".

Anaconda will crash shortly into the "Preparing to install" phase.

If I go through the installer again, but instead unlock the LVM device and configure anaconda to install the root filesystem onto a new logical volume, then the install succeeds.

I attempted to submit a bug report in anaconda, but my report was rejected as a duplicate of bug 870586.

The title of the bug report I was unable to submit was:

DeviceCreateError: ('12', 'root') - anaconda

This is a critical bug, because Fedora 17 is incapable of installing onto btrfs, and Fedora 16 is now at end-of-life. So people who installed Fedora 16 using btrfs now have no upgrade path.

Comment 1 Brian Lane 2013-03-14 23:03:03 UTC
Please switch to tty2 (ctrl-alt-f2) and attach the logs from /tmp/*log to this bug as individual text/plain files.

Comment 2 James Ralston 2013-04-12 00:12:59 UTC
Created attachment 734474 [details]

Comment 3 James Ralston 2013-04-12 00:13:24 UTC
Created attachment 734475 [details]

Comment 4 James Ralston 2013-04-12 00:13:45 UTC
Created attachment 734476 [details]

Comment 5 James Ralston 2013-04-12 00:14:04 UTC
Created attachment 734477 [details]

Comment 6 James Ralston 2013-04-12 00:14:23 UTC
Created attachment 734478 [details]

Comment 7 James Ralston 2013-04-12 00:15:16 UTC
Created attachment 734479 [details]

Comment 8 James Ralston 2013-04-12 00:40:30 UTC
I think the critical part is this line:

17:03:08,876 INFO program: Running... /bin/mount -n -t btrfs -o defaults /dev/mapper/luks-fa897310-ff6e-4ea8-92aa-c85cfffcafcc /tmp/btrfs-tmp.33ddJ_P2

It looks like anaconda is assuming that mounting the btrfs filesystem will automatically mount the top-level subvolume (subvolid=0). That is a false assumption, because my btrfs top-level subvolume contains only subvolumes that are complete snapshots of the entire system. E.g.:

$ mount -o subvolid=0 /dev/mapper/luks-fa897310-ff6e-4ea8-92aa-c85cfffcafcc /mnt
$ ls -1F /mnt

The datestamped subvolumes are subvolumes I created via making snapshots. I do this each time I perform yum updates. If any yum update breaks the system, then I boot single-user (or from a rescue image if I have to), change the default subvolume to the last known-good snapshot, and then reboot.

(Each one of those subvolumes actually contains multiple other subvolumes, but let's not get into that right now.)

The subvolume that currently is mounted by default is the "F18" one, not the root subvolume. So when anaconda executes its mount operation, it gets the F18 subvolume, and the subsequent attempt to create a "root" subvolume fails because there is already a /root directory.

I think the only sane thing for anaconda to do when installing onto btrfs is to mount the top-level subvolume, create a subvolume for the install (e.g., "Fedora_18"), change that subvolume to be the default, unmount and remount, and then install. If that's not where the user wanted the install to go, he can always "move" it by making a snapshot.

Honestly, the only other alternative is for anaconda to probe the subvolume structure of the btrfs filesystem and ask the user to select the location where the subvolume for the install should be created.

Comment 9 David Lehman 2013-04-24 20:01:51 UTC
The bug here is that we're not overriding the default subvol for preexisting btrfs. I'll work on a patch to do that.

As a workaround, all you have to do it reset the default subvol to be the top-level prior to installing.

Comment 10 Fedora Update System 2013-05-03 23:04:18 UTC
anaconda-19.24-1.fc19, python-blivet-0.12-1.fc19 has been submitted as an update for Fedora 19.

Comment 11 Fedora Update System 2013-05-04 18:50:30 UTC
Package anaconda-19.24-1.fc19, python-blivet-0.12-1.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing anaconda-19.24-1.fc19 python-blivet-0.12-1.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2013-05-22 03:13:08 UTC
anaconda-19.24-1.fc19, python-blivet-0.12-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

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