[OpenIndiana-discuss] rpool defragmentation

Andrew Gabriel illumos at cucumber.demon.co.uk
Fri Jan 16 23:17:43 UTC 2015


Timothy Coalson wrote:
> On Fri, Jan 16, 2015 at 11:47 AM, Andrew Gabriel <
> illumos at cucumber.demon.co.uk> wrote:
>
>   
>> On 01/16/15 03:47 PM, Gary Gendel wrote:
>>
>>     
>>> On 01/16/2015 10:22 AM, Andrew Gabriel wrote:
>>>
>>>       
>>>> On 01/16/15 02:37 PM, Gary Gendel wrote:
>>>>
>>>>         
>>>>>  I thought about creating a new BE and then sending the current BE to
>>>>> it, but there doesn't seem to be enough room.
>>>>>
>>>>>           
>>>> Since rpool can only be either a single disk or a mirror, the easiest
>>>> way to defrag it is to attach another mirror side and let it resilver. The
>>>> new mirror side will be defragged. Make sure the new disk is bootable (has
>>>> grub etc on it), and then zpool split off the old disk. It would be a good
>>>> opportunity to move to a bigger rpool disk too.
>>>>
>>>>  Yes, this is the rpool and is mirrored.  Would resilvering really
>>>>         
>>> defragment it?
>>>
>>>       
>> Yes, space is allocated afresh when resilvering (which is a significant
>> difference from traditional RAID).
>>     
>
>
> I find that surprising.  Does the metadata on the older drive(s) manage to
> refer to the new, independent location of the blocks on the new mirror, and
> if so, how?

Good question - I'm going to have to think about that.
I have done the mirror side attach and old side detach a few times and 
got significantly better performing pool in the case of an old pool, but 
maybe my rationale for the reason is not correct. I haven't done it 
since the spacemap histograms were introduced, so I haven't seen if the 
spacemap is significantly less fragmented as a result. Something to try out.

-- 
Andrew



More information about the openindiana-discuss mailing list