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

BTRFS: deleting a volume

· 52CE 我爱测

A week ago, I created a BTRFS pool using two flash drives (32GB each) with this command: /sbin/mkfs.btrfs -d single /dev/sda /dev/sdb . Then I realized that I should have used the partitions /dev/sda1 and /dev/sdb1 , instead of t…

问题原文

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

A week ago, I created a BTRFS pool using two flash drives (32GB each) with this command: /sbin/mkfs.btrfs -d single /dev/sda /dev/sdb. Then I realized that I should have used the partitions /dev/sda1 and /dev/sdb1, instead of the disks /dev/sda and /dev/sdb, so I recreated the volumes using /dev/sd[ab]1.

My problem is that now I have two volumes:

$ sudo btrfs fi show
Label: none  uuid: ba0b48ce-c729-4793-bd99-90764888851f
        Total devices 2 FS bytes used 28.00KB
        devid    2 size 29.28GB used 1.01GB path /dev/sdb1
        devid    1 size 28.98GB used 1.03GB path /dev/sda1

Label: none  uuid: 17020004-8832-42fe-8243-c145879a3d6a
        Total devices 2 FS bytes used 288.00KB
        devid    1 size 29.28GB used 1.03GB path /dev/sdb
        devid    2 size 28.98GB used 1.01GB path /dev/sda

I've tried different options in order to delete the second volume (uuid ending in c145879a3d6a), ie: using btrfs delete device. Then mkfs.btrfs, unmounted the devices and also fdisk in order to recreate the whole raid from scratch, but no matter what I do, btrfs fi show still shows both volumes. How can I completely remove these volumes from my system and start everything from scratch? No matter what I do the volumes can't be removed, ie:

$ sudo btrfs device delete /dev/sda /media/flashdrive/
ERROR: error removing the device '/dev/sda' - Inappropriate ioctl for device

I'm running here kernel 3.12.21 + btrfs v0.19

社区高分解答

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

sudo wipefs --all -t btrfs /dev/sda /dev/sdb

worked for me. I had to add --all to have sudo btrfs fi show turn up empty.

-a, --all

Erase all available signatures. The set of erased signatures can be restricted with the -t option.

Array/Btrfs was created with sudo mkfs.btrfs --label btrfs_6TB_RAID1 --metadata raid1 --data raid1 /dev/sda /dev/sdb --force

See wipefs documentation

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

资料来源与适用范围

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

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

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