1

I have RAID1 configured as described here

$ sudo mkfs.btrfs -m raid1 -d raid1 /dev/sdb /dev/sdc

Then I mount device and write some data:

sudo mount /dev/sdb /mnt
echo "some data" > /mnt/123

I have next picture:

# btrfs fi show
Label: none  uuid: 01e1a8a1-be78-47d0-8dc2-2e293265b31b
    Total devices 2 FS bytes used 896.00KiB
    devid    1 size 3.64TiB used 4.04GiB path /dev/sde
    devid    2 size 3.64TiB used 4.04GiB path /dev/sdb

Then I unplug one device and see next:

# btrfs fi show
warning, device 2 is missing
warning, device 2 is missing
parent transid verify failed on 22020096 wanted 11 found 8
parent transid verify failed on 22020096 wanted 11 found 8
Ignoring transid failure
Label: none  uuid: 01e1a8a1-be78-47d0-8dc2-2e293265b31b
    Total devices 2 FS bytes used 896.00KiB
    devid    1 size 3.64TiB used 2.01GiB path /dev/sde
    *** Some devices missing

When I mount /dev/sde device I see no data:

# mount -o degraded /dev/sdb /mnt
# cd /mnt
# ls

Thus I am not sure that btrfs function normally.

  1. Why I do not see stored data?
  2. Why btrfs fi show displays different info? c/p from posts above:
devid    1 size 3.64TiB used 4.04GiB path /dev/sde
VS  (after removing one device)
devid    1 size 3.64TiB used 2.01GiB path /dev/sde

As you can see used is differ =(

Eugen Konkov
  • 415
  • 7
  • 17
  • Are you sure you are looking at the same filesystem, you formatted /dev/sdc but examined /dev/sde, so which device was renamed? – Timothy Baldwin Oct 07 '19 at 16:17
  • @TimothyBaldwin: I am sure. The device name was changed when I rescan devices after unplug/plug: `sudo echo "- - -" > /sys/class/scsi_host/host2/scan` – Eugen Konkov Oct 07 '19 at 17:13

1 Answers1

0

thx to cono. He help me. I have no RAID yet:

# btrfs fi df /mnt
Data, RAID1: total=1.00GiB, used=768.00KiB
Data, single: total=1.00GiB, used=0.00B
System, RAID1: total=8.00MiB, used=16.00KiB
System, single: total=32.00MiB, used=0.00B
Metadata, RAID1: total=1.00GiB, used=112.00KiB
Metadata, single: total=1.00GiB, used=0.00B
GlobalReserve, single: total=16.00MiB, used=0.00B

The command suggested at article does not work correctly

So he suggested me make rebalance manually:

# btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt

Now it works as expected:

# btrfs fi df /mnt
Data, RAID1: total=1.00GiB, used=512.00KiB
System, RAID1: total=32.00MiB, used=16.00KiB
Metadata, RAID1: total=1.00GiB, used=112.00KiB
GlobalReserve, single: total=16.00MiB, used=0.00B
Eugen Konkov
  • 415
  • 7
  • 17