Announcement

Collapse
No announcement yet.

Removing a drive from a Btrfs pool

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Removing a drive from a Btrfs pool

    I have three HD's internally in my laptop. It has two HD ports and I used an HD Caddy to convert the CDROM port to an HD port.

    Initially, my first drive was recognized as /dev/sda. The second was recognized sdb. I added additional drives so I could create a RAID1 configuration and have a 3rd drive for archiving Btrfs snapshots.

    I created the RAID1 using sda and sdb. When I added the third drive, instead of being designated as sdc, it became sdb and what was sdb became sdc. That's why you want to use UUID's instead of /dev/sdX designations.

    Last fall I decided to convert from a two drive RAID1 to a two drive pool in order to increase the storage capacity. Today, I decided to remove sdc from the pool and have everything on my sda drive. Here are the results.

    Before removing sdc:

    sudo btrfs fi usage /
    Code:
    $
    Overall:
        Device size:                   1.36TiB
        Device allocated:            132.03GiB
        Device unallocated:            1.23TiB
        Device missing:                  0.00B
        Used:                        114.99GiB
        Free (estimated):              1.24TiB      (min: 1.24TiB)
        Data ratio:                       1.00
        Metadata ratio:                   1.00
        Global reserve:              512.00MiB      (used: 0.00B)
    
    Data,single: Size:129.00GiB, Used:113.92GiB
       /dev/sda1      64.00GiB
       /dev/sdc       65.00GiB
    
    Metadata,single: Size:3.00GiB, Used:1.07GiB
       /dev/sdc        3.00GiB
    
    System,single: Size:32.00MiB, Used:16.00KiB
       /dev/sdc       32.00MiB
    
    Unallocated:
       /dev/sda1     627.19GiB
       /dev/sdc      630.61GiB
    Here I deleted sdc from the pool:

    :~$ sudo btrfs device delete /dev/sdc /mnt

    and redisplayed the usage:

    :~$ sudo btrfs fi usage /
    Code:
    Overall:
        Device size:                 691.19GiB
        Device allocated:            116.03GiB
        Device unallocated:          575.15GiB
        Device missing:                  0.00B
        Used:                        114.97GiB
        Free (estimated):            575.24GiB      (min: 575.24GiB)
        Data ratio:                       1.00
        Metadata ratio:                   1.00
        Global reserve:              512.00MiB      (used: 0.00B)
    
    Data,single: Size:114.00GiB, Used:113.91GiB
       /dev/sda1     114.00GiB
    
    Metadata,single: Size:2.00GiB, Used:1.05GiB
       /dev/sda1       2.00GiB
    
    System,single: Size:32.00MiB, Used:16.00KiB
       /dev/sda1      32.00MiB
    
    Unallocated:
       /dev/sda1     575.15GiB
    Now I can reformat what is sdc. and install Bionic on sda, using Btrfs, or course!
    Last edited by GreyGeek; May 01, 2018, 04:18 PM.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.
Working...
X