Re: Increase Disk Size in a gmirror RAID1

2007-08-26 Thread Charles Uchu Strader
So it looks like I came up with a resolution myself on this.  Here's a 
post for posterity or any comments:



What I've done so far is to forget da1 from the gm0 mirror, restart, 
and put the 73GB into drive bay two.  But now I'm at bit lost at the 
process to follow to achieve my desired result.  I'm thinking 
something like fdisk, bsdlabel, newfs on the new da1 73GB drive.  Then 
dd or dump/restore from da0/gm0 to da1.  Then shutdown, remove the 
36GB da0, put in the second 73GB drive, boot and them get gmirror to 
sync things from the 73GB drive.




So my resolution to upsizing the disk was to utilize gmirror (rather 
than dump/restore or dd).  Here's what I did:


1) Sync the existing smaller disk (da0 / 36GB) to the new larger disk 
(da1 / 73GB) now in the machine using gmirror.


2) Remove da0 from the gmirror:

# gmirror remove gm0 da0

3) Edit /etc/fstab so that after the next reboot it will boot as if only 
a single disk, instead of the gmirror /dev/mirror .  Also comment out: 
geom_mirror_load=YES in /boot/loader.conf


4) Shutdown and power down.  Take out 36GB from drive bay 1.  Take 73GB 
from drive bay 2 and put into drive bay 1.  Start the server back up and 
da0 is now the 73GB drive.


5) Now, since gmirror applied its slice and disklabel partition, 
checking disk usage shows that the system sees the disk still as a 36GB 
and the /web partition I wanted to increase was still at 18GB, instead 
of the 51GB I needed.  To fix that I did the following:


# fdisk -u /dev/da0  (just following the standard prompts, only needing 
to change the total byte size from from 71119692 (36GB) to 143363997 
(73GB) when that prompt came up)


# disklabel -e /dev/da0s1  (updated the disk labels so that c: had the 
new 143363997 value and so that g: (the /web partition) had the new 
value 110491549.


# umount /web

# newfs  -U /dev/da0s1g

# mount /dev/da0s1g /web

6) Edit the /etc/fstab to restore it to the gmirror style references, 
instead of single disk.  And uncomment out: : geom_mirror_load=YES in 
/boot/loader.conf


Then also:

# gmirror label -v -b round-robin gm0 /dev/da0

7) Shutdown and power down.  Add the second new 73GB drive into bay 2.  
Restart the server and once booted back in get both bigger drives in 
sync with gmirror and everything is good to go!


# gmirror insert gm0 da1

...

(Caveat)  I've only done this on a test machine with no activity and no 
data in the /web partition.  Before I do this on a live server, I'll 
probably run the whole process again with data in /web and see how it 
all does.


Any comments or thoughts about this process, would love feedback. 


~Charles Uchu
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Increase Disk Size in a gmirror RAID1

2007-08-26 Thread [EMAIL PROTECTED]
On 26/08/07, Charles Uchu Strader [EMAIL PROTECTED] wrote:
 So it looks like I came up with a resolution myself on this.  Here's a
 post for posterity or any comments:
 
 
  What I've done so far is to forget da1 from the gm0 mirror, restart,
  and put the 73GB into drive bay two.  But now I'm at bit lost at the
  process to follow to achieve my desired result.  I'm thinking
  something like fdisk, bsdlabel, newfs on the new da1 73GB drive.  Then
  dd or dump/restore from da0/gm0 to da1.  Then shutdown, remove the
  36GB da0, put in the second 73GB drive, boot and them get gmirror to
  sync things from the 73GB drive.
 

 So my resolution to upsizing the disk was to utilize gmirror (rather
 than dump/restore or dd).  Here's what I did:

 1) Sync the existing smaller disk (da0 / 36GB) to the new larger disk
 (da1 / 73GB) now in the machine using gmirror.

 2) Remove da0 from the gmirror:

 # gmirror remove gm0 da0

 3) Edit /etc/fstab so that after the next reboot it will boot as if only
 a single disk, instead of the gmirror /dev/mirror .  Also comment out:
 geom_mirror_load=YES in /boot/loader.conf

 4) Shutdown and power down.  Take out 36GB from drive bay 1.  Take 73GB
 from drive bay 2 and put into drive bay 1.  Start the server back up and
 da0 is now the 73GB drive.

 5) Now, since gmirror applied its slice and disklabel partition,
 checking disk usage shows that the system sees the disk still as a 36GB
 and the /web partition I wanted to increase was still at 18GB, instead
 of the 51GB I needed.  To fix that I did the following:

 # fdisk -u /dev/da0  (just following the standard prompts, only needing
 to change the total byte size from from 71119692 (36GB) to 143363997
 (73GB) when that prompt came up)

 # disklabel -e /dev/da0s1  (updated the disk labels so that c: had the
 new 143363997 value and so that g: (the /web partition) had the new
 value 110491549.

 # umount /web

 # newfs  -U /dev/da0s1g

 # mount /dev/da0s1g /web

 6) Edit the /etc/fstab to restore it to the gmirror style references,
 instead of single disk.  And uncomment out: : geom_mirror_load=YES in
 /boot/loader.conf

 Then also:

 # gmirror label -v -b round-robin gm0 /dev/da0

 7) Shutdown and power down.  Add the second new 73GB drive into bay 2.
 Restart the server and once booted back in get both bigger drives in
 sync with gmirror and everything is good to go!

 # gmirror insert gm0 da1

 ...

 (Caveat)  I've only done this on a test machine with no activity and no
 data in the /web partition.  Before I do this on a live server, I'll
 probably run the whole process again with data in /web and see how it
 all does.

 Any comments or thoughts about this process, would love feedback.

Given your restricted circumstances, I would probably
have yanked one half of the old mirror (obviously after
a careful backup*) put in one of the new disks, created
a second (now degraded mirror), do whatever slice
and partition business needed to be done, dump/restore,
modify fstab, shutdown, yank other half of old mirror,
insert new disk, boot, add to mirror, sync (hopefully).
Hotswap would be really super, though.  Maybe saving
you rebooting at all.

Also, if drive cabling were sufficient (and controllers)
you could just let it all hang out while you moved
everything, and then tidied up once everything was
copacetic.


* I say I would, but in reality, I would probably just wing it.
. . .
And suffer.

-- 
--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]