公司服务器自动分区,IP=192.168.0.100 现上级要求使用软件磁盘阵列为服务器上的普通用户家目录进行配额限制,且此服务器所有日志信息都写到192.168.0.10这台机器上 服务器上用户有10个 用户名自定义 ip地址自定义,限额数值自定义,但需要在文档中标明。 1.新装一台虚拟机,选择默认分区,并且添加5块硬盘,5块硬盘做RAID 2.装好后在终端输入命令setup命令设置ip,ip为192.168.0.100 3.建立RAID设备,输入命令mdadm --create --auto=yes /dev/md1 --level=5 --raid-devices=4 --spare-devices=1 /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf1,系统提示mdadm:array /dev/md1 started,建立RAID成功! 4.mkfs.ext3 /dev/md1 格式化raid设备,在/mnt下建立/raid5,然后输入mount /dev/md1 /mnt/raid5/挂载上去 5.挂载成功,输入cd /mnt/raid ,在输入 ls ,出现lost+found,成功! 6.ln -s /home/* /mnt/raid5 7.cd /mnt/raid5 8.ll查看 9.mount -o remount,userquota,grpquota /mnt/raid5 10.输入quotacheck -augv来建立数据文件 11.edquota -u lijuntong 来给lijuntong用户编辑配额 12.edquota -p lijuntong -u lijuntong1 将lijuntong用户配额复制给其他用户 edquota -p lijuntong -u lijuntong2 edquota -p lijuntong -u lijuntong3 edquota -p lijuntong -u lijuntong4 edquota -p lijuntong -u lijuntong5 edquota -p lijuntong -u lijuntong6 edquota -p lijuntong -u lijuntong7 edquota -p lijuntong -u lijuntong8 edquota -p lijuntong -u lijuntong9 13.设置RAID的自动挂载 77 vim /etc/mdadm.conf RAY /dev/md1 UUID=29db8f34:1b8c789a:74072e0f:26e90231 14.设置权限RAID5权限,cd /mnt/raid5,chmod o+w /mnt/raid5 15.把收到日志信息的IP指向192.168.0.10,输入:vim /etc/syslog.conf,在#kern.* /dev/console下一行添加一条*.* @192.168.0.10,输入service syslog restart重启日志服务 16.在192.168.0.10终端上输入vim /etc/sysconfig/syslog,把SYSLOGD_OPTIONS="-m 0”改为 SYSLOGD_OPTIONS="-m 0 -r",输入service syslog restart重启日志服务 17.在192.168.0.10终端上输入tail -f /var/log/messages查看,成功!