龚强考试

1 创建虚拟机

2 配置ip地址
vim /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR=192.168.18.166
NETMASK=255.255.255.0
[root@sss ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:44:FC:64
inet addr:192.168.18.128 Bcast:192.168.18.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:977 errors:0 dropped:0 overruns:0 frame:0
TX packets:309 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:89783 (87.6 KiB) TX bytes:47351 (46.2 KiB)
Interrupt:67 Base address:0x2000

3 磁盘阵列
添加三块硬盘
分区:
fdisk /dev/sdb
n>p>1>enter>enter>p>w
fdisk /dev/sdc
n>p>1>enter>enter>p>w
fdisk /dev/sdd
n>p>1>enter>enter>p>w
更新分区:
partprobe
创建分区
[root@sss ~]# mdadm --create --auto=yes /dev/md1 -- level=5 --raid-devices=2 --spare-devices=1 /dev/sdb1 /dev/sdc1 /dev/sdd1
mdadm: array /dev/md1 started.

4 格式化硬盘mkfs.ext3 /dev/md1

5 配置开始制动加载mdadm.conf和fstab配置文件
ARRAY /dev/md1 UUID=fc381504:6fd20332:7743c6ce:9056ed18
/dev/md1 /home ext3 defaults 0 0

6 开机启动
vim /etc/fstab
/dev/md1 /home ext3 defaults,usrquota,grpquota 0 0

mount -a
ls /home/
lost+found

7 添加用户
#!/bin/bash
groupadd group
for laoyuname in laoyu1 laoyu2 laoyu3 laoyu4 laoyu5 laoyu6 laoyu7 laoyu8 laoyu9 laoyu10
do laoyuadd -g group $laoyuname
echo "123456"|passwd --stdin $laoyuname

8 支持配额限制
/dev/md1 on /home type ext3 (rw,usrquota,grpquota)

9 创建数据文件
quotacheck -avug
[root@sss ~]# ls /home/
abc1 abc2 abc4 abc6 abc8 aquota.group lost+found
abc10 abc3 abc5 abc7 abc9 aquota.laoyu

10 设置用户配额
edquota -u abc1

11 开启配额
quotaon -a
chmod o+w /home/
su - abc1

12 编辑用户配额
Disk quotas for laoyu laoyu1 (uid 500):
Filesystem blocks soft hard inodes soft hard
/dev/md1 0 5000 5500 0 0 0

13 编辑组配额
Disk quotas for group group (gid 511):
Filesystem blocks soft hard inodes soft hard
/dev/md1 0 50000 50000 0 0 0

14 日志(客户端配置)
vim /etc/syslog.conf
*.* @192.168.18.156
/etc/init.d/syslog restart

15 日志(服务器)
vim /etc/sysconfig/syslog
SYSLOGD_OPTIONS="-m 0 -r"
service syslog restart

本文出自 “zcy” 博客,谢绝转载!

你可能感兴趣的:(考试,frame,IP地址,errors,1500)