Bug 1264696 - Installer show wrong btrfs raid size
Installer show wrong btrfs raid size
Product: Fedora
Classification: Fedora
Component: python-blivet (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: David Shea
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-09-20 16:11 EDT by Aniruddha
Modified: 2015-11-02 10:38 EST (History)
8 users (show)

See Also:
Fixed In Version: python-blivet-1.15-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-02 10:38:15 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
anaconda.log (123.60 KB, text/plain)
2015-09-28 08:33 EDT, Aniruddha
no flags Details

  None (edit)
Description Aniruddha 2015-09-20 16:11:41 EDT
Description of problem:
In a setup with 4 3TB disk luks encrypted btrfs raid only sees 3TB

Steps to Reproduce:
1. Create encrypted btrfs automatically
2. You start with 12 TB, no redundancy
3. Change to raid 10 or other raid level

Actual results:
Available disk space is too low

Expected results:
Available disk space should, be higher
Comment 1 David Shea 2015-09-21 16:33:18 EDT
What amount of disk space are you seeing, and what do you think it should be? Please attach the logs from /tmp to this bug as individual, text/plain attachments.
Comment 2 Aniruddha 2015-09-22 11:29:14 EDT
I have created a vm  in kvm with 4x 4 GB disks. I choose 'I will configure partitioning' and 'Encrypt my data'. I choose 'Btrfs' and 'Click here to create them automatically. The btrfs partition size with no redundancy is 13.9 GB with 3.88 MB available space.  

I change the Volume to RAID 10 and the btrfs partition size decreases to 1.91 GB with RAID 10 and 1.91 GB with RAID1 with 6.27 GB available space. Changing the  size policy has no effect.
Comment 3 David Shea 2015-09-22 14:58:31 EDT
The available space is correct. In the absence of the logs I requested, I'll just assume that your automatic layout was roughly:

   - 500 MB /boot
   - 1.6 GB swap
   - 1.9 GB btrfs

   - 4 GB btrfs

   - 4 GB btrfs

   - 4 GB btrfs

So the total size of the btrfs volume would be 13.9 GB, and some small amount of free space listed as "available" due to block size requirements or whatever.

When you switch a layout like that RAID10, each member of the array needs to be the same size. So the partitions on sdb, sdc and sdd will each shrink to 1.9GB, leaving about 2.1 GB free on each disk for a total of about 6.3 GB.

But the size of the btrfs volume should have been 2x the size of the members. I've posted a patch to https://github.com/rhinstaller/blivet/pull/232 to fix that.
Comment 4 Aniruddha 2015-09-22 15:24:38 EDT
I did a quick test setup with kvm. I can get the logs when I am at the server. Your assumption for the automatic layout was spot on. Thanks for the patch
Comment 5 Aniruddha 2015-09-25 02:08:56 EDT
What is the best option for now? Leave the 'RAID Level' at single and convert to raid 10 after a reboot?

I have also noticed that the btrfs volume size halves again when you select 'Size policy: As large as possible' instead of 'Automatic' in the 'Configure Volume' screen.
Comment 6 David Shea 2015-09-25 08:55:51 EDT
It will work fine if you just leave it as raid 10. Anaconda will use the correct amount of space for the physical partitions, it's just displaying the wrong amount of size for what will be provided by the btrfs volume.
Comment 7 Aniruddha 2015-09-28 08:33 EDT
Created attachment 1077922 [details]
Comment 8 Aniruddha 2015-10-04 09:29:09 EDT
I encountered another problem which might be related. In the "configure volume screen" with "RAID Level: RAID 10" and  "Size policy: As large as possible" Ticking the "encrypt"  option makes the installer only uses half the space on the hard drive. If you change the "Size policy" to "Automatic" the whole drive is used. 

For this setup I had biosboot, /boot and swap residing on a non-redundant usb stick and 4 * 3 TB disks with luks+ btrfs. After install fdisk shows that only half of the disk size (1,5 TB) is used with luks+btrfs, the other half is unused.
Comment 9 Brian Lane 2015-10-05 12:36:53 EDT
Please retry with the lastest Fedora 23 nightly, if it still happens open a new bug and attach the logs from /tmp/*log to the bug as individual text/plain attachments.

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