Koozali.org formerly Contribs.org

Extend Hard Disk SME 8 Beta 7

Offline newburns

  • *
  • 345
  • A good plumber, noob developer
    • Mt. Rose MEdia
Extend Hard Disk SME 8 Beta 7
« on: December 19, 2011, 05:09:58 PM »
To start, cactus, stefano, mary, Charlie: I did search the forums for what I was looking for, and did find some useful info
http://forums.contribs.org/index.php?topic=46345.0
http://forums.contribs.org/index.php?topic=48134.0
http://forums.contribs.org/index.php?topic=44769.0
and of course, http://wiki.contribs.org/AddExtraHardDisk
Now that I have searched the forums and located useful info, here is my scenario.
I originally installed SME 8 from disk onto a 76 gb Hard Disk and a 300 gb Hard Disk. Didn't think twice about the raid, just shut down my windows system and installed SME. So, I am not sure how my current system utilizes the disk, but I only have 66 gb available.
I have a (2) 1 TB and 500 gb hard drives that I would like to add to the SYSTEM. I can't just do an IBay add due to the fact that most of the user's home files will exceed 100 gb each (Video Production team uses server).
I was originally trying to have each hard drive a part of the main individually totaling to 2.87 TB, however, after reading many of your post, and your willingness to help those with single raid systems, I am open to your suggestions of Redundancy.
I don't normally use redudant systems because I have many backups (presently a separate AFFA server, and one to come). I always figured those are my redundancy, but I am at the mercy of your knowledge I can only do what I understand.
So just a recap: (2) 1 TB; (1) 500gb; (1) 300 gb; (1) 74 gb
300gb and 74gb installed currently in production server.

Please Help

SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline Stefano

  • *
  • 10,810
  • Skype account: maghissimo
    • Smeserver italian community
Re: Extend Hard Disk SME 8 Beta 7
« Reply #1 on: December 19, 2011, 05:31:02 PM »
my suggestion:
- remove the 76 GB disck and add the 500 GB as per wiki howto (http://wiki.contribs.org/Raid); at the end you'll have a 300 GB raid1 array
- add the 2 1TB disks and create a new raid1 array; at this point you can add it as a mount point or to lvm..  if you choose the lvm way, you have to re-create the initrd image (the how to is in the same wiki page)

BEFORE trying anithing on your production server I strongly suggest you to make some tests with a virtual machine and to make a GOOD backup (Repeat the mantra: "backup is a good thing, backup is my best friend, backup will save my a..") ;-)

HTH
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia

Offline newburns

  • *
  • 345
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: Extend Hard Disk SME 8 Beta 7
« Reply #2 on: December 19, 2011, 05:50:46 PM »
Your link says that there is currently no text on this page.

It seems most of the information is on the 74gb hard disk, while none is on the 300gb according to my df -T screenshot.
Secondly, adding the second raid array will leave me with a 1.3 TB redundant raid array? There isn't much on the production server, and I will be attacking this straight on, but I wanna make sure I understand what my final product will be.
Sorry I included your name and others in my original post. It is sometimes difficult to obtain information from the greatest developers when you feel the information is obviously retrieved. I know there is a disconnect between you guys and noobs, and you do realize that we don't even understand most terms that you use. But you guys do a great job handling the forums, considering the amounts of questions you get
Thanks!

Also, what kind of Raid am I currrently in?
I guess SME is using both my disk to the maximum capacity of the smallest disk, but would I have to expand the raid array somehow once I add the 500gb and remove the 74gb? The new raid would end up being 66gb on a 300gb and 500gb raid?
« Last Edit: December 19, 2011, 05:53:05 PM by newburns »
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline Daniel B.

  • *
  • 1,699
    • Firewall Services, la sécurité des réseaux
Re: Extend Hard Disk SME 8 Beta 7
« Reply #3 on: December 19, 2011, 06:06:01 PM »
Your system is most probably running on a RAID 1 array (it's the default when you have 2 disk). In RAID1, the total size is the size of your smallest disk. You can check the status of your RAID array with
Code: [Select]
cat /proc/mdstat

The wiki page talking about this is this one: http://wiki.contribs.org/Raid

Basically, you'll have to:
- Remove the 76GB disk and plug the 500GB one
- Your system will boot because you still have the 300GB (you'll have a degraded RAID array)
- You'll have to rebuild your RAID array over the new 500GB
- then expand your RAID array to the size of your new smallest disk, which is now 300GB

Then, you can create a new RAID 1 array with your two 1TB disks, and you'll be able to mount this new (nearly) 1TB volume where you want, for example in /home/e-smith/files

Regards, Daniel
C'est la fin du monde !!! :lol:

Offline newburns

  • *
  • 345
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: Extend Hard Disk SME 8 Beta 7
« Reply #4 on: December 19, 2011, 06:36:00 PM »
Thank you. Daniel, I will be sure to include your name in the list the next time I decide to name all the best forum people I can think of.

I would like to leave this as solved, but don't know how to edit.

Just to confirm info here for others that are searching, is it possible to have a configuration with two hard drives in an array with two more hard drives set up independently, all being used by the system. Or all four drives independently being used by the system, giving the best storage space but no redundancy?

I am going to go with Viper's and Stefano's suggestion because the idea of removing a hard disk and adding a new one without downtime sounds too awesome to pass up. Furthermore, I understood AFFA as being able to backup a server, and if the server goes down, being able to restore that server to another piece of hardware while preserving your AFFA machine, but I see that is not correct. So technically, I would have to have two identical servers, and not a high storage production SME 8 server, with a stable SME 7 small storage backup server. And, when the time comes, rise the backup to a "newly" built SME 8 server. Redundancy is the only viable solution with minimum downtime.
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline newburns

  • *
  • 345
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: Extend Hard Disk SME 8 Beta 7
« Reply #5 on: December 19, 2011, 08:29:54 PM »
I retract my previous post. You can have an AFFA backup server on an SME 7 machine that backs up any SME Server. And from more research, an SME 8 AFFA machine can backup any Centos 5 Server. If I am incorrect, someone will buzz in and type at me, but from my research, you can back up a SME 8 Beta server to SME 7 running AFFa. And rise it to a new SME 8 Beta server.
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Offline newburns

  • *
  • 345
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: Extend Hard Disk SME 8 Beta 7
« Reply #6 on: January 05, 2012, 09:23:57 PM »
Okay, I need more help.
I installed SME 7 on a test machine. I installed on one drive, which is my /dev/hda drive. It contains the two partitions from my SME install
I have 2 more hard drives that have been successfully wiped which are: /dev/hdc  and  /dev/hdd
I want to use all 3 drives, not in an array, but as the main. So each drive is 40gb, I want to utilize 120gb for the complete system, and not mounted to a particular point. This question will assist me in my endeavor to create the 1.3TB system I mentioned earlier.

What I gathered from research:
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +100%FREE main/root
ext2online -C0 /dev/main/root   

This will grow the raid /dev/md2 if the hard drives in the raid are larger than what is present. I then figured I need to mount the new hard drives to /dev/md2, but doing that should not work the way I need it to. It should now use the new drive, and not include the current one. Secondly, I didn't want to add to the md2 raid, then that will just make it redudndant, and still utilize a total of 40gb in a mirror. I need to add to / and grow it somehow, that's my understanding.
 
I looked all through the Raid wiki and some other wikis regarding adding and upgrading drives. But I don't want to mount it to a certain point. I want sme to utilize each hard drive individually, and later I can use this information so SME can utilize two Raid arrays completely (Raid1 300gb, and separate Raid1 1tb)
I understand how to create a raid and have it mount, but I am not following how to grow the system to use the drives or raids collectively.

My df -T returns

Code: [Select]
/dev/mapper/main-root
              ext3    37897744   1514464  34458160   5% /
/dev/md1      ext3      101018     10745     85057  12% /boot
none         tmpfs      241672         0    241672   0% /dev/shm

My fdisk -l returns (just the top part)
Code: [Select]
Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 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        4865    38973690   fd  Linux raid autodetect

Disk /dev/hdc: 40.9 GB, 40982151168 bytes
16 heads, 63 sectors/track, 79408 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdc1               1       79408    40021600+  83  Linux

Disk /dev/hdd: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Disk /dev/hdd doesn't contain a valid partition table

Disk /dev/md1: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table

Disk /dev/md2: 39.9 GB, 39908933632 bytes
2 heads, 4 sectors/track, 9743392 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md2 doesn't contain a valid partition table

Disk /dev/dm-0: 39.4 GB, 39426457600 bytes
2 heads, 4 sectors/track, 9625600 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Re: Extend Hard Disk SME 8 Beta 7
« Reply #7 on: January 06, 2012, 05:22:01 PM »
I want to use all 3 drives, not in an array, but as the main. So each drive is 40gb, I want to utilize 120gb for the complete system, and not mounted to a particular point.

You are setting yourself up for disaster here.  If you succeed, it will only be a relatively short amount of time before you lose all your data. Do yourself a favour, and buy yourself two drives and set them up in RAID1.

If you have data that you don't mind losing, put it on an additional non-RAIDed drive, which is mounted at a particular point - e.g. an i-bay called 'disposable'.

Offline newburns

  • *
  • 345
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: Extend Hard Disk SME 8 Beta 7
« Reply #8 on: January 06, 2012, 05:33:31 PM »
No, it's not like that. The three single drives if for a test dedicated affa backup server. It is being used to see if affa is a good solution for my needs and going between sme 7 and 8. However, I do need to increase my production server with a raid 1 300 gb setup and raid 1 1tb setup. So I am in complete agreement with the raids idea, but I need the 1.3tb to be for the complete system and not just an ibay our something. So two raids configurations being used for the one main system, can lvm do this? Our each mount can only have 1 configuration? From my understanding, lvm can separate the main mapper across different configurations
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware

Re: Extend Hard Disk SME 8 Beta 7
« Reply #9 on: January 06, 2012, 08:25:38 PM »
Newburns -
You obviously have a spare PC. Install your 2 x 1Tb disks on that and set up an SME server with AFFA. Use SME 7.51 or 8.0beta7 (choice is yours but remember it is beta). Do not do anything fancy - you want a simple, bare-bones 2 disk RAID1 SME system.

Now, following the AFFA wiki, let the AFFA system do a full backup.
Then (before doing anything else on you original system - anything that involves data you want saved, that is) switch the OLD system OFF.
Now, do a "rise" on the AFFA box. It should not take too long.
You will now have a system with ALL your data and settings and have full connectivity just as you had before. Same IP, same WINS name, same users, same data.
AND you still have you old system intact just in case something went wrong.

The AFFA system is brilliant and works well with SME - the bit that may cause a problem is with any contribs you may have installed on your old system. These will need to be re-installed on the new system, after you do an AFFA "rise" (I think it has to be after the rise, I have never done it before the rise). But this can be done while the new system is up and running.
Now, stop trying to build your own road through the wilderness - take the simple AFFA solution.
Cheers and good luck
Ian
___________________
Sydney, NSW, Australia

Offline newburns

  • *
  • 345
  • A good plumber, noob developer
    • Mt. Rose MEdia
Re: Extend Hard Disk SME 8 Beta 7
« Reply #10 on: January 06, 2012, 10:38:01 PM »
Hallelujah!!
I finally came to the conclusion I was looking for. Now the only question remains is for future sake, how would I rebuild my raid array if one drive fails? Anyway, this is what I have done, why I did it, and what I plan on doing with this information.

I needed to spread /dev/main/root across all available devices. I say devices because I will be separating across two different /dev/md(x) or (2) RAID1 configurations.
For my test, I have 3 single 40 gb hard drives in a SME 7.5.1 setup. I installed SME 7.5.1 on a single 40gb disk, and from there I installed some hardware management contribs and AFFA 2. (Just a side note, the Compress-bzip link is returning an error for wget in the AFFA wiki, so I had success using http://apt.sw.be/redhat/el4/en/i386/rpmforge/RPMS/perl-Compress-Bzip2-2.09-1.2.el4.rf.i386.rpm). My next feat would be to successfully test AFFA on SME 7.5.1 backing up SME 8 Beta 7 and doing a restore, not a rise. However, the single 40gb hard drive is not enough, and mounting the other two to certain points would not allow AFFA to utilize the total capacity of ~120GB. So my journey comes to here.

Code: [Select]
fdisk /dev/hdc
type "n" for new
type "p" for primary
type "1" for the third partition
accept the default starting cylinder of 1
accept the default ending cylinder
now type "t" for type
then "fd" for Linux Raid
now type "w" to write out the partition table

Be sure to use Linux Raid Autodetect, because I tried just basic linux and the last portion of this code failed.

Next you must initialize the device to be available for use by LVM, and this is the part that I have been missing through this whole topic. This is not in the Raid Wiki where most thought it would be.
 
Code: [Select]
pvcreate /dev/hdc1
Once it is available for use with LVM you can extend the Volume Group onto this device. I believe this just sets the name to associate with the existing volume group.
Code: [Select]
vgextend main /dev/hdc1
Just a side note, you can use this code anytime during this process to double check your work and make sure you are on the right path, at least, that is what I did.
Code: [Select]
lvm pvscan
After extending LVM, you now have to find how much space is available for use.
Code: [Select]
vgdisplayFrom experience, DO NOT try to utilize the space completely as it will round up. (i.e. - 38.16gb will round to 39gb and cause an error in the last piece of code. I tried, and it threw that error)

Once you see the available amount of "free space" next to Free PE
Code: [Select]
lvresize -L +xxGB /dev/main/rootxx denotes the location where you put the number of free space available

Lastly, resize your filesystem
Code: [Select]
ext2online -d -v /dev/main/root
That is it! You can
Code: [Select]
df -T to see the amount of free space you have! I am not 100% on everything I did, but I have to give credit to ldkeen. Also if you mess up and pvscan reads out that it is missing a uuid
Code: [Select]
vgreduce --removemissing
That cleared my error from my initial format type that was wrong.

Please, let me know if any of this is wrong, but for me on a fresh, clean, non-production SME 7.5.1 server, it worked. I will now test on my SME 8b7 with two raid1 devices (a total of 4 hard drives)

Code: [Select]
[root@mtrosebackup ~]# lvm pvscan
  PV /dev/md2    VG main   lvm2 [37.16 GB / 0    free]
  PV /dev/hdc1   VG main   lvm2 [38.16 GB / 0    free]
  PV /dev/hdd1   VG main   lvm2 [37.25 GB / 1.41 GB free]
  Total: 3 [112.56 GB] / in use: 3 [112.56 GB] / in no VG: 0 [0   ]
[root@mtrosebackup ~]# vgdisplay
  --- Volume group ---
  VG Name               main
  System ID
  Format                lvm2
  Metadata Areas        3
  Metadata Sequence No  9
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                3
  Act PV                3
  VG Size               112.56 GB
  PE Size               32.00 MB
  Total PE              3602
  Alloc PE / Size       3557 / 111.16 GB
  Free  PE / Size       45 / 1.41 GB
  VG UUID               1Kyluo-Caox-Z8zo-QOtX-pQoK-1T9x-GRBLpB

[root@mtrosebackup ~]# df -T
Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/mapper/main-root
              ext3   114274928  19951400  88522904  19% /
/dev/md1      ext3      101018     10745     85057  12% /boot
none         tmpfs      241672         0    241672   0% /dev/shm
SME 8.0
Quad 6600
8gb DDR2 800
8 TB RAID 5
Dual Gigabit NIC
I Still Don't KNOW WHAT I AM DOING. Please, don't assume I know anything about Linux or Centos, I just know hardware