构建U盘Linux
参考文章:https://blog.csdn.net/weixin_43124455/article/details/89667940
按照上文的步骤,已经可以在U盘构建一个Linux系统了。因此本文主要记录遇到的问题。
1. Unable to locate package
apt-get update
apt-get upgrade
2. U盘无法连接到虚拟机
问题 : U盘连接到虚拟机时,出现以下提示。
![image-20211128191205177](https://img-blog.csdnimg.cn/img_convert/935323a8882ddda112f5aa168ed3e4e1.png)
解决方法:将USB兼容性改为 3.1。
如果还是不能解决,尝试以下命令
sudo apt-get install exfat-utils
查看U盘分区:输入以下命令,查看最后一行
fdisk -l
![image-20211128160501343](https://img-blog.csdnimg.cn/img_convert/76944c932054c59572361686bb77a12a.png)
3. can’t open /dev/tty3: No such file or directory
在参考文章中 无盘构建根文件系统 目录下。如果按照他给的命令输入。在最后运行的时候,会出现以下错误。
can't open /dev/tty3: No such file or directory
can't open /dev/tty4: No such file or directory
需要添加以下命令
mknod tty c 5 0
mknod console c 5 1
mknod null c 1 3
mknod ram b 1 0
mknod tty1 c 4 1
mknod tty2 c 4 2
mknod tty3 c 4 3
mknod tty4 c 4 4
chmod 666 tty console null
chmod 666 tty1 tty2 tty3 tty4
chmod 600 ram
4. 测试部分
测试部分是新创建一个虚拟机,U盘插在主机上,而不是虚拟机上。
其余部分跟着做就行了。出现以下画面时,回车。
![image-20211128164549133](https://img-blog.csdnimg.cn/img_convert/cbaa0d5c7625d7c1c6b99b4c71dec2e1.png)
当没有内容出现时,就可以输入命令了。
![image-20211128193432314](https://img-blog.csdnimg.cn/img_convert/c7f47a899af3df429f459fe174dff405.png)
|