Re: How to replace a missing device with a smaller one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 20, 2019 at 08:02:43AM +0800, Qu Wenruo wrote:
> 
> 
> On 2019/11/19 下午10:38, David Sterba wrote:
> > On Mon, Nov 18, 2019 at 03:08:00PM +0800, Qu Wenruo wrote:
> >> On 2019/11/18 下午1:32, Qu Wenruo wrote:
> >>> On 2019/11/18 上午10:09, Nathan Dehnel wrote:
> >>>> I have a 10-disk raid10 with a missing device I'm trying to replace. I
> >>>> get this error when doing it though:
> >>>>
> >>>> btrfs replace start 1 /dev/bcache0 /mnt
> >>>> ERROR: target device smaller than source device (required 1000203091968 bytes)
> >>>>
> >>>> I see that people recommend resizing a disk before replacing it, which
> >>>> isn't an option for me because it's gone.
> >>>
> >>> Oh, that's indeed a problem.
> >>>
> >>> We should allow to change missing device's size.
> >>
> >> I have CCed you with a patch to allow user to *shrink* the missing device.
> >>
> >> You can also get the patch from patchwork:
> >> https://patchwork.kernel.org/patch/11249009/
> >>
> >> Please give a try, since the device size is pretty small, I believe with
> >> that patch, we can go quick shrink, that means "btrfs fi resize" command
> >> should return immediately.
> > 
> > So it can be recteated eg. on loop devices, where some of them are
> > slightly smaller, then go missing and replace is started, right?
> > 
> 
> Replace will still be rejected, but we can do resize of that missing
> dev, then replace, as a workaround.
> 
> I haven't do the auto-resize for replace yet, since I'm not sure if that
> could make cases like replacing 1T device with 10G driver happening.

That case would be much more tolerable if device replace/resize/delete would
stop to check for fatal signals at least between block groups, if not more
often.  Currently if you pick the wrong size, the only way to make it stop
is to reboot.

> Thanks,
> Qu
> 



Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux