Solution for insufficient home space under dual system (win10+Ubuntu) (detailed!)

Recently, when learning the object detection algorithm, I need to install the detectron2 environment under Ubuntu 20.04. Since the acaconda is too large (plus the configured environment is nearly 30G), there is a problem of insufficient home memory . I refer to many methods and find it. A solution that does not limit the space and can directly share files with Windows at the same time ( pro-test is effective!!! )

1. Windows environment

  1. First of all, we need to obtain the space that needs to be allocated to Ubuntu. I gave 40 G here, and I chose to allocate the E drive (because I organized it later, it has been shared. When creating a new volume, it must be empty !! ! )

win+x打开磁盘管理进行新建空白卷

At this time, our E disk is the bridge between us and the ubuntu system, and it is also the space we allocate for ubuntu to mount

  1. Create a new folder under the disk for sharing, right-click and set the property to share, and add the Everyone user to ensure that all subsystems can share the folder. The files we need to transfer from Windows to ubuntu can also be opened and run on the Ubuntu system

  1. Windows shared environment settings

Open the control panel, select Network and Internet, select Network and Sharing Center, enter the page of changing advanced sharing settings, and open two sharing options, as shown in the figure:

2. Ubuntu environment

  1. First we check our disk information

sudo fdisk -l

Find the partition corresponding to the hard disk we want to mount (according to the memory identification, my 40G here is /dev/nvme0n1p5)

  1. Then we check the UUID of the partition to be mounted

sudo blkid
  1. Create a mount point, we create a new folder in the home directory for the mount point

cd /home/lizong
mkdir shares

Among them, shares is our mount point, we need to mount it to the E disk we have processed (the corresponding partition under Ubuntu)

  1. Modify fstab file for permanent mount

sudo gedit /etc/fstab

最后一行加上挂载的信息,第一个是刚才对应的UUID,第二个是新建的挂载点的地址,文件系统类型为ext4

  1. 最后我们进行挂载操作,执行如下代码实现永久挂载

sudo mount -a
df -kh

三、 结语

到这里我们的解决方案就结束了,最终实现了共享文件夹在挂载磁盘下的一个情况,我们在同一个空间内既能实现软件的迁移使用(亲测有效!!!软件也可以安装在这里运行!!!)又能和Windows实现文件的传输!

注意:先进行挂载会导致在shares文件夹下不能新建和使用文件,只能存储文件的问题

Guess you like

Origin blog.csdn.net/qq_62517226/article/details/128708656