An administrator wants to convert an ext4 filesystem to Btrfs without losing data. Which procedure should be used?
This command converts ext4 to Btrfs without data loss.
Why this answer
The correct procedure is to use `btrfs-convert /dev/sda1`, which is a dedicated tool that performs an in-place conversion of an existing ext2/3/4 filesystem to Btrfs while preserving all existing data. It works by creating a Btrfs filesystem that wraps the original ext4 data structures, then allowing a gradual migration to native Btrfs features via a background process.
Exam trap
The trap here is that candidates may confuse `btrfs-convert` with `mkfs.btrfs` or assume that a simple copy operation is sufficient, overlooking the fact that only `btrfs-convert` performs a true in-place filesystem conversion without data loss.
How to eliminate wrong answers
Option B is wrong because `mkfs.btrfs /dev/sda1` creates a new Btrfs filesystem from scratch, which would overwrite and destroy all existing data on the partition. Option C is wrong because `cp -a /mnt/ext4 /mnt/btrfs` is a manual file copy that requires both filesystems to be mounted simultaneously and does not convert the underlying filesystem; it also risks permission and metadata loss if not done with extreme care. Option D is wrong because `btrfs device add /dev/sda1 /mnt` adds a block device to an existing Btrfs filesystem, but it does not convert an ext4 filesystem; it would fail if the target is not already a Btrfs filesystem.