Linux综合实验

RHCSA综合试验

一、试验目的

1、掌握设备挂载、磁盘分区、格式化的方法

2、掌握RAID的配置、LVM配置的方法

3、掌握磁盘配额、强制位与冒险位的配置方法

二、实验简图

1、准备四块同样大小的2G盘,如图所示,依次为/dev/sdb  /dev/sdc   /dev/sdd  /dev/sde

2、将/dev/sdb与/dev/sdc创建成/dev/md2(RAID1设备),/dev/sdd与/dev/sde创建成/dev/md3(RAID1设备)

3、将/dev/md2与/dev/md3创建成/dev/md1(RAID0设备)

4、将/dev/md1创建成LVM逻辑卷,卷组名:lvm0

5、创建逻辑卷:/dev/lvm0/haha

6、创建两个用户:cisco与redhat

7、磁盘配额:cisco:300M      redhat:100M

8、以上完成后并设置冒险位

三、实验步骤

1、添加四块硬盘

2、将每个盘分成一个主分区,并更改文件系统格式为fd

3、创建RAID1设备

3、创建RAID0设备

4、创建物理卷

5、创建卷组

6、创建逻辑卷

7、格式化逻辑卷

8、挂载

手动挂载

或开机挂载

9、创建用个用户

10、磁盘配额

分区挂载选项上添加参数

b  生成磁盘配额数据库

c  启用磁盘配额

d  编辑磁盘配额

e 测试

[root@study ~]# chmod 777 /mnt/haha

[root@study ~]# su - cisco

[cisco@study ~]$ cd /mnt/haha

[cisco@study haha]$ dd if=/dev/zero of=file1 bs=1M count=85

记录了85+0 的读入

记录了85+0 的写出

89128960字节(89 MB)已复制,0.393209 秒,227 MB/秒

[cisco@study haha]$ dd if=/dev/zero of=file1 bs=1M count=300

记录了300+0 的读入

记录了300+0 的写出

314572800字节(315 MB)已复制,11.1679 秒,28.2 MB/秒

[cisco@study haha]$ dd if=/dev/zero of=file2 bs=1M count=80

dm-0: warning, user block quota exceeded.

记录了80+0 的读入

记录了80+0 的写出

83886080字节(84 MB)已复制,3.60034 秒,23.3 MB/秒

[cisco@study haha]$ dd if=/dev/zero of=file3 bs=1M count=30

dm-0: write failed, user block limit reached.

dd: 正在写入"file3": 超出磁盘限额

记录了11+0 的读入

记录了10+0 的写出

11137024字节(11 MB)已复制,0.749315 秒,14.9 MB/秒

[cisco@study haha]$ 

11、冒险位

[root@study mnt]# ll

总用量 1

drwxrwxrwt. 3 root root 1024 1月   1 20:44 haha

测试

[root@study mnt]# su - cisco

[cisco@study ~]$ cd /mnt/haha

[cisco@study haha]$ touch test1 test2

touch: 无法创建"test1": 超出磁盘限额

touch: 无法创建"test2": 超出磁盘限额

[cisco@study haha]$ ll

总用量 400029

-rw-------. 1 root  root       7168 1月   1 20:42 aquota.group

-rw-------. 1 root  root       7168 1月   1 20:37 aquota.user

-rw-rw-r--. 1 cisco cisco 314572800 1月   1 20:43 file1

-rw-rw-r--. 1 cisco cisco  83886080 1月   1 20:43 file2

-rw-rw-r--. 1 cisco cisco  11137024 1月   1 20:44 file3

drwx------. 2 root  root      12288 1月   1 20:14 lost+found

[cisco@study haha]$ rm file3

[cisco@study haha]$ touch test1 test2

[cisco@study haha]$ ll

总用量 389154

-rw-------. 1 root  root       7168 1月   1 20:42 aquota.group

-rw-------. 1 root  root       7168 1月   1 20:37 aquota.user

-rw-rw-r--. 1 cisco cisco 314572800 1月   1 20:43 file1

-rw-rw-r--. 1 cisco cisco  83886080 1月   1 20:43 file2

drwx------. 2 root  root      12288 1月   1 20:14 lost+found

-rw-rw-r--. 1 cisco cisco         0 1月   1 20:54 test1

-rw-rw-r--. 1 cisco cisco         0 1月   1 20:54 test2

[cisco@study ~]$ su - redhat

密码:

[redhat@study ~]$ cd /mnt/haha

[redhat@study haha]$ rm -rf test*

rm: 无法删除"test1": 不允许的操作                            成功

rm: 无法删除"test2": 不允许的操作                            成功

[redhat@study haha]$ ^C

[redhat@study haha]$ 

12、实验结束

你可能感兴趣的:(linux)