Re: delete whole file system

Hugo Mills
2022-09-06T09:32:37Z

On Tue, Sep 06, 2022 at 05:59:21PM +0900, Kengo.M wrote:
> Hi folks
>
> I made raid5 file system by btrfs like below
>
> sudo mkfs.btrfs -L raid5.btrfs -d raid5 -m raid1 -f /dev/sda /dev/sdb
> /dev/sdc /dev/sdd /dev/sde
>
> And mount /mnt/raid5.btrfs
>
> sudo btrfs filesystem show
>
> Label: 'raid5.btrf' uuid: 23a34a45-8f5e-40f5-8cda-xxxxxxxxxxxx
> Total devices 5 FS bytes used 128.00KiB
> devid 1 size 2.73TiB used 1.13GiB path /dev/sda
> devid 2 size 2.73TiB used 1.13GiB path /dev/sdb
> devid 3 size 2.73TiB used 1.13GiB path /dev/sdc
> devid 4 size 2.73TiB used 1.13GiB path /dev/sdd
> devid 5 size 2.73TiB used 1.13GiB path /dev/sde
>
>
> So,I want to delete this file system.
>
> btrfs device delete /dev/sda /mnt/raid5.btrfs
>
> But delete /dev/sda only.
>
> Please Someone tell me how to delete whole this file system.
>
> BRD
>
> Kengo.m

"btrfs dev delete" remove a device from the SF leaving the rest of
it intact. To destroy the filesystem completely, wipe the start of the
device on each device. You can do that with any tool that will write
data (dd if=/dev/zero is a popular one here), but there's a generic
tool called wipefs that will do it for any filesystem with minimal
writes to the device and a good level of recoverability if you get it
wrong.

Hugo.

--
Hugo Mills | Klytus, I'm bored. What plaything can you offer me
hugo@... carfax.org.uk | today?
http://carfax.org.uk/ |
PGP: E2AB1DE4 | Ming the Merciless, Flash Gordon