Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: byte on April 13, 2006, 03:51:22 PM

Title: [howto] Adding Additional Drivers
Post by: byte on April 13, 2006, 03:51:22 PM
I have seen a different post on here to what I'm after, have any of you already done this...

Setup a main harddrive for the "root"

Add another harddrive purely for "ibays"

Add another harddrive purely for "users"

Reason I want to do it this way is so that if my root drive was to go down I would only have to replace the one drive. I'm going to be playing with this myself so I shall report back.

If you have already done this could you show me what steps you did?

TIA
Title: [howto] Adding Additional Drivers
Post by: byte on April 15, 2006, 03:01:43 PM
I have done this and didn't seem to have any problems, below is a very draft steps I did to have additional drive as ibays only you can also do the same for users as well...

FOLLOWING THIS HOW TO IS AT YOUR OWN RISK, SELECTING WRONG HARDDRIVE WILL LOOSE ALL DATA!
Install you new drive, then startup the system this should detect the drive /dev/sdb which is used in my example, type at command line…
Code: [Select]

[root@example20 etc]# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created

This creates a volume group descriptor at the start of disk.

Then use vgcreate…

Code: [Select]
[root@example20 etc]# vgcreate ibays_volume_group /dev/sdb
  Volume group "ibays_volume_group" successfully created


Run vgdisplay to verify volume group…

Code: [Select]
[root@example20 etc]# vgdisplay
  --- Volume group ---
  VG Name               ibays_volume_group
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               2.00 GB
  PE Size               4.00 MB
  Total PE              511
  Alloc PE / Size       0 / 0
  Free  PE / Size       511 / 2.00 GB
  VG UUID               CH4HQN-pw6T-2KUs-4Gfd-belh-TIVY-MEdN0i


Next we want to create our logical volume, You can make this any size you want and add more space at a later date…

Code: [Select]
[root@example20 etc]# lvcreate -L1G -n ibays_volume ibays_volume_group
    Logical volume "ibays_volume" created


Create the filesystem…

Code: [Select]
[root@example20 etc]# mke2fs /dev/ibays_volume_group/ibays_volume
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131072 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.


Now you can test your file system by mounting it…

/dev/mapper/ibays_volume_group-ibays_volume
              ext2     1032088      1284    978376   1% /mnt/ibays

You will see it’s got ext2 as it’s filesystem you can change this to ext3 by doing…MAKE SURE YOU UMOUNT DRIVE FIRST BEFORE THE NEXT TWO STEPS…
Run…

Code: [Select]
[root@example20 etc]# tune2fs -j /dev/ibays_volume_group/ibays_volume

Now re mount the drive and do df –T

/dev/mapper/ibays_volume_group-ibays_volume
              ext3     1032088     34092    945568   4% /mnt/ibays


Reboot and create the new quota’s on the drive by…
Code: [Select]

quotacheck –vugc /dev/ibays_volume_group/ibays_volume


Now you have created our new ibays drive we can map this in /etc/fstab (we don’t need to create any templates here, see here as to why…

http://lists.contribs.org/mailman/public/devinfo/msg09095.html

Because I’m going to symlink /mnt/ibays to /home/e-smith/files/ibays I’m going to create mkdir /mnt/ibays the move what ever data I have in /home/e-smith/files/ibays to my new location of /mnt/ibays then create the symlink back to /home/e-smith/files/~ibays.

Also make sure you do this as well if you want outside world to use as webserver…

Code: [Select]
[root@example20 /]# mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
[root@example20 /]# echo Options FollowSymLinks >> /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/85DefaultAccess
[root@example20/]# expand-template /etc/httpd/conf/httpd.conf
[root@example20 /]# /etc/init.d/httpd graceful


(watch out for the line wrapping, all on one line each of those commands)

Here is snippet from my /etc/fstab

Code: [Select]
/dev/ibays_volume_group/ibays_volume    /mnt/ibays      ext3    usrquota,grpquota       1 1
/dev/vg_primary/lv_root /                       ext3    usrquota,grpquota        1 1
/dev/md1                /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/vg_primary/lv_swap swap                    swap    defaults        0 0
/dev/hdc                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0
/dev/fd0                /media/floppy           auto    pamconsole,exec,noauto,managed 0 0

That's it!.

I have posted this on the devinfo to check this is ok, let me know if you find it useful![/size]
Title: [howto] Adding Additional Drivers
Post by: byte on April 18, 2006, 11:19:46 AM
A note to add is once you have added your drive you will get 4 message's everytime you reboot from the raid monitor to turn this off type...

Code: [Select]
config setprop raidmonitor status disabled
runsvctrl d /service/raidmonitor


And see http://bugs.contribs.org/show_bug.cgi?id=1222 for more info