第三次作业

1、要求
1、配置网络:为网卡添加一个本网段IPV4地址,x.x.x.123

2、配置yum本地仓库,并完成traceroute命令的安装

3、用至少两种方法查看sshd服务的进程号

4、添加一块10G大小的磁盘,将该磁盘分为两个主分区,大小为1G、2G。将剩余的空间全部划分为扩展分区。划分一个逻辑分区,大小为3G。(主分区文件系统类型为ext4,逻辑分区文件系统类型为xfs)

2、具体操作
1、配置网络:为网卡添加一个本网段IPV4地址,x.x.x.123

[root@localhost ~]#nmcli connection modify 'Profile 1' ipv4.method manual ipv4.addresses 192.168.121.123 autoconnect yes

 

2、配置yum本地仓库,并完成traceroute命令的安装

[root@localhost yum.repos.d]# vim yum.repo 

 

traceroute命令的安装

[root@localhost ~]# mount /dev/sr0 /mnt
[root@localhost ~]# yum -y install traceroute

 

3、用至少两种方法查看sshd服务的进程号

1)

[root@localhost ~]# ps -aux|grep sshd
使用ps -ef打开所有的进程,再用grep sshd:过滤出含有“sshd”字符的进程


2)使用top命令进行查找

 

4、添加一块10G大小的磁盘,将该磁盘分为两个主分区,大小为1G、2G。将剩余的空间全部划分为扩展分区。划分一个逻辑分区,大小为3G。(主分区文件系统类型为ext4,逻辑分区文件系统类型为xfs)

查看磁盘信息


添加成功后会增加一个sda的名称


将该磁盘分为两个主分区,大小为1G、2G,将剩余的空间全部划分为扩展分区,主分区文件系统类型为ext4

[root@localhost ~]# fdisk /dev/sda 
 
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xf8f70ec6.
 
Command (m for help): n   //#输入n创建新分区
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p    //#输入p创建主分区
Partition number (1-4, default 1): 1
First sector (2048-20971519, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519): +1G
 
Created a new partition 1 of type 'Linux' and of size 1 GiB.
 
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2099200-20971519, default 2099200): 
Last sector, +sectors or +size{K,M,G,T,P} (2099200-20971519, default 20971519): +2G
 
Created a new partition 2 of type 'Linux' and of size 2 GiB.
 
Command (m for help): n   //#输入n创建新分区
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): e     //输入e创建扩展分区
Partition number (1-4, default 1): 1
First sector (2048-20971519, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519): +4G
 
Created a new partition 1 of type 'Extended' and of size 4 GiB.
 
 
 
[root@localhost dev]# mkfs -t ext4 /dev/sda1  //更改系统类型为ext4

 划分一个逻辑分区,大小为3G,修改逻辑分区文件系

[root@localhost ~]# pvcreate /dev/sda3
WARNING: dos signature detected on /dev/sda3 at offset 510. Wipe it? [y/n]: y
  Wiping dos signature on /dev/sda3.
  Physical volume "/dev/sda3" successfully created.
[root@localhost ~]# vgcreate dbvg /dev/sda3
  Volume group "dbvg" successfully created
[root@localhost ~]# vgchange -a y dbvg 
  0 logical volume(s) in volume group "dbvg" now active
[root@localhost ~]# lvcreate -L 3G -n myvg1 dbvg
  Logical volume "myvg1" created.
[root@localhost ~]# mkfs.xfs /dev/sda3

统类型为xfs

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值