Linux第七周

1、破坏mbr表并修复

#1 破环MBR分区
[root@localhost ~]# dd if=/dev/zero of=/dev/sda bs=1 count=446
446+0 records in
446+0 records out
446 bytes (446 B) copied, 0.00218736 s, 204 kB/s

#2 虚拟机设置挂载对应Linux系统光盘并勾选已连接
#3 重启系统,开机启动界面选择 Troubleshooting > Rescue a CentOS system

#4 进入救援模式后,挂载文件系统
Please make a selection from the above:1
sh-4.2# chroot /mnt/sysimage
bash-4.2# grub2-install /dev/sda
bash-4.2# sync
bash-4.2# exit
sh-4.2# reboot
# 恢复成功

2、总结RAID的各个级别及其组合方式和性能的不同。

RAID等级最少硬盘最大容错可用容量读取性能写入性能安全性目的应用场景
010nnn一个硬盘异常,全部硬盘都会异常追求最大容量、速度影片剪接缓存用途
12n-11n1高,一个正常即可追求最大安全性个人、企业备份
531n-1n-1n-1追求最大容量、最小预算个人、企业备份
642n-2n-2n-2安全性较RAID5高同RAID5,但较安全个人、企业备份
104综合RAID 0/1优点,理论速度较快大型数据库、服务器

3、创建一个2G的文件系统,块大小为2048byte,预留1%可用空间,文件系统 ext4,卷标为TEST,要求此分区开机后自动挂载至/test目录,且默认有acl挂载选项

[root@localhost ~]# fdisk /dev/sdb
Command (m for help): n
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-10485759, default 2048): 
Last sector, +sectors or +size{K,M,G} (2048-10485759, default 10485759): +2G
Command (m for help): w

[root@localhost ~]# mkfs.ext4 -b 2048 -L 'TEST' -m 1 /dev/sdb1

[root@localhost ~]# mkdir /test
[root@localhost ~]# vim /etc/fstab
UUID=f5ab02cf-dae9-4177-a102-4e83cd1f2df2 /test        ext4      acl        0 0
[root@localhost ~]# reboot
[root@localhost ~]# df
/dev/sdb1                 1998538    9236   1960140   1% /test

4、创建一个至少有两个PV组成的大小为20G的名为testvg的VG;要求PE大小 为16MB, 而后在卷组中创建大小为5G的逻辑卷testlv;挂载至/users目录

[root@localhost ~]# pvcreate /dev/sdc1 /dev/sdc2 
[root@localhost ~]# pvs
  /dev/sdc1         lvm2 ---   10.00g  10.00g
  /dev/sdc2         lvm2 ---  <10.00g <10.00g

[root@localhost ~]# vgcreate -s 16M testvg /dev/sdc1 /dev/sdc2
[root@localhost ~]# lvcreate -L 5G -n testlv testvg
[root@localhost ~]# lvs                                                    
  testlv testvg -wi-a-----  5.00g

[root@localhost ~]# mkfs.ext4 /dev/testvg/testlv
[root@localhost ~]# mount /dev/testvg/testlv /users/
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值