Engr. F. Azam

An Internet Professional – Dedicated for SEO and Open Source Community

Archive for the ‘Linux Server’ Category

To do Disk Mirrorring With Software Raid In Debian

Posted by Rock on September 3, 2007

To do Disk Mirrorring With Software Raid In Debian follow the following

1. Normal boot at start up with the boot disk
2. Manual Network configuration
3. Create the  Partition as follows
We use 41 GB > 40 GB as /
1 GB as swap
In first HDD>> ***follow the partition sequence strictly

/ as RAID and Add boot able flag with this partition (most important)
Rest of it swap format it as swap

In Second HDD>> ***follow the partition sequence strictly
As same as the first one and mantain the partition sequence

4. Configure Software RAID > give it ‘yes’
5. Then Create MD Device
6. select RAID 1
7. number of active device for the RAID1 array: give here the value 2
8. Number of spare devices for the RAID1 array: give here the value 0

9. Now select the active RAID devices to create array >
Select the two partition with * and then >continue>finish

10. Now it shows up a new RAID1 device with 40 GB space along with the
two HDD as IDE1 and IDE2
> Format it with ext3 file system and mount as / (The RAID1 device not
the others leave others untouchable)

11 . After completion > Finish partitioning and write changes to disk
12 . Write changes to disk > Yes
13 . Load GRUB on MBR > Yes
14. Now complete as usual

After the completion the installation login as root user and then follow
the procedures >

1 .run the command

#cat /proc/mdstat

it will show the syncing process of two devices.run this periodically to
see when the process finish. before finishing don’t reboot or shutdown
the pc that will cause errors.

After finishing the process run these commands
#root (hd1,0)
#setup (hd1)

it will setup the GRUB boot image on second HDD
Now Reboot the PC.

After rebooting do some changes with files and packages then shutdown
the PC.
Now for testing Boot up the PC with unplugging the master HDD
If the PC reboot and run normally and all previously made changes will
remain up to date then all is ok

Now this is the time to Bring the first HDD up

1. Reboot the system with Plug in the Primary HDD.

2. Now erase all partitions on primary harddisk drive and do partition
again  40 GB as /  & 1 GB as swap, make / Bootable
You can make this by using fdisk or cfdisk utilities.

3 .Now Run these commands to add this device as mirror
#mdadm /dev/md0 -f /dev/hda1
#mdadm /dev/md0 -a /dev/hda1
#cat /proc/mdstat         to see the syncing process. Run it
periodically to see the progress before it will finish do nothing.
After completion of the syncing process  do as follows

1. Edit /boot/grub/menu.lst (Only the Red line)

title           Debian GNU/Linux, kernel 2.4.27-2-386 >Boot from HDD1
root            (hd0,0)
kernel          /boot/vmlinuz-2.4.27-2-386 root=/dev/md0 ro
initrd          /boot/initrd.img-2.4.27-2-386

2. Add following lines at /boot/grub/menu.lst  under the previous
step(This time you will add all lines as follows)

title           Debian GNU/Linux, kernel 2.4.27-2-386 >Boot from HDD2
root            (hd1,0)
kernel          /boot/vmlinuz-2.4.27-2-386 root=/dev/md0 ro
initrd          /boot/initrd.img-2.4.27-2-386

3. After saving these things run following commands
#root (hd0,0)
#setup (hd0)

4. Now Reboot the PC to see the new GRUB menu with Boot option from both
HDD, try to boot from both HDD individually and see that they will
updating the data on both disks .if boot from both HDD and updates all
then all will fine.


Posted in Disk Mirrorring, Linux Server | Leave a Comment »

Time Based Internet

Posted by Rock on August 26, 2007

To configure a time based broadband internet service you may add these following few lines inside the squid.conf file:

#Add this to the bottom of the ACL section of squid.conf
#Recommended minimum configuration: ( Under this line )

acl user01 src
acl user02 src
acl user03 src

###Time Mention#####
acl m_t time S M T W H A 13:00-15:00
acl l_t time S M T W H A 18:00-22:58
acl all_t time  S M T W H F A 00:10-24:00

# And finally deny all other access to this proxy (Under this line)

http_access allow user01 all_t
http_access allow user02 l_t
http_access allow user03 m_t

——————————–Brief Discussion———————————

Access Control List defines user one as ‘user01’ with IP address:

Categories time by key word ‘m_t’ ; ‘l_t’  and ‘all_t’

S M T W H F A stands for 7 days , like S = Sun Day, M = Mon Day etc.

At the last stage, http access by the name key & time key.

Lets try it ! Should you have any question regarding this , email me.

Posted in Linux Server | Leave a Comment »