Re: Online resize

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

 



On Wednesday 12 March 2008 11:38:25 Michael Tokarev wrote:
> Wayne Gemmell wrote:
> > On Wednesday 12 March 2008 10:04:56 you wrote:
> >> a) re-create the array with new partitions, with THE SAME DISK ORDER,
> >>    METADATA VERSION AND CHUNK SIZE as it was before.
> >
> > Is this possible without loosing data?
>
> Yes.  But it's unreliable, sorta.  Too easy to screw things up, that is.
Thankfully I didn't need to do this. Resizing the partitions fixed that.
And now for the dangerous (looking) part.

> And now, the original question comes up again: what to do, how to
> perform the actual resize of the raid array...
>
> To be fair, I don't really know.  I always used my own tiny program
> to assist me in a situation like this - to back up and restore
> v0.90 linux raid superblocks.  It's available at
> http://www.corpit.ru/mjt/mdsuper.c .  Here's how I use it:
>
> First, save the original superblocks in files:
>
>   for f in sd{a,b,c,d,e}1; do
>     ./mdsuper read /dev/$f > $f
>   done
>
> this instructs mdsuper to read the superblock (v0.90 only!) and
> write it to standard out.  This has to be done while the array
> (on original partitions) is STOPPED.
>
> Now, resize the partitions, reboot if necessary (for the kernel
> to recognize the new sizes).  You can save a dump of your current
> partitions using `sfdisk -d' (redirect its output to a file as
> with mdsuper) - just in case if something goes wrong.
>
> At this point, your array is unaccessible - mdadm will tell you
> that it can't find the superblocks.  But we have the superblocks
> saved - so we only need to restore them back:
>
>   for f in sd{a,b,c,d,e}1; do
>     ./mdsuper write /dev/$f < $f
>   done
>
> (note the redirection is opposite!, and read was changed to write!).
>
> Now, try to assemble the array - it should be here.  We just moved
> (actually copied) the superblock from the now-middle-of-partitions
> to the end, where it should be, and mdadm is now able to find it.
> The array is still of the old size - but now mdadm --grow will
> work.
>
> That's basically it.  Just watch the mdsuper invocation.
>
> /mjt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Regards
Wayne Gemmell
Flash Media Group
Tel:	27 (0)12 430 7597
Cell:	27 (0)83 666 3342
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux