接续上篇,安装好虚拟机之后
Singularity is installed in your Vagrant Ubuntu VM! Now you can use Singularity as you would normally by logging into the VM directly
Remember that the VM is running in the background because we started it via the command vagrant up. You can shut the VM down using the command vagrant halt when you no longer need it.
vagrant ssh
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-55-generic x86_64)
安装现有镜像资源
- 从docker hub安装已有的镜像
singularity build trinityrna.sif docker://trinityrnaseq/trinityrnaseq
- 从Cloud Library安装已有的镜像
singularity build ubuntu.sif library://ubuntu
image.png
修改临时文件存储位置到非home目录后依旧报错
export SINGULARITY_LOCALCACHEDIR=/fan_large/
export SINGULARITY_CACHEDIR=/fan_large/
export SINGULARITY_TMPDIR=/fan_large/
INFO: Creating SIF file...
FATAL: While performing build: while creating SIF: while creating container: writing data object for SIF file: copying data object file to SIF file: write /home/vagrant/fan_bin/trinityrna.sif: no space left on device
-
此问题是由虚拟机创建时默认磁盘大小是20GB,Trinity比较大,超过20GB,故而不能继续写入
image.png
-
尝试解决方案一,增加磁盘容量,编辑Vagrantfile文件
VAGRANT_EXPERIMENTAL="disks"
config.vm.disk :disk, size: "30GB", primary: true
(该方案还是未能解决,添加环境变量方式错误)
@LaBelleVie:16:12:16 ~/VirtualBox VMs/vm-singularity_default_1617687821497_7397
$ VBoxManage clonehd "packer-virtualbox-iso-1606771518-disk001.vmdk" "packer-virtualbox-iso-1606771518-disk001.vdi" --format vdi
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'vdi'. UUID: 9ad0ca94-f812-4165-8e88-95350a929855
$ ll
total 10907296
drwx------ 4 lifan staff 128B 6 Apr 16:23 Logs/
-rw------- 1 lifan staff 2.7G 6 Apr 16:31 packer-virtualbox-iso-1606771518-disk001.vdi
-rw------- 1 lifan staff 2.4G 6 Apr 16:23 packer-virtualbox-iso-1606771518-disk001.vmdk
-rw------- 1 lifan staff 4.6K 6 Apr 16:31 vm-singularity_default_1617687821497_7397.vbox
-rw------- 1 lifan staff 4.6K 6 Apr 16:28 vm-singularity_default_1617687821497_7397.vbox-prev
#扩容到50GB
$ VBoxManage modifyhd "packer-virtualbox-iso-1606771518-disk001.vdi" --resize 51200
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
vagrant@vagrant:~/large-bin$ df
'Filesystem 1K-blocks Used Available Use% Mounted on
udev 474132 0 474132 0% /dev
tmpfs 100912 536 100376 1% /run
/dev/mapper/vagrant--vg-root 19519312 6080388 12424348 33% /
tmpfs 504544 0 504544 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 504544 0 504544 0% /sys/fs/cgroup
vagrant 244810132 167773692 77036440 69% /vagrant
tmpfs 100908 0 100908 0% /run/user/900
用方案二、三修改为50GB后,再下载trinity.sif还是未能成功,说明修改未彻底。于是换方法
反复尝试官方正解环境变量> 官方正解修改磁盘配置文件成功解决
分为2步
- 在
Vagrantfile
配置文件中添加
config.vm.disk :disk, size: "50GB", primary: true
- 激活环境变量
export VAGRANT_EXPERIMENTAL="disks"
并vagrant up
#激活环境变量成功
export VAGRANT_EXPERIMENTAL="disks" && \
> vagrant up
==> vagrant: You have requested to enabled the experimental flag with the following features:
==> vagrant:
==> vagrant: Features: disks
==> vagrant:
==> vagrant: Please use with caution, as some of the features may not be fully
==> vagrant: functional yet.
成功配置磁盘为50GB后的样子,注意还是原版的.vmdk文件,过程非常简洁
![](https://img.haomeiwen.com/i23091851/d4e789fe47348480.png)
vagrant@vagrant:/fan_large$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 464M 0 464M 0% /dev
tmpfs 99M 532K 99M 1% /run
/dev/mapper/vagrant--vg-root 19G 5.8G 12G 33% /
tmpfs 493M 0 493M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 493M 0 493M 0% /sys/fs/cgroup
vagrant 234G 160G 75G 69% /vagrant
tmpfs 99M 0 99M 0% /run/user/900
#未成功
INFO: Creating SIF file...
FATAL: While performing build: while creating SIF: while creating container: writing data object for SIF file: copying data object file to SIF file: write /fan_large/trinityrna.sif: no space left on device
网友评论