December 22, 20169 yr I tried to search documentation and could not find anything conclusive on how to accomplish this. Can someone help me with safest way to shrink cache pool with 4 disk to 2 disk cache pool? Because parity protects data-pool and cache pool is anyway un-protected, I would think that i need not run parity check again after doing above shrink. Am I wrong with this understanding?
December 22, 20169 yr Community Expert https://lime-technology.com/forum/index.php?topic=48508.msg484479#msg484479 Before starting look at the output of "btrfs filesystem df" on the cache webpage and make sure there's only one data profile.
December 23, 20169 yr Author root@MyLab:/mnt/cache# btrfs filesystem df /mnt/cache Data, RAID10: total=250.00GiB, used=122.07GiB Data, RAID6: total=2.00GiB, used=1.25MiB System, RAID10: total=64.00MiB, used=48.00KiB Metadata, RAID10: total=1.00GiB, used=15.88MiB GlobalReserve, single: total=16.00MiB, used=0.00B I see two data profile in there. First one is showing as RAID10. Second one is RAID6. (See output above) My Cache Pool is consist of 4 drives. (See screenshot attached) I need help to accomplish following 3 objectives. 1) Shrink cache pool without loosing data. 2) Remove other two un-used disks 3) Configure remaining two as raid1. Could you please help me accomplish this?
December 23, 20169 yr Community Expert RAID6 profile looks unused, still we'll try to get rid of it, also you'll need to downconvert the pool to RAID1 before removing any devices as RAID10 requires 4 devices minimum, so: 1) Backup your cache just in case 2)Use the console or SSH into your server and type: btrfs balance start --bg -dconvert=raid1 -mconvert=raid1 /mnt/cache This can take some time, watch progress by typing: watch btrfs balance status /mnt/cache When "No balance found on '/mnt/cache'" appears exit with Ctrl+c and type: btrfs filesystem df /mnt/cache Check that raid1 is the only profile used, if there are other profiles run balance again. 3) Use the console or SSH into your server and type: btrfs device remove /dev/sdx1 /mnt/cache replace x with the first device you want to remove (don't forget the 1 at the end, eg, /dev/sdf1), again this could take some time if there's data on the device that's being removed, if there's a lot of data you can watch progress on cache page "btrfs filesystem show:", look for the devid you're removing and its used space, remove operation will finish after all data is moved to other disk(s). repeat step 3 with the other device you want to remove. When done, stop array, there should be a blue square on the device you want to remove, unassign it (you can rearrange remaining devices, e.g., if you removed cache1 you can reassign cache2 to the cache1 slot), re-start array and you're done.
December 24, 20169 yr Author Make note of each disk's identification information. i.e. Serial number and device identifier highlighted in bold. We'll need this to lookup in last few steps when re-arranging cache pool. SAMSUNG_SSD_PM810_2.5__7mm_256GB_S0NUNEAB804576 - 256 GB (sdd) SAMSUNG_SSD_PM810_2.5__7mm_256GB_S0NUNEAB814342 - 256 GB (sde) SAMSUNG_SSD_PM810_2.5__7mm_256GB_S0NUNEAB913927 - 256 GB (sdf) SAMSUNG_SSD_PM810_2.5__7mm_256GB_S0NUNEAB701039 - 256 GB (sdg) To convert to raid1 as per johnnie.black's instuction. I had to run following command twice. Normally this would not be the case with everyone. 2nd time to get rid of raid6 which I had for some reason. Before conversion my file sytem looked as per following. root@MyLab:/mnt/cache# btrfs filesystem df /mnt/cache/ Data, RAID10: total=28.00GiB, used=25.56GiB Data, RAID6: total=114.00GiB, used=96.51GiB System, RAID10: total=64.00MiB, used=16.00KiB Metadata, RAID10: total=1.00GiB, used=15.53MiB GlobalReserve, single: total=16.00MiB, used=0.00B Note: 1) I added "-sconvert=raid1" to include system data. 2) To run command in background, --bg was not working. so, I had to remove that. 3) "-v" to run it in verbose mode. SO, final command that I executed to convert to raid1 was as per following. btrfs balance start -f -v -dconvert=raid1 -mconvert=raid1 -sconvert=raid1 /mnt/cache From another putty/ssh connection, I measured progress by executing following command both time till I reached . No balance found on '/mnt/cache' Command: watch btrfs balance status /mnt/cache After that to verify file system executed following command. btrfs filesystem df /mnt/cache Then as per johnnie.black's instuction, I removed device by executing following commands. IMPORTANT: from device being removed gets moved to remaining disks. So this will very long time if you have too much data in disk that you are trying to remove. Ensure sufficient free space on remaining disks. To remove 3rd disk. btrfs device remove /dev/sdf1 /mnt/cache To Remove 4th disk. btrfs device remove /dev/sdg1 /mnt/cache From different putty/ssh connection, I measured progress by executing following command time to time. btrfs filesystem show After that I Stoped array Removed disk by selecting No Device from drop down menu where I had sdf and sdg. (Used lookup table above) Started array Verified that I could start array and all data in it was intact. Stopped array Shutdown system Physically unplugged other two SSDs. Started system Re-arranged available sdd and sde in cache pool Slot-1 and Slot-2 respectively Removed extra two empty slots from cache pool. Started array Here is final status.... root@MyLab:~# btrfs filesystem df /mnt/cache Data, RAID1: total=143.00GiB, used=122.39GiB System, RAID1: total=32.00MiB, used=48.00KiB Metadata, RAID1: total=1.00GiB, used=15.70MiB GlobalReserve, single: total=16.00MiB, used=0.00B So far everything seems to be functional and working. I know I am documenting a long post like an essay. I just hope that it would help someone in need, some day. Thanks to johnnie.black's expert advice, I could meet all 3 objective without loosing data.
December 24, 20169 yr Community Expert Thanks for the detailed feedback, I'll use some to improve the FAQ, if --bg didn't work I'm guessing you're still on v6.1, can you confirm so I can add a note?
December 24, 20169 yr Author Actually, I am on unRAID server Trial, version 6.2.4. Could it be a limitation of trial version?
December 24, 20169 yr Community Expert It can't be trial related, I'm surprised it didn't work on v6.2.4, I'll try it on my test server, maybe it only works on v6.3.
December 24, 20169 yr Community Expert Confirmed, --bg is only available on the newer btrfs tools included with v6.3, I'll add a note of that to the FAQ. PS: forgot to mention earlier, -sconvert is not needed, e.g., converting from raid10 to raid1 you only need: -dconvert=raid1 -mconvert=raid1 system will be converted to the same profile.
Archived
This topic is now archived and is closed to further replies.