安装一个linux系统,选择自动分区,并添加五块硬盘。
设置ip地址:[root@localhost ~]# ifconfig eth0 192.168.0.100
[root@localhost ~]# service network restart

格式化磁盘并设置分区:
设置分区:
[root@localhost ~]# fdisk /dev/sdb
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-2610, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-2610, default 2610):
Using default value 2610

Command (m for help): w

其余四块参考第一块

[root@localhost ~]# fdisk -l   #查看分区状况
格式化磁盘分区:
[root@localhost ~]# mkfs.ext3 /dev/sdb1
[root@localhost ~]# mkfs.ext3 /dev/sdc1
[root@localhost ~]# mkfs.ext3 /dev/sdd1
[root@localhost ~]# mkfs.ext3 /dev/sde1
[root@localhost ~]# mkfs.ext3 /dev/sdf1
[root@localhost ~]# partprobe
建立raid:
[root@localhost ~]# mdadm --create --auto=yes /dev/md1 --level=5 --raid-devices=4 --spare-devices=1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
查看raid设备信息:
[root@localhost ~]# mdadm --detail /dev/md1
格式化raid:
[root@localhost ~]# mkfs.ext3 /dev/md1

自动挂载:
[root@localhost ~]# mdadm --detail /dev/md1 | grep -i uuid
           UUID : 1357c463:8553db54:86b1203e2:dea437e0
[root@localhost ~]# vim /etc/mdadm.conf
ARRAY /dev/md1  UUID=1357c463:8553db54:86b1203e2:dea437e0
[root@localhost ~]# vim /etc/fstab
/dev/md1  /mnt  ext3   defaults   0    0


设置磁盘配额:
创建用户和组:
[root@localhost ~]# vim useradd.sh
#! /bin/bash
groupadd su
for username in su1 su2 su3 su4 su5 su6 su7 su8 su9 su10
do
   useradd -g su $username
   etho "123456" |passwd --stdin $username
done

[root@localhost ~]# mount /dev/md1 /mnt
[root@localhost ~]# cd /mnt
[root@localhost mnt]# ls
lost+found
[root@localhost mnt]# mount -o remount,usrquota,grpquota /mnt/
[root@localhost mnt]#
[root@localhost mnt]# vim /etc/fstab
/dev/md1  /mnt  ext3   defaults,usrquota,grpquota  0    0

[root@localhost mnt]# unmount /mnt/
[root@localhost ]# vim /etc/fstab
[root@localhost mnt]# mount -a
[root@localhost mnt]# mount
/dev/md1 on /mnt type ext3 (rw,usrquota,grpquota)
[root@localhost mnt]# ls
aquota.group  aquota.user  lost+found
[root@localhost mnt]#
建立数据文件:
[root@localhost mnt]# cd
[root@localhost ~]# quotacheck -avug
quotacheck: Scanning /dev/md1 [/mnt] done
quotacheck: Checked 3 directories and 4 files

编辑配额:
[root@localhost mnt]# edquota -u su1
修改:
Disk quotas for su su1 (uid 500):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/md1                          0       25000       30000      0        0        0                     

[root@localhost mnt]# edquota -p su1 -u su2
[root@localhost mnt]# edquota -p su1 -u su3
[root@localhost mnt]# edquota -p su1 -u su4
[root@localhost mnt]# edquota -p su1 -u su5
[root@localhost mnt]# edquota -p su1 -u su6
[root@localhost mnt]# edquota -p su1 -u su7
[root@localhost mnt]# edquota -p su1 -u su8
[root@localhost mnt]# edquota -p su1 -u su9
[root@localhost mnt]# edquota -p su1 -u su10
[root@localhost mnt]# edquota -g su

Disk quotas for group su (gid 500):
  Filesystem                   blocks       soft       hard     inodes     soft     hard
  /dev/md1                          0          250000    300000    0        0        0

[root@localhost mnt]# edquota -t    修改宽限时间
  Filesystem             Block grace period     Inode grace period
  /dev/md1                      14days                  7days

设置软链接:

[root@localhost ~]# ln -s /home /mnt
[root@localhost ~]# cd /home
[root@localhost home]# ll
[root@localhost home]# cd
[root@localhost ~]#
[root@localhost ~]# cd /mnt
[root@localhost mnt]# ll
总计 32
-rw------- 1 root root  7168 12-28 15:58 aquota.group
-rw------- 1 root root  7168 12-28 15:59 aquota.user
lrwxrwxrwx 1 root root     5 12-28 16:49 home -> /home
drwx------ 2 root root 16384 12-28 14:51 lost+found

日志服务:
对十个用户主机设置ip。192.168.0.1;192.168.0.2;192.168.0.3;192.168.0.4;192.168.0.5;192.168.0.6;192.168.0.7;192.168.0.8;192.168.0.9;192.168.0.10;
以192.168.0.1为例:
[root@localhost ~]# vim /etc/syslog.conf

# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console
*.*                                                    @192.168.0.100

在服务器:(192.168.0.100)
[root@localhost ~]# vim /etc/sysconfig/syslog
修改:SYSLOGD_OPTIONS="-m 0 -r"
重启日志服务:
[root@localhost ~]# service syslog restart
关闭内核日志记录器:                                       [确定]
关闭系统日志记录器:                                       [确定]
启动系统日志记录器:                                       [确定]
启动内核日志记录器:                                       [确定]
[root@localhost ~]#

测试:[root@localhost ~]# tail -f /var/log/messages
 

[root@localhost ~]# chmod o+w /mnt/
[root@localhost ~]# ll -d /mnt
drwxr-xrwx 3 root root 4096 12-28 16:56 /mnt
[root@localhost ~]# su - su1
[user1@localhost ~]$ cd /mnt
[user1@localhost mnt]$ dd if=/dev/zero of=su1 bs=1M count=25
[user1@localhost mnt]$ dd if=/dev/zero of=su11 bs=1M count=20