How to Convert BTRFS RAID 1 to Single Drive: A Step-by-Step Guide for Ubuntu


3 views

When working with BTRFS RAID 1 on Ubuntu (specifically in this case Ubuntu 10.04), you're dealing with a filesystem that provides data redundancy across multiple drives. The current configuration has your /home directory spread across two 2TB drives in a RAID 1 array.

Before making any changes:

sudo btrfs filesystem show /home
sudo btrfs device usage /home

These commands will show you the current device allocation and help verify you're working with the correct filesystem.

Step 1: Remove the Second Drive

First, we need to remove one drive from the array while maintaining data integrity:

sudo btrfs device delete /dev/sdX /home

Replace /dev/sdX with your actual secondary device identifier. The system will rebalance data to the remaining drive.

Step 2: Verify the Removal

After the removal completes, check the status:

sudo btrfs filesystem show /home

You should see only one device listed now.

Step 3: Convert to Single Profile

BTRFS might still think it's in RAID 1 mode. To convert to single mode:

sudo btrfs balance start -dconvert=single -mconvert=single /home

After completing these steps, verify the conversion:

sudo btrfs filesystem df /home
sudo btrfs filesystem show /home

The output should confirm you're now operating in single mode with just one drive.

If you encounter errors during the device removal:

sudo btrfs balance start -v -mconvert=single -dconvert=single /home
sudo btrfs device delete /dev/sdX /home

This forced conversion might help in stubborn cases.

Remember that moving from RAID 1 to single drive means:

  • Loss of redundancy
  • Possible performance changes (better or worse depending on workload)
  • Different space utilization characteristics

Always maintain backups before performing such operations.


If you're running Ubuntu with a BTRFS RAID 1 configuration for your /home directory across two 2TB drives, you might eventually want to simplify your setup by converting to a single drive. This could be for various reasons - maybe you need to repurpose one drive, or perhaps you've found RAID 1 to be unnecessary for your use case.

Before making any changes, it's crucial to:

  1. Backup all important data
  2. Ensure you have enough free space on the remaining drive
  3. Check the filesystem health with btrfs scrub

Run this command to check your current BTRFS setup:

sudo btrfs filesystem show

The process involves several steps:

# First, unmount the filesystem
sudo umount /home

# Check which devices are in the array
sudo btrfs filesystem show /dev/sdX

# Remove one device from the RAID 1
sudo btrfs device delete /dev/sdY /mount/point

# If you encounter "no space left" errors, add this flag
sudo btrfs balance start -dconvert=single -mconvert=single /mount/point

After removing the device, you'll want to convert the remaining drive's profile:

# Convert data to single profile
sudo btrfs balance start -dconvert=single /home

# Convert metadata to single profile
sudo btrfs balance start -mconvert=single /home

Don't forget to modify your /etc/fstab to reflect the changes. Remove the RAID-specific options and keep only the basic BTRFS mount options.

After completing these steps, verify your new configuration:

sudo btrfs filesystem show
sudo btrfs filesystem df /home
mount | grep home

These commands should show you're now running on a single device with single profile allocation.

If you encounter "no space left" errors during device removal, you might need to run:

sudo btrfs filesystem resize 1:0 /home

This command tells BTRFS to use all available space on the remaining device.

Remember that converting from RAID 1 to single drive means:

  • You lose redundancy
  • Write performance might improve slightly
  • Read performance will likely decrease

Always monitor your system after making such significant changes to your storage configuration.