
第一步: 对硬件进行设置,使其满足要求并下载内核:
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
安装NTFS-3G驱动,NTFS-3G 是一个由 Tuxera 公司开发并维护的开源项目,目的是为 Linux 提供 NTFS 分区的的驱动程序。能够安全快速的对 Windows NT (包括 Windows 2000、Windows XP、Windows Server 2003 和 Windows Vista)的文件系统进行读写。搜索“Open Source: NTFS-3G”即可找到这个软件包,下载最新的稳定版本,得到 ntfs-3g_ntfsprogs-2015.3.14.tgz, 在管理员权限下进行如下 *** 作:1
2
3
4
#解压:
tar xvf ntfs-3g_ntfsprogs-2015.3.14.tgz
#配置并编译安装:
cd ntfs-3g_ntfsprogs-2015.3.14 &sh configure &make &make install
安装完成后,我们就可以尝试挂载NTFS分区了,先用fdisk查看哪些分区是NTFS:
fdisk -l /dev/sda
假定/dev/sda1是NTFS分区,那么就挂载如下:
mount -t ntfs-3g /dev/sda1 /mnt -o force
进入/mnt,这就磁盘C NTFS分区了,可查看并读写文件。
安装ntfs-3g这个软件,然后在/mnt下新建一个文件夹,例如disk文件夹,然后用mount命令将移动硬盘挂在到/mnt/disk下。命令如下(确保你有管理员权限而且已经安装了ntfs-3g这个软件):
mkdir
/mnt/disk
mount
-t
ntfs-3g
/dev/sdb
/mnt/disk
用你自己的移动硬盘的设备名替换掉/dev/sdb
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)