发布网友 发布时间:2022-04-30 03:55
共1个回答
热心网友 时间:2023-10-10 16:42
第一步: 对硬件进行设置,使其满足要求并下载内核:
1. 新添加一块20G的硬盘及修改内存:
2.检查当前的内核版本: uname -r
3.到官网:查看最新稳定版内核并下载
如果虚拟机不能上网(如何让虚拟机上网,参考本人相关博文),那也没有关系,直接从*下载好后,用xshell工具上传至虚拟机。如图:
在xshell的终端输入rz,打开下面的上传界面:
上传即可。
或者点击下面按钮也可以:
如果虚拟机可以联网:不妨从虚拟机直接下载。
[root@xiaolyu ~]# wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.7.2.tar.xz
第二步: 使用硬盘:分区、格式化、挂载:
[root@xiaolyu ~]# fdisk /dev/sdb //对磁盘/dev/sdb进行格式化。
Welcome to fdisk (util-linux 2.23.2).
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
Building a new DOS disklabel with disk identifier 0x63b985bb.
Command (m for help): m //查看帮助信息。
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-41943039, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):
Using default value 41943039
Partition 1 of type Linux and of size 20 GiB is set
Command (m for help): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x63b985bb
Device Boot Start End Blocks Id System
/dev/sdb1 2048 41943039 20970496 83 Linux
Command (m for help):
Command (m for help): w