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