Koozali.org: home of the SME Server

Need Advice On Upgrading A Single Disk SME Box

Offline rick1908

  • ***
  • 56
  • +0/-0
    • http://theevansfamily.com/
Need Advice On Upgrading A Single Disk SME Box
« on: November 19, 2007, 07:31:52 AM »
My server is version 7.2 updated with latest updates as of today. I have a Hardware RAID1 device, so the OS and motherboard sees only a single disk. I had (2) 120 GB drives in the device and was getting low on space. So I added two new 300 GB drives one at a time and refreshed the mirror. I now have two 300GB disks in the device that are partitioned as 120 GB, therefore I have about 180 GB of unallocated space that I would like to recover.

I read an old post a while back that describes how to do this on an older version of SME. http://forums.contribs.org/index.php?topic=25017.0 It is not exactly my scenario but seems pretty close. My question do I have to do more than Step 2? Or is there a better way to do this?

I hope this is clear enough..let me know if you need more information.

Edit:
After posting this I found http://wiki.contribs.org/Raid. Which gives some information about resizing the disk on the fly..However, it too is very close but not exactly what I need. Here is the relevant information in the page:

Quote
Upgrading the Hard Drive Size
CAUTION MAKE A FULL BACKUP!
Ensure you have e-smith-base-4.16.0-33 or newer installed. [or Update to at least 7.1.3]
Shut down and install larger drive in system.
Boot up and manage raid to add new (larger) drive to system.
Wait for raid to fully sync.
Repeat steps 1-3 until all drives in system are upgraded to larger capacity.
Ensure all drives have been replace with larger drives and array is in sync and redundant!
Issue the following commands:
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +$(vgdisplay -c main | cut -d: -f16) main/root [-l (lower case L)]
ext2online -C0 /dev/main/root [is -C0 (zero)]
Notes :

All of this can be done while the server is up and running with the exception of #1.
These instructions should work for any raid level you have as long as you have >= 2 drives
If you have disabled lvm
you don't need the pvresize or lvresize command
the final line becomes ext2online -C0 /dev/md2 (or whatever / is mounted to)

I dont think this will work for me as my cat /proc/mdstat yields:
Code: [Select]
Personalities : [raid1]
md2 : active raid1 hda2[0]
      117113728 blocks [2/1] [U_]

md1 : active raid1 hda1[0]
      104320 blocks [2/1] [U_]

And my df yields:

Code: [Select]
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/main-root
                     113275568  67403020  40121764  63% /
/dev/md1                101018     47184     48618  50% /boot
none                   1037040         0   1037040   0% /dev/shm

So I guess I am wondering how to modify the commands from the how-to to recover the space as described in the beginning of the post.

Just in case your wondering...I off loaded a ton of info to a local computer to free up the space you know see in the 'df' output, As soon as I get the new drive properly sized I will put all that info back on the server.



Thanks for all your help.

Sincerely,
Rick Evans

Here is a little more information:

The fdisk output the new drive(s) (the 300GB drives) in the RAID device:
Code: [Select]
[root@matrix ~]# fdisk /dev/hda

The number of cylinders for this disk is set to 14593.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          13      104391   fd  Linux raid autodetect
/dev/hda2              14       14593   117113850   fd  Linux raid autodetect

Command (m for help):

« Last Edit: November 19, 2007, 08:32:42 AM by rick1908 »
Seeeeeeeeeeeeeeee ya,
Rick :pint:

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Need Advice On Upgrading A Single Disk SME Box
« Reply #1 on: November 19, 2007, 08:18:52 AM »
rick1908

Search the FAQ & Howtos before asking.

You would have found this:
http://wiki.contribs.org/Raid

Upgrading the Hard Drive Size
...

Offline rick1908

  • ***
  • 56
  • +0/-0
    • http://theevansfamily.com/
Re: Need Advice On Upgrading A Single Disk SME Box
« Reply #2 on: November 19, 2007, 08:27:31 AM »
I was busy updating my post when you replyed to me. I still think that I have a question or two. Can you possibly take a new look at the updated post?

Thanks for your help.

Sincerely,
Rick Evans
Seeeeeeeeeeeeeeee ya,
Rick :pint:

Offline rick1908

  • ***
  • 56
  • +0/-0
    • http://theevansfamily.com/
Re: Need Advice On Upgrading A Single Disk SME Box
« Reply #3 on: November 21, 2007, 07:36:06 AM »
To anyone that may answer...no need...I just bit the bullet and reformated and restored the server from a backup everything is working just fine now.

-Rick
Seeeeeeeeeeeeeeee ya,
Rick :pint:

Offline byte

  • *
  • 2,183
  • +2/-0
Re: Need Advice On Upgrading A Single Disk SME Box
« Reply #4 on: November 21, 2007, 10:58:01 AM »
What part was/did you have trouble with? I've followed those steps a number of times and have always managed to gain the extra space.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline rick1908

  • ***
  • 56
  • +0/-0
    • http://theevansfamily.com/
Re: Need Advice On Upgrading A Single Disk SME Box
« Reply #5 on: November 21, 2007, 03:26:26 PM »
I essentially had a single drive configuration (the RAID was contained in the RAID device http://www.arcoide.com/disk_ezraid.php).

When I executed the commands:
Code: [Select]
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +$(vgdisplay -c main | cut -d: -f16) main/root [-l (lower case L)]
ext2online -C0 /dev/main/root [is -C0 (zero)]

All seemed to work expect:
Code: [Select]
ext2online -C0 /dev/main/root [is -C0 (zero)]
I can not remember the error (sorry I didn't write it down). I then found this post and followed the reply from ldkeen: http://forums.contribs.org/index.php?topic=37686.0

With that knowledge it seemed just as easy to reformat and restore. Everything went very smooth from that point. The only trouble I had was after the restore I wanted to reuse the old drive. SME wouldn't allow me to add the old drive because it was part of another volume group now and oddly enough in the raid table of the server after the reformat and reinstall. So I did a little research on removing the the volume group and stopping the old raid array. That went well, then I just went into the colsole and added the old disk into the new array. Everything is great now.

The process for removing the volume group and raid went as follows, as best as I can remember.

Code: [Select]
vgchange -a n my_volume_group
umount my_volume_group <---can't remeber if I need to do this one or not...best I can tell I didn't hurt anything
lvremove my_volume_group
mdadm --stop /dev/md5

Not sure it those are the exact commands but they are certainly close. I got the information from http://tldp.org/HOWTO/LVM-HOWTO/index.html

After that I could add the drive back into the array via the console.

I then keep checking the rebuilding process with:
Code: [Select]
[root@zion /]# cat /proc/mdstat
I think that is it.

Server seems to be working perfectly now.

-Rick
Seeeeeeeeeeeeeeee ya,
Rick :pint:

Offline byte

  • *
  • 2,183
  • +2/-0
Re: Need Advice On Upgrading A Single Disk SME Box
« Reply #6 on: November 21, 2007, 05:47:13 PM »
All seemed to work expect:
Code: [Select]
ext2online -C0 /dev/main/root [is -C0 (zero)]

You didn't add the [is -C0 (zero)] to the end of the line did you ? the command will be just:

ext2online -C0 /dev/main/root

Plus you would only need to run the above command if you have chosen to install with nolvm parameter.

That's if you haven't installed an earlier version of SME Server  7.0(pre) for example as the volume name has changed.
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline rick1908

  • ***
  • 56
  • +0/-0
    • http://theevansfamily.com/
Re: Need Advice On Upgrading A Single Disk SME Box
« Reply #7 on: November 21, 2007, 05:54:24 PM »
Hmmm...no , I didn't add [is -C0 (zero)]. However, I was not aware the ext2online line was applicable.

I did try and rebot after executing all the commands without recovering the additional space. (It was a 7.2 server, BTW)

-Rick
« Last Edit: November 21, 2007, 06:38:30 PM by rick1908 »
Seeeeeeeeeeeeeeee ya,
Rick :pint: