1、配置网络:为网卡添加一个本网段IPV4地址,x.x.x.123
2、配置yum本地仓库,并完成traceroute命令的安装
3、用至少两种方法查看sshd服务的进程号
4、添加一块10G大小的磁盘,将该磁盘分为两个主分区,大小为1G、2G。将剩余的空间全部划分为扩展分区。划分一个逻辑分区,大小为3G。(主分区文件系统类型为ext4,逻辑分区文件系统类型为xfs)
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 10G 0 disk
sr0 11:0 1 8.4G 0 rom
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
└─nvme0n1p2 259:2 0 19G 0 part
├─rhel-root 253:0 0 17G 0 lvm /
└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@localhost ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.37.4).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
fdisk: cannot open /dev/sdb: No such file or directory
[root@localhost ~]# p
bash: p: command not found...
[root@localhost ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.37.4).
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 0x7dc9180e.
Command (m for help): p
Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7dc9180e
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default 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
Partition type
p primary (2 primary, 0 extended, 2 free)
e extended (container for logical partitions)
Select (default p): e
Partition number (3,4, default 3): 3
First sector (6293504-20971519, default 6293504):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (6293504-20971519, default 20971519):
Created a new partition 3 of type 'Extended' and of size 7 GiB.
Command (m for help): n
All space for primary partitions is in use.
Adding logical partition 5
First sector (6295552-20971519, default 6295552):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (6295552-20971519, default 20971519): +3G
Created a new partition 5 of type 'Linux' and of size 3 GiB.
Command (m for help): p
Disk /dev/sda: 10 GiB, 10737418240 bytes, 20971520 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7dc9180e
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 6293503 4194304 2G 83 Linux
/dev/sda3 6293504 20971519 14678016 7G 5 Extended
/dev/sda5 6295552 12587007 6291456 3G 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# mkfs.ext /dev/sda1
bash: mkfs.ext: command not found...
[root@localhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 10G 0 disk
├─sda1 8:1 0 1G 0 part
├─sda2 8:2 0 2G 0 part
├─sda3 8:3 0 1K 0 part
└─sda5 8:5 0 3G 0 part
sr0 11:0 1 8.4G 0 rom
nvme0n1 259:0 0 20G 0 disk
├─nvme0n1p1 259:1 0 1G 0 part /boot
└─nvme0n1p2 259:2 0 19G 0 part
├─rhel-root 253:0 0 17G 0 lvm /
└─rhel-swap 253:1 0 2G 0 lvm [SWAP]
[root@localhost ~]# mkfs.ext4 /dev/sda1
mke2fs 1.46.5 (30-Dec-2021)
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: 84835d08-f215-49e9-b597-97a9d5201238
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
[root@localhost ~]# partprobe
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
[root@localhost ~]# mkfs.ext4 /dev/sda1
mke2fs 1.46.5 (30-Dec-2021)
/dev/sda1 contains a ext4 file system
created on Fri Feb 17 02:30:24 2023
Proceed anyway? (y,N) y
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: 4cd35227-4878-4dae-adef-89e5d01880c3
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
[root@localhost ~]# mkfs.ext4 /dev/sda2
mke2fs 1.46.5 (30-Dec-2021)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: a3239ef5-5195-412e-8df9-032c52265cf9
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
[root@localhost ~]# mkfs.xfs /dev/sda5
meta-data=/dev/sda5 isize=512 agcount=4, agsize=196608 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1 bigtime=1 inobtcount=1
data = bsize=4096 blocks=786432, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@localhost ~]# blkid
/dev/sda1: UUID="4cd35227-4878-4dae-adef-89e5d01880c3" TYPE="ext4" PARTUUID="7dc9180e-01"
/dev/mapper/rhel-swap: UUID="152e3529-b2c9-4f88-bb2b-59df3d3db7ce" TYPE="swap"
/dev/nvme0n1p1: UUID="e8e03b49-7398-4178-8c6d-52a845fd8334" TYPE="xfs" PARTUUID="39775ae9-01"
/dev/nvme0n1p2: UUID="nRX2Fj-0t27-mUNq-zqsQ-z2aI-4mol-xDMRaX" TYPE="LVM2_member" PARTUUID="39775ae9-02"
/dev/sr0: UUID="2022-10-27-08-34-36-00" LABEL="RHEL-9-1-0-BaseOS-x86_64" TYPE="iso9660" PTUUID="3854687c" PTTYPE="dos"
/dev/mapper/rhel-root: UUID="e45a94da-20aa-471d-97fe-a3f0b0559a6b" TYPE="xfs"
/dev/sda2: UUID="a3239ef5-5195-412e-8df9-032c52265cf9" TYPE="ext4" PARTUUID="7dc9180e-02"
/dev/sda5: UUID="50c0cfd6-b03a-4659-b40f-80ea66c322e3" TYPE="xfs" PARTUUID="7dc9180e-05"