> -----Original Message----- > From: linux-btrfs-ow...@vger.kernel.org [mailto:linux-btrfs- > ow...@vger.kernel.org] On Behalf Of Daniel Pocock > Sent: Sunday, 25 January 2015 1:46 AM > To: Hugo Mills; linux-btrfs@vger.kernel.org > Subject: Re: RAID1 migrate to bigger disks > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > > > On 24/01/15 15:36, Hugo Mills wrote: > > On Sat, Jan 24, 2015 at 03:32:44PM +0100, Daniel Pocock wrote: > >> > >> > >> > >> I've got a RAID1 on two 1TB partitions, /dev/sda3 and /dev/sdb3 > >> > >> I'm adding two new disks, they will have bigger partitions > >> /dev/sdc3 and /dev/sdd3 > >> > >> I'd like the BtrFs to migrate from the old partitions to the new ones > >> as safely and quickly as possible and if it is reasonable to do so, > >> keeping it online throughout the migration. > >> > >> Should I do the following: > >> > >> btrfs device add /dev/sdc3 /dev/sdd3 /mnt/btrfs0 btrfs device delete > >> /dev/sda3 /dev/sdb3 /mnt/btrfs0 > >> > >> or should I do it this way: > >> > >> btrfs device add /dev/sdc3 /mnt/btrfs0 btrfs device delete > >> /dev/sda3 /mnt/btrfs0 btrfs device add /dev/sdd3 /mnt/btrfs0 btrfs > >> device delete /dev/sdb3 /mnt/btrfs0 > >> > >> or is there some other way to go about it? > > > > btrfs replace start /dev/sda3 /dev/sdc3 /mountpoint btrfs fi resize > > 3:max /mountpoint btrfs replace start /dev/sdb3 /dev/sdd3 /mountpoint > > btrfs fi resize 4:max /mountpoint > > > > The 3 and 4 in the resize commands should be the devid of the > > newly-added device. > > Thanks for the fast reply > > In the event of power failure, can I safely shutdown the server during this > operation and resume after starting again? > > I get more than 2 hours runtime from the UPS but I suspect that migrating > 1TB will take at least 12 hours.
I know that removing a device can be interrupted safely by a reboot - I do it all the time as there is no cancel option for removal. It seems to operate the same way balance does, by moving data around, and when there is nothing left on the disk it is removed and de-associated. Paul. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html