大网数据广告活动
服务器运维问答

How can I remove a drive from a BTRFS RAID 1 setup to make it just a single (BTRFS) drive?

· 52CE 我爱测

I'm using Ubuntu 10.04 and have the /home directory setup as a BTRFS RAID 1 with two 2TB drives. I'd like to make the /home directory just a single drive; how do I safely go about doing this?

问题原文

原帖链接 · Jamie · CC BY-SA 3.0

I'm using Ubuntu 10.04 and have the /home directory setup as a BTRFS RAID 1 with two 2TB drives.

I'd like to make the /home directory just a single drive; how do I safely go about doing this?

社区高分解答

原帖链接 · hrunting · CC BY-SA 4.0

Update: December 2020

The functionality of btrfs continues to evolve over time. The delete command is now an alias for the remove command which produces different results. Today, you would run the following commands:

btrfs balance start -f -sconvert=single -mconvert=single -dconvert=single <mount>
btrfs device remove <drive> <mount>

The first command converts all data from a mirrored setup to a single-copy setup. This effectively makes the RAID1 into a JBOD setup. The -f option is required to tell the filesystem to really reduce the resiliency of the data.

Once this completes, the second command removes the device from the JBOD. The filesystem will move any data from the removed device to the other device.

Original Answer

According to this btrfs wiki, you remove a device from a btrfs RAID, by issuing the command:

btrfs device delete <drive> <mount>

This is an online command, so for you, it would be (while /home is mounted):

btrfs device delete <drive> /home

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-02-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。